Every time you press a button on a telephone keypad, the network must figure out which digit you dialled — and it does so by listening for a pair of audio tones. The classic tool for spotting a specific frequency in a signal is the Fast Fourier Transform (FFT), but the FFT gives you all frequencies at once. If you only care about a handful of them, you are doing a lot of unnecessary work.
In 1958, Gerald Goertzel published a remarkably simple fix. His algorithm computes a single bin of the Discrete Fourier Transform (DFT) using nothing more than a two-step recurrence — essentially a tiny digital filter run once through the signal. It costs multiplications for one frequency, compared with for a full FFT over samples.
The crossover is surprisingly useful: whenever you need fewer than roughly frequencies out of a block of samples, Goertzel wins. That threshold covers DTMF decoding (8 target tones from 8 ms blocks), pitch detection in voice codecs, and dozens of other embedded tasks where CPU cycles are precious.
The algorithm's elegance comes from rewriting the DFT evaluation as a second-order IIR recurrence whose only free parameter is a single cosine value precomputed from the target frequency. No complex exponentials at runtime, no lookup tables, no FFT butterfly network — just two additions and one multiplication per sample.
Comments
Loading comments...