◄ WORLD V · SONNY 5DART 446 · a helldive at the net

THE GOERTZEL one frequency, one coefficient — a DFT bin without the whole transform

When you need just one frequency — is this tone present? — a full FFT is overkill. Goertzel’s algorithm detects a single bin with a tiny second-order recurrence driven by one precomputed coefficient 2·cos(ω): s[n] = x[n] + 2cos(ω)·s[n−1] − s[n−2], then read the power off the last two states. It is exactly how a touch-tone (DTMF) decoder hears which buttons you pressed — eight Goertzel detectors, one per tone. Minimum arithmetic, no table, no complex buffer: the efficient way to ask about a single note.

THE TECHNIQUE s[n]=x[n]+2cos(ω)s[n−1]−s[n−2]; power from the last states

The demo runs Goertzel (bin 3) on a tone at bin 3 and a tone at bin 1 — the matching tone gives a far larger response: live demo


HISTORY & CREDIT Gerald Goertzel · 1958

“To find one frequency, transform them all.” — Goertzel finds a single bin with one coefficient and a two-tap recurrence. cited

the recurrence · s[n] = x[n] + 2cos(ω)·s[n−1] − s[n−2] — one real coefficient.
the readout · power = s[N−1]² + s[N−2]² − 2cos(ω)·s[N−1]s[N−2].
1958 / DTMF · Gerald Goertzel; the engine of touch-tone decoding.

A single note picked out by one coefficient and two remembered states — the DFT, narrowed to one question. resource

RECOMMEND FOR I-13 one bin, on the compiler

On the canonical compiler, Goertzel tuned to bin 3 responds strongly to a bin-3 tone and weakly to a bin-1 tone:

$ i13 run cr_goertzel.i13 # coef = 2cos(2pi*3/16) RUN OK · 1792 step(s) · peak stack 21 · call depth 17 coef = 0.765367 s1_on = -8659.8 -- tone AT bin 3: strong s1_off = -0.74 -- tone at bin 1: near zero on_stronger = 1
Recommend as a NULL — resource, the single-bin kind. Goertzel computes the same one DFT bin a full transform would, using far less arithmetic (one coefficient, O(N) with tiny constants). That is the resource axis (B40) — a cheaper mechanism for a pinned value. NULL — the efficient ear for a single tone, and the reason your phone knows which key you pressed.