Title: Result: Key vs' Time
1Senior Project Electrical Engineering
2007 Key Detection in Musical Signals Philip
Brown Advisor Dr. Shane Cotter
Goal To input a musical signal and output a
relation of an approximation of the musical key
versus time. This is achieved via the processes
described herein.
Note Identification Each outputted frequency is
matched with a musical note, and its amplitude is
added to a corresponding element of a 12-element
matrix A Bb B C C D Eb E F F G G
Musical Signal Western music is comprised of
twelve notes. Keys are collections of these notes
(usually seven) that form a pattern. Major keys,
for example, have the following number of steps
in between scale elements 2-2-1-2-2-2-1.
Data Storage Ten seconds worth of note matrix
data is stored. When each new matrix comes in,
the oldest is deleted the sum of these matrices
is outputted.
Key Identification When the sum of the data is
received, the 5 lowest values are set to 0 12
1 7 2 10 9 4 11 3 6 5 8 12 0 7 0
10 9 0 11 0 6 0 8 Then the rest of the
values are set to 1 1 0 1 0 1
1 0 1 0 1 0 1 This is then compared with
pre-stored key values, and if it matches a key,
the key is outputted. In this case, the key is A
Spectral Analysis Using Constant Q The
Constant Q Transform (above) provides an
exponential frequency axis for spectral analysis.
This is ideal for music because the spacing of
musical notes increases exponentially, thus it
provides a more accurate spectrogram than the FFT.
Result Key vs. Time
Peak Finding Using for loop statements, the peaks
of spectrograms above a certain amplitude are
identified, and the frequencies and amplitudes
are outputted.