Before this:Convolution & impulse response
Filter design basics
Key takeaways Before you build a filter you specify it: the passband (frequencies to keep), the stopband (frequencies to reject), the transition band between them, the ripple allowed in the passband, and the stopband attenuation in dB. Tightening any of those raises the filter’s order (its length and cost). Design is choosing a sensible point in that tradeoff — the spec you hand to a tool that computes the taps.
The last lesson showed that a filter is its impulse response. This one is about deciding what response you want before you compute the taps for an FIR or IIR filter. It is the vocabulary of the filter specification.
The anatomy of a filter response
Every frequency-selective filter has the same regions. Picture a low-pass response — keep the lows, reject the highs:
The five numbers you hand a designer
| Term | What it sets |
|---|---|
| Passband edge | the highest frequency kept at (near) full gain |
| Stopband edge | the lowest frequency that must be fully rejected |
| Transition width | the gap between those two edges — narrower is harder |
| Passband ripple | how much the gain may wobble in the passband (dB) |
| Stopband attenuation | how far down rejected frequencies must sit (dB) |
Hand those to a design method — a windowed-sinc, Parks–McClellan, or an IIR prototype — and it returns the coefficients. You rarely choose taps by hand; you choose the spec.
The tradeoff you can’t escape
These numbers pull against each other, and the currency they all spend is filter order — the number of taps (FIR) or poles (IIR), which is compute cost and delay:
- A narrower transition costs more order.
- A deeper stopband costs more order.
- Less ripple costs more order.
You cannot have a razor-sharp cutoff, a 90 dB stopband, and a tiny cheap filter all at once. Good design is picking the loosest spec that still does the job. For a scanner channel filter, “flat across the channel, 60 dB down at the neighbour’s edge, a modest transition” is plenty — over-specifying just burns CPU that real-time processing can’t spare.
FIR or IIR for this spec?
The spec also steers the type. Need linear phase so a digital signal’s shape survives? That points to FIR. Need a steep cutoff with the fewest operations and can tolerate nonlinear phase? An IIR does it with far fewer coefficients. The specification comes first; the choice of structure follows from it.
Quick check: making the transition band narrower requires…
Recap
- A filter is specified by passband, stopband, transition width, ripple, and attenuation.
- Those numbers are what you hand a design tool; it computes the taps.
- Every tightening — sharper transition, deeper stopband, less ripple — raises the order (cost).
- The spec also guides FIR vs IIR: linear phase points to FIR, minimal cost to IIR.
Next up: the FIR filter — the linear-phase workhorse that carves one channel out of a capture.
Frequently asked questions
What is a filter specification?
A filter specification is the shape you want a filter’s frequency response to have, written as a handful of numbers: where the passband ends, where the stopband begins, how flat the passband must be (ripple), and how deeply the stopband must attenuate. A design tool turns that spec into actual filter coefficients.
Why can't a filter just cut sharply at one frequency?
A perfectly sharp cutoff would require an infinitely long filter, which is impossible to build and adds infinite delay. Every real filter needs a transition band of finite width between passband and stopband. Making that transition narrower, or the stopband deeper, always costs more taps, more computation, and more delay — that is the fundamental tradeoff.