Winter Week 1 - Prototyping
- Ashish Sareen
- Jan 8, 2020
- 2 min read
This week we began development by prototyping our chord recognition software using environment other than Code Composer Studio. Our reason is that languages such as Python and Matlab are easier to work with, and once a working build is made, it can be migrated to Code Composer Studio for the LCDK. My partner found existing chroma feature creation libraries in Python and implemented some basic tests with simple chords.
I worked in MATLAB to begin the process of chroma feature extraction. I found a resource that explained the music theory that relates audio frequencies to common musical notation, such as notes, scales, octaves. The notes that we use follow an exponential function, which can be approximated using fractional powers of 2. Using this knowledge and other guidelines from this resource, I experimented with chroma feature extraction.
First, I created a triad, which is a chord made up of three notes, by combining three pure sinusoids of different notes. Then, I tried to apply different windowing functions, such as a hamming and hanning window to the signal. This technique aimed to reduce spectral leakage after taking the Fast Fourier transform of the time-domain signal.
After taking the Fourier transform, I began working on the algorithm to convert the frequency content of the signal into the chroma feature. There are 12 bins in a chroma feature, with each corresponding to a note in the scale. After 12 notes, the scale repeats in a higher octave, with notes separated by an octave being related by a factor of two in frequency. My initial thought was to work in the lowest octave, and convert every note in a higher octave to the lowest octave by power-of-two divisions.
Then, I simply sorted the data into the bins based on their frequencies. I found that this algorithm only worked for some chords, and I realized that the exponential relationship through octaves needed more sensitivity for the notes to be sorted properly.
I plan to explore more algorithms next week and work with my partner on his research.
Comments