Expand description
The Goertzel algorithm for single DFT bins.
See the book entry Spectra at chosen frequencies: Goertzel, chirp-z and Fourier integrals.
Functions§
- goertzel
- The DFT of
xat one (possibly non-integer) bink,X(k) = Σ x_n e^{−2πi k n / N}, by the generalised Goertzel recursions_n = x_n + 2cos(ω) s_{n−1} − s_{n−2}(ω = 2πk/N) and a final phase correction. Costs one real multiply-add per sample, so it beats an FFT when only a few bins are needed (tone detection). - goertzel_
frequency - The DFT at frequency
f(Hz) ofxsampled atfs. - goertzel_
power |X(k)|²at binkwithout the final complex rotation:s_{N−1}² + s_{N−2}² − 2cos(ω) s_{N−1} s_{N−2}.