0

I'm trying to analyze frequency detection algorithms on iOS platform. So I found several implementations using FFT and CoreAudio (example 1 and example 2). But in both cases there is some imprecision in frequency exists:

  • (1) For A4 (440Hz) shows 441.430664 Hz.
  • (1) For C6 (1046.5 Hz) shows 1518.09082 Hz.
  • (2) For A4 (440Hz) shows 440.72 Hz.
  • (2) For C6 (1046.5 Hz) shows 1042.396606 Hz.

Why this happens and how to avoid this problem and detect frequency in more accurate way?

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
Dmitry Klimkin
  • 445
  • 3
  • 15
  • What's your input's signal-to-noise ratio? And what is your frequency accuracy target? The 440 results are already precise to within 1%. – hotpaw2 Feb 28 '12 at 22:48

1 Answers1

4

Resolution in the frequency domain is inversely related to number of FFT bins. You need to either:

  • increase the size of your FFT to get finer resolution
  • use magnitude of adjacent bins to tweak the frequency estimate
  • use an alternative method for frequency estimation rather than FFT e.g. parametric model
Paul R
  • 208,748
  • 37
  • 389
  • 560
  • I tried to use SampleRate = 22050 and FTT size 4098... But this didn't help. – Dmitry Klimkin Feb 28 '12 at 07:14
  • 2
    For Fs = 22 kHz and FFT size, N = 4096, your resolution will be around 5 Hz. If you need finer resolution than this then N will need to be increased. – Paul R Feb 28 '12 at 10:36