Comparison

FIR vs IIR Digital Filter

A digital hearing aid uses an FIR filter on an ARM Cortex-M4 to equalise audio — 120 taps, strictly linear phase, every sample processed in 75 µs. The same hearing aid uses a pair of IIR biquad sections to implement a 60 Hz notch for hum rejection — 4 coefficients do what would take a 400-tap FIR. Choosing between them is always this trade-off: linear phase and stability guarantees versus order efficiency and computational economy.

ECE, EI

Side-by-side comparison

ParameterFIRIIR Digital Filter
FeedbackNo feedback — FIR output depends only on current and past inputsHas feedback — output depends on past outputs (poles)
Phase ResponseExactly linear phase achievable with symmetric coefficientsNonlinear phase; delay varies with frequency
StabilityAlways stable — no poles inside unit circle possibleConditional — poles must be inside unit circle; coefficient quantisation can destabilise
Filter Order for Same Transition BandHigh — typically 10–100× the equivalent IIR orderLow — elliptic IIR of order 5 ≈ FIR of order 100 for same spec
Design MethodsWindowing (Hamming, Kaiser), frequency sampling, Parks-McClellanButterworth, Chebyshev I/II, Elliptic, Bessel (s-to-z via bilinear transform)
Computational LoadN multiply-accumulates (MACs) per sample2 MACs per biquad section (much fewer for same selectivity)
Coefficient Quantisation EffectNo stability risk; smooth degradationFixed-point quantisation can move poles outside unit circle; cascade of biquads safer
Group DelayConstant = (N−1)/2 samples for linear-phase FIRFrequency-dependent; can distort transient signals
ImplementationARM CMSIS-DSP: arm_fir_f32() — block FIRARM CMSIS-DSP: arm_biquad_cascade_df2T_f32() — cascade IIR
Typical ApplicationAudio EQ, ECG baseline wander removal, image reconstruction filtersAnti-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.

More Digital Signal Processing comparisons