2 ms·
The Goertzel algorithm is O(N) for a single frequency component, which beats the FFT’s O(N log N), where N is the length of the data. The FFT gives you the whol
by mattkrause 8y ago
The Goertzel algorithm is O(N) for a single frequency component, which beats the FFT’s O(N log N), where N is the length of the data. The FFT gives you the whole spectrum though, whereas Goertzel “costs” O(N) each time. This might matter if the peak is not exactly where you imagine (e.g. 7.8 instead of 8). Furthermore, there’s a been a ton of work put into optimizing FFTs for a wide range of platforms, special cases, etc, so the FFT might actually run faster.
Further reading: http://www.fftw.org/pruned.html http://www.fftw.org/pruned.html