Answer the question
In order to leave comments, you need to log in
How to find the dominant frequency of an audio signal?
I received a set of signal samples from a microphone. Now we need to find the frequency of the sound. How to do it? I understand that with the help of Fourier. How exactly?
Roughly speaking, I want to press a piano key and have the phone say the frequency of this note. Or play a note on the guitar, etc.
Answer the question
In order to leave comments, you need to log in
In music, the lowest frequency (left) peak on the spectrogram is taken as the main tone (height) of the sound.
In short, make Fourier, discard the right half of the values, find the complex modulus of the remaining values, go over it from left to right - the first maximum found is your note in hertz.
Here is a Python library that has everything you need: sms-tools
In addition to choosing the lowest peak, you need to make sure that this peak corresponds to a stable signal and not local low-frequency noise. If you are singing and someone stamps their foot, or even if you say the consonant "p" close to the microphone, then the lowest frequency on the FFT will not correspond to what you need to know. These are fundamental points in solving this problem, but still it’s not worth reinventing the wheel, it’s enough just to understand how it works.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question