问题
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:
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
来源:https://stackoverflow.com/questions/9477535/unable-to-get-correct-frequency-value-on-iphone