Get Frequency for Audio Input on iPhone

2019-06-10 02:12发布

问题:

How can I get the frequency for an audio input on iPhone? Is it necessary to use a FFT if I'm only interested in finding a specific frequency (i.e. within a timeframe of x milliseconds, check if there is a peak at y Hz)?

回答1:

If you're just interested in a specific, fixed frequency (i.e. a pure tone) then you can use the Goertzel algorithm which is very simple to implement and relatively lightweight (computationally) compared to an FFT.