Unable to get correct frequency value on iphone

2019-04-17 22:22发布

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?

1条回答
甜甜的少女心
2楼-- · 2019-04-17 22:43

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
查看更多
登录 后发表回答