An interesting application of the Fourier transform to audio is detecting specific frequencies or tones. You might imagine building a device which uses a sequence of tones as a form of input. For example a door lock that only opens when you whistle the right tune. To demonstrate this, let's make the hardware built in this guide respond to specific sequence of tones.
First we need to understand what frequencies make up the sequence of tones to detect. The spectrogram tool from the previous page is the perfect tool for this analysis.
For example the image on the left is a spectrogram of me whistling up and down slowly. Read the graph starting from the bottom and going up so you see the slow rise and fall in frequencies as I whistle.
If I wanted to detect this sequence I just need to look for a series of strong intensities from the FFT output at the rising and falling frequencies of the whistle.
For example the image on the left is a spectrogram of me whistling up and down slowly. Read the graph starting from the bottom and going up so you see the slow rise and fall in frequencies as I whistle.
If I wanted to detect this sequence I just need to look for a series of strong intensities from the FFT output at the rising and falling frequencies of the whistle.
Taking things a step further, the image on the left represents a spectrogram of 5 notes being played from an instrument. Again, read the graph from the bottom up. Low frequencies are to the left and high frequencies are to the right.
From analyzing the spectrogram I can see the notes I want to detect are highest in intensity between these frequencies:
From analyzing the spectrogram I can see the notes I want to detect are highest in intensity between these frequencies:
- Note 1: 1,723 to 1,758 hz
- Note 2: 1,934 to 1,969 hz
- Note 3: 1,512 to 1,546 hz
- Note 4: 738 to 773 hz
- Note 5: 1,125 to 1,160 hz
Can you guess the tune being played from looking at the spectrogram above?
Here's a video below of the tone sequence detection with the answer. As you hear the tones played, look at the spectrogram to see how each note relates to output on the graph.
Here's a video below of the tone sequence detection with the answer. As you hear the tones played, look at the spectrogram to see how each note relates to output on the graph.
If you're curious the audio is being generated by Garage Band on an iPad, with the 'Fifties Sci Fi' lead keyboard playing A5 B5 G4 G3 D4.
Continue on to look at another application of the Fourier transform, attempting to detect cat purrs.
Continue on to look at another application of the Fourier transform, attempting to detect cat purrs.
Page last edited September 27, 2013
Text editor powered by tinymce.