DSP·GUIDEOUT LOUD
Book episodes

Episode 14 · Digital Filters · Book chapters 19, 20, 21 · 33m27s

Recursive Filters, Chebyshev, and the Shootout

Sharp responses from a handful of coefficients, what stability costs, biquads, and every filter in the series head to head.

The original recording, including numerical examples and figure cues. Switching versions starts at the beginning.

0:0033:27

Choose a playback speed that feels comfortable. Open in Google Drive to download or play on a phone.

Save for offline listening:Detailed MP3Driving MP3
Figures

Generating the response instead of storing it

A recursive filter feeds previous outputs back in, so its impulse response can continue forever from two or three coefficients. An FIR filter stores its impulse response explicitly; an IIR filter generates it from a rule. Generating is enormously more compact when the response has a shape the rule can express, and impossible when it does not.

Two cheap smoothers, two different step responses

Figure
1.0amber = single pole
Cyan is a moving average: a clean linear ramp that reaches the final value exactly and stops, symmetric about its midpoint — which means linear phase and no overshoot. Amber is a single-pole recursive filter: it jumps a tenth of the way immediately, then approaches the target asymptotically and never quite arrives. The single pole responds faster at first and settles far slower. That asymmetry is the whole difference between them, and it is why the moving average wins whenever edges carry the meaning.

Chebyshev, and what stability costs

A Chebyshev filter deliberately allows passband ripple in exchange for a much sharper transition at the same pole count — spreading the error evenly across the band approximates better than insisting on perfection in the middle. Set the ripple to zero and it becomes a Butterworth.

The hazard has no FIR equivalent: if a pole lands outside the unit circle, the output grows without limit. Rounding the coefficients moves the poles, so a filter that is stable on paper can be unstable in practice — especially a sharp one whose poles cluster near the boundary. Above about six to eight poles, always implement as cascaded second-order biquads.

Recursive filters also cannot have linear phase, because their impulse responses cannot be symmetric. But filtering forward, then backward through the reversed signal, cancels the phase distortion exactly — zero phase and zero delay. That is filtfilt, and it is the standard approach for recorded data. It is impossible in real time, since the backward pass starts at the end.

The shootout

Windowed-sinc vs Chebyshev: the windowed-sinc gives linear phase, deeper stopbands, and guaranteed stability. The Chebyshev gives comparable sharpness for a fraction of the computation and latency. Need linear phase? Windowed-sinc, no argument. Need speed or low latency? Chebyshev. Working offline and want both? Bidirectional Chebyshev — underused.

Analog versus digital, measured the way the book measures it

Figure
passband detailstep responseanalogdigital
A six-pole Chebyshev analog filter against a 129-point windowed-sinc, both 1 kHz low pass. Left, the passband: the analog filter ripples by about 6% while the digital one is flat to within 0.02% — a factor of three hundred. Right, the step response: the analog filter overshoots roughly 20% and is visibly asymmetric, while the digital filter overshoots about 10% symmetrically on both sides. That symmetry is linear phase, and no causal analog filter can produce it. This is the concrete version of the claim from episode one — digital wins on exactness and on responses that are physically unbuildable, while analog keeps speed, cost, power, and the very high frequencies.

Moving average vs single pole: the moving average is provably optimal for noise versus edge sharpness and has a symmetric step response. The single pole is cheaper and needs almost no memory, but responds instantly and settles slowly.

And the organising question never changes. Ask where the information lives, ask whether linear phase is required, and the filter chooses itself.

Key points

  1. A recursive filter computes each output from recent inputs and recent outputs. The feedback means the impulse response can continue forever, which is why they are called infinite impulse response filters.
  2. The efficiency comes from generating the impulse response with a rule rather than storing it explicitly. That is enormously more compact when the response has a shape the rule can express, and impossible when it does not.
  3. The single pole low pass filter is two multiplications and an addition per sample, and its impulse response is a decaying exponential — exactly the response of an analog resistor and capacitor. That correspondence is why recursive filters are designed by transforming known analog designs into the digital domain.
  4. Two pole designs give narrow band and notch filters. A two pole notch removes mains hum for a handful of operations per sample, where a comparable FIR filter would need hundreds.
  5. The Chebyshev filter deliberately allows passband ripple, commonly zero point five percent, in exchange for a much sharper transition at the same pole count. Spreading the error evenly across the band approximates better than insisting on perfection in the middle.
  6. Setting the ripple to zero turns a Chebyshev into a Butterworth — maximally flat, gentler roll-off. The ripple parameter slides continuously between flatness and sharpness.
  7. Sharper Chebyshev filters and larger ripple mean more step response overshoot and ringing, which makes them a poor choice for time domain signals.
  8. Recursive filters can be unstable. If a pole lands outside the unit circle the output grows without limit. Rounding the coefficients moves the poles, so a filter that is stable on paper can be unstable in practice — especially a sharp one with poles clustered near the boundary.
  9. Above about six to eight poles, always implement as a cascade of second order biquad sections. Mathematically identical, numerically far more robust.
  10. The single pole constant relates to a time constant: a ten sample time constant needs a constant near zero point nine, a hundred samples near zero point nine nine. Very long time constants push it so close to one that computing one minus it loses precision.
  11. Its step response rises fast at first then approaches the final value asymptotically, never quite arriving — unlike the moving average's clean ramp that finishes exactly after M samples. That asymmetry is the essential difference between them.
  12. A biquad is a second order section: five coefficients, two previous inputs, two previous outputs. Direct form one uses more memory but resists overflow; direct form two uses less but its internal value can exceed both input and output; transposed direct form two is generally best behaved and is the usual default.
  13. When cascading biquads, put the most resonant sections — poles closest to the unit circle — last, so earlier sections attenuate the signal first. Wrong ordering can overflow a filter that is stable on paper.
  14. Get coefficients from a design library, not by hand, and ask for second order sections rather than one long polynomial. Watch the cutoff convention — fraction of sampling rate versus fraction of Nyquist differ by two, and this is the most common filter design error.
  15. Check every design three ways: plot the frequency response to confirm the cutoff, plot the step response to check overshoot, and run silence after a loud passage to confirm it decays rather than sitting on a limit cycle.
  16. Recursive filters cannot have linear phase, because their impulse responses cannot be symmetric.
  17. Filtering forward, then backward through the reversed signal, cancels the phase distortion exactly and gives zero phase and zero delay. That is filtfilt, and it is the standard approach for recorded data. It is impossible in real time because the backward pass starts at the end.
  18. Recursive filters are far more sensitive to finite precision than FIR filters, because errors circulate in the feedback rather than passing through once. Limit cycles can leave a small oscillation running forever with zero input, audible as a tone during silence.
  19. Analog filters win on speed, cost, power, and very high frequencies, and are mandatory for antialiasing. Digital filters win on exactness, repeatability, unbuildable responses, linear phase, and reconfigurability.
  20. Windowed-sinc versus Chebyshev: the windowed-sinc gives linear phase, deeper stopbands, and guaranteed stability; the Chebyshev gives comparable sharpness for a fraction of the computation and latency. Use bidirectional Chebyshev offline to get most of both.
  21. Moving average versus single pole: the moving average is provably optimal for noise versus edge sharpness and has a symmetric step response. The single pole is cheaper and needs almost no memory, but its step response is asymmetric — instant response, slow settling.
  22. The organizing question never changes. Ask where the information lives, ask whether linear phase is required, and the filter chooses itself.