I need to analyze some signals containing chords.

How big DFT spectrum is needed to identify each possible musical note in such a signal sampled at 44100 Hz? I can see that 8192 bins gives some frequencies close to some notes like C3 A4 etc., but how big should it be to contain the whole scale, let's say to C5 and with good precision, like for a very good tuner?

  • $\begingroup$ Woops, sorry. It came automatically, I wasn't paying attention. But, well, it was obvious what I meant. Wasn't it? And it's now corrected anyway. $\endgroup$
    – Dalen
    Apr 27 '16 at 1:22
  • $\begingroup$ A DFT alone shows spectrum, not pitch frequency. So there is no DFT length (without lots of other processing) that is good for precise musical pitch detection or estimation, especially for recorded polyphonic music at typical tempos. $\endgroup$
    – hotpaw2
    Apr 27 '16 at 1:57
  • $\begingroup$ hotpaw is essentially right. However, if you want to try something with DFT, the length is determined by the error which you want to allow. 44100Hz sampling rate mean frequency components up to 22050Hz. The DFT bins are spread evenly from -22050Hz to +22050Hz, so if you want a precision of, say, +/-0.5Hz, you need 44100 DFT bins. You can increase frequency precision infinitly, but you need to remember that even with DFT length of 44100 samples, you already need one full second of audio. So this strongly depends on the length of your signals and how fast the chord progressions are. $\endgroup$
    – Max
    Apr 27 '16 at 11:43
  • $\begingroup$ It's not music, just recorded chords. I may repeat the signal to have one second of it, it's not a problem. Which other processing should I use? $\endgroup$
    – Dalen
    Apr 27 '16 at 12:36

You can always improve the accuracy of frequency estimates by quadratically interpolating the peaks in the DFT. This page should explain how to do this: https://ccrma.stanford.edu/~jos/parshl/Peak_Detection_Steps_3.html

You still end up with the issue of converting peaks in the spectrum to pitch, i.e. which peaks correspond to the fundamentals. The fundamental may not even be present as well!

  • $\begingroup$ Recognizing which one is which is not so difficult. There is a function that tells you what freq which FFT slot corresponds to for a given FFT N and the signal period, i.e. 1.0/sampling-rate if we want Hz. Yeah there are problems, but what is there better than FFT? A cosine transform gathers energy in lower bins, and if it can be made to suit such needs, it is inpractical for visual representation. $\endgroup$
    – Dalen
    Apr 27 '16 at 16:53
  • $\begingroup$ I must admit that I am a bit confused by the text on site you gave the link to. For instance, I am no longer sure whether zero padding is a good idea for what I am planning to do or will mess things up. The text mixes terms from time and frequency domain in such a way that I became lost about where am I supposed to do what. My personal experience, for instance, showed me that parabolic interpolation on any FFT spectrum doesn't yield better results in peak detecting. But when used in time domain it's pretty effective. $\endgroup$
    – Dalen
    Apr 27 '16 at 22:04

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.