Side-by-side comparison
| Parameter | FIR | IIR Digital Filter |
|---|---|---|
| Feedback | No feedback — FIR output depends only on current and past inputs | Has feedback — output depends on past outputs (poles) |
| Phase Response | Exactly linear phase achievable with symmetric coefficients | Nonlinear phase; delay varies with frequency |
| Stability | Always stable — no poles inside unit circle possible | Conditional — poles must be inside unit circle; coefficient quantisation can destabilise |
| Filter Order for Same Transition Band | High — typically 10–100× the equivalent IIR order | Low — elliptic IIR of order 5 ≈ FIR of order 100 for same spec |
| Design Methods | Windowing (Hamming, Kaiser), frequency sampling, Parks-McClellan | Butterworth, Chebyshev I/II, Elliptic, Bessel (s-to-z via bilinear transform) |
| Computational Load | N multiply-accumulates (MACs) per sample | 2 MACs per biquad section (much fewer for same selectivity) |
| Coefficient Quantisation Effect | No stability risk; smooth degradation | Fixed-point quantisation can move poles outside unit circle; cascade of biquads safer |
| Group Delay | Constant = (N−1)/2 samples for linear-phase FIR | Frequency-dependent; can distort transient signals |
| Implementation | ARM CMSIS-DSP: arm_fir_f32() — block FIR | ARM CMSIS-DSP: arm_biquad_cascade_df2T_f32() — cascade IIR |
| Typical Application | Audio EQ, ECG baseline wander removal, image reconstruction filters | Anti-aliasing, tone detection (Goertzel), low-power sensor filtering |
Key differences
An FIR filter with symmetric coefficients satisfies h(n) = h(N-1-n), guaranteeing exactly linear phase — every frequency component is delayed by the same (N-1)/2 samples, preserving waveform shape. This is mandatory for ECG and audio applications where pulse dispersion is clinically or perceptually significant. An IIR filter achieves the same stopband attenuation (say −60 dB) in 5th order (elliptic) versus 100th order FIR, requiring only 10 MACs per sample instead of 100 — decisive on a Cortex-M0 at 48 MHz running a sensor node on battery. IIR fixed-point implementations must use biquad cascade (second-order sections) rather than direct form II because coefficient quantisation in high-order direct form II pushes poles outside the unit circle, causing oscillation or divergence.
When to use FIR
Use an FIR filter when linear phase is mandatory, the system must be unconditionally stable under all coefficient conditions, or the filter must be guaranteed to never ring. Example: a 12-lead ECG acquisition system on an STM32H7 uses a 127-tap FIR (Kaiser window, β=6) implemented via ARM CMSIS-DSP arm_fir_f32() to remove 60 Hz mains interference with exactly zero phase distortion on the P and T waves.
When to use IIR Digital Filter
Use an IIR filter when computational efficiency is paramount and linear phase is not required — particularly for anti-aliasing, low-power sensor pre-filtering, or tone detection. Example: a MEMS accelerometer data path on a Nordic nRF52840 uses a 4th-order Butterworth IIR low-pass (fc = 50 Hz) implemented as two CMSIS-DSP biquad sections, consuming 8 MACs per sample versus 600 MACs for an equivalent-specification FIR.
Recommendation
For audio, ECG, and any application where group delay uniformity matters, choose FIR — linear phase is worth the computation. For anti-aliasing, audio pre-filtering, and any battery-constrained sensor node, choose IIR biquad cascade — the order advantage translates directly to longer battery life. On a Cortex-M4 at 168 MHz with FPU, an FIR up to 256 taps at 44.1 kHz is practical; above that, IIR is the only real-time option.
Exam tip: Examiners ask students to state the condition for linear phase in an FIR filter and derive the group delay — know that symmetric coefficients h(n)=h(N-1-n) give linear phase ∠H(e^jω) = −ω(N-1)/2 and constant group delay τ = (N-1)/2 samples.
Interview tip: A DSP or signal processing interviewer will ask why you implement a high-order IIR as biquad sections rather than one high-order direct form II — answer: coefficient quantisation in fixed-point arithmetic shifts poles in high-order direct form II to outside the unit circle, causing instability; cascaded biquads confine each pole pair to a low-order section where quantisation effects are negligible.