Download Key Detection in Musical Signals

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Radio transmitter design wikipedia , lookup

Index of electronics articles wikipedia , lookup

Wien bridge oscillator wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Transcript
Senior Project – Electrical Engineering – 2007
Key Detection in Musical Signals
Philip Brown
Advisor: Dr. Shane Cotter
Goal
Note Identification
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.
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.
Spectral Analysis Using Constant Q
0.14
0.12
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]
Amplitude
0.1
0.08
[12 0 7 0 10 9 0 11 0 6 0 8]
Then the rest of the values are set to 1:
0.06
0.04
0.02
0
40
60
80
100
120
140
Frequency(Hz)
160
180
200
220
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.
[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
Result: Key vs. Time
Key Approx for "Center of Gravity"
18
16
14
12
Peak Finding
Key
10
Using for loop statements, the peaks of
spectrograms above a certain amplitude
are identified, and the frequencies and
amplitudes are outputted.
8
6
4
2
0
0
20
40
60
80
100
Time(s)
120
140
160
180