DSP 101
M8 · Lab
Hands-on lab
Compare an FIR to an IIR

Design a low-pass FIR and a low-pass IIR to the same cutoff in the sandbox, and predict — before you read it off the screen — how many taps the FIR needs, how much smaller the IIR's order is, and the constant group delay the FIR keeps that the IIR cannot.

The IIR difference equation (feedback)
y[n] = \sum_{k=0}^{M} b_k\, x[n-k] \;-\; \sum_{k=1}^{N} a_k\, y[n-k]

An FIR is a weighted sum of past inputs, so it is always stable and can have exactly linear phase — but a sharp response costs many taps. An IIR adds feedback, reusing past outputs, so it meets a similar response with far fewer coefficients — but its phase is no longer linear, and its poles must stay inside the unit circle or it blows up. Reading the tap count, the IIR order and the flat FIR group delay off one screen is how you see what each design costs and what it buys.

1 / 7
DSP 101
M8 · Lab
Set it up
One FIR, one IIR

Open the sandbox. It opens on exactly this state — a low-pass FIR beside a low-pass IIR at the same cutoff — so a Reset gets you here too. Each step names the one readout to look at; leave every knob alone.

Set these values
FIR: Response -> Low-pass Window -> Hamming Taps N -> 63 IIR: Family -> Butterworth Order -> 6 Cutoff -> 0.15 f_s f_s -> 48000 Hz

Watch the FIR taps (impulse-response readout), the IIR order readout, the group-delay panel (flat for the FIR, curved for the IIR) and the cost table — every number you predict is printed there.

2 / 7
DSP 101
M8 · Lab
Step 1 of 3
How many taps for the FIR?

Keep the defaults: Taps N = 63, a Hamming window. The impulse response of an FIR is exactly its coefficient list, so it has as many taps as the design length. Predict the tap count, then read the impulse-response readout.

Expected

The FIR has N = 63 taps — its impulse response is exactly those 63 coefficients, and every one of them is a multiply the filter must do per output sample.

3 / 7
DSP 101
M8 · Lab
Step 2 of 3
What order for the IIR?

Now look at the IIR panel: a Butterworth of order = 6 at the same low-pass cutoff. Feedback lets it meet a similar response with far fewer coefficients. Predict the IIR order, then read the order readout and the cost table.

Expected

The IIR is order 6 — 3 biquad sections, about 15 coefficients against the FIR's 63. Feedback buys a much smaller filter for a similar cutoff.

4 / 7
DSP 101
M8 · Lab
Step 3 of 3
The phase the FIR keeps flat

Back to the FIR. A symmetric (Type I) FIR delays every frequency by the same (N-1)/2 samples — that is linear phase. Predict the constant group delay, then read the group-delay panel — and notice the IIR's curve is not flat.

Expected

The FIR group-delay panel is a flat line at (N-1)/2 = (63-1)/2 = 31 samples — linear phase, so the waveform shape is preserved. The IIR's group delay varies with frequency (nonlinear phase), and its largest pole radius here is about 0.81, inside the unit circle so it is stable — but that must be checked, where the FIR is always stable.

5 / 7
DSP 101
M8 · Lab
Your turn
Open the sandbox

Everything above is waiting in the sandbox. Raise the FIR taps and watch its transition narrow, raise the IIR order and watch its poles crowd the unit circle, and read the cost table that sizes both families to one specification at once.

6 / 7
DSP 101
M8 · Lab
Wrap-up
What you did
  • Read the FIR tap count, N = 63, off its impulse response
  • Found the IIR order, 6 (3 biquads, about 15 coefficients) — far fewer than the FIR's 63
  • Read the FIR's constant group delay, (N-1)/2 = 31 samples — the linear-phase payoff the IIR cannot match
  • Every value you predicted is the demo's own FIR and IIR arithmetic, not a picture
7 / 7
1 / 8 muted