Case-Study Case-Study, RF, DSP, Signal Processing
Electrochemical impedance spectroscopy measures a cell at a dozen or so discrete frequencies. A resonant sensor is interrogated at its resonance and at two points on the skirt. A multi-tone stimulus for a bioimpedance measurement carries perhaps eight tones. A pilot-tone monitor watches four.
In none of these cases does anybody want a spectrum. They want the amplitude at frequencies they chose in advance, and the rest of the spectrum is not merely uninteresting, it is a cost.
An FFT gives you all of it. For a 1024-point transform that is 513 numbers, of which you read eight, and you paid for the memory, the twiddle ROM and the butterfly multipliers of all 513.
What the Goertzel does instead
The Goertzel algorithm computes one DFT bin using a second-order IIR resonator. It costs one real multiply per input sample, one bin, no memory, no twiddle table. If you want the power at one frequency, this is the cheapest thing that exists.
The obvious way to get K frequencies is K resonators, and for small K that is entirely reasonable. But the Goertzel Multi block does something better: it runs one time-shared multiplier and updates one bin per system clock, cycling through the monitored frequencies. As long as your input sample rate is below the system clock divided by K, which for a monitoring application it invariably is, this costs exactly the same as one tone.
The comparison is not subtle. Sixteen separate resonators cost sixteen multipliers. Sixteen tones through the Multi block cost one. The FFT costs the same whether you look at eight bins or all of them.
Three blocks, three shapes of answer
The plugin has three Goertzel variants, and they are not interchangeable.
Goertzel (single tone) computes the power of one bin over a block of N samples and emits one number per block. This is the right choice when the measurement is naturally blocked, for example one impedance point per excitation burst.
Goertzel Multi (tone bank) is the same block arithmetic for K frequencies on the shared multiplier, one power output per tone. This is the multi-frequency workhorse.
Goertzel Sliding (per-sample) maintains the bin over a sliding window and emits a value on every input sample, not once per block. There is no block latency, so this is what you use when the amplitude at that frequency is a signal in its own right that you need to track continuously, such as following a resonance as it moves.
Choosing the frequencies
One property of the Goertzel deserves stating plainly, because it is the thing that catches people. The resonator is tuned to a bin of an N-point DFT, and it is exact only for frequencies that fall on a bin centre, that is, integer multiples of fs/N. A tone that lands between two bins is attenuated and leaks into its neighbours, exactly as it would in an FFT.
In practice this is a constraint on N rather than a problem: you choose N so that the frequencies you care about land on bin centres. Since in these applications you also control the stimulus, the usual approach is to choose the stimulus frequencies from the bin grid in the first place, which makes the whole question disappear.
Where this lands
The Goertzel blocks are the answer to a question that sounds like it should be an FFT question but is not. Whenever the list of interesting frequencies is short and known in advance, the tone bank gives you the same numbers for a fraction of the hardware, leaves the DSP slices free for whatever else the design has to do, and removes an entire class of buffering and framing from the design.
This is a reference design. The block behaviour is as documented; the resource comparison is computed from the stated cost model, not measured on a synthesised design.