Friday, January 11, 2019

fft - Pitch detection of two following music notes (C0 and C0#)


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



Answer



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.


No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...