Summary: This module demonstrates how we use Matlab to determine if a guitar player is playing single notes or chords.
The input file is divided into 8000 sample lengths with each chunk being processed separately For the 48kHz sample rate we used in our tests, that means each section is 1/6th of a second long. The program takes the FFT of chunk and then uses a low pass filter to smooth out the peaks.
| FFT of Sample Chunk with Notes Marked |
|---|
![]() |
The peak detection works by finding the maximum value of the given signal, and then looking for areas where the signal is higher than 1/3rd of that maximum. As the stems on the graph demonstrates, the program marks peaks on their falling edge, right as they pass back below the threshold. This method works fairly well, but will sometimes miss a peak if it isn't as high as the threshold. If I were to lower the threshold, however, noise would sometimes be counted as a peak.
| Number of Simultaneous Notes Over Song |
|---|
![]() |