0
$\begingroup$

Hi signal processing community,

currently I am working on a pitch detection tool which should work on audio input files (or later also instrumental or voice from microphone) to say which music note is playing at the moment.

At the moment I am getting samples in a window of 1024. Then I do FFT-Hamming on this array. Now it is easy to detect notes like C1, C3, C4, C5, since I search for the peaks in the resulting array. But I don`t know how to do it for following notes. (also for example C0, D0)

Is my window to small? Or am I doing something wrong?

I hope you can help me. Thank you.

Best wishes,

MusicMagician

$\endgroup$
  • $\begingroup$ i wouldn't do it that frequency-domain way in the first place. $\endgroup$ – robert bristow-johnson Apr 15 '18 at 21:02
1
$\begingroup$

There are many ways to do pitch detection (seee e.g. https://ccrma.stanford.edu/~pdelac/154/m154paper.htm ) and which one is the most suitable depends on your application requirements and constraints. FFT isn't great if you need a lot of accuracy of accuracy (in tune, out of tune?) or good resolution at low frequencies.

You also need to be aware that for many instruments, the harmonic have higher energy than the fundamental, so the peak in the FFT isn't always the pitch.

$\endgroup$
0
$\begingroup$

Your window is too small for low notes (assuming a typical constant sample rate); and you are doing something wrong. Naive note frequency estimation work better if at least 12 to 36 periods of the pitch fit inside the FFT window. But FFT peak spectral frequency is not the same as musical pitch (a psychoacoustic phenomena), especially for male voices and large stringed instruments. Instead, research pitch detection/estimation methods.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.