Reading
Stories Mode

FIR vs. IIR — Trade-offs

~13 min read Lesson 4 of Module 8

Two Families, One Goal

Every digital filter design ultimately leads to a choice: FIR (Finite Impulse Response) or IIR (Infinite Impulse Response). Both can implement lowpass, highpass, bandpass, and bandstop responses. Both are widely deployed in hardware and software. Yet they differ fundamentally in structure, computational efficiency, phase behavior, and stability guarantees.

Understanding these trade-offs is not just academic — it determines whether your filter runs in real time on a microcontroller, whether it distorts transients in audio processing, and whether it can be safely deployed in a feedback control loop. This lesson maps every major dimension of the comparison so you can make the right choice for any application.

Structure and Difference Equations

The two architectures differ at the level of their difference equations. An FIR filter computes its output as a weighted sum of the current and past inputs only:

FIR Difference Equation
y[n] = \sum_{k=0}^{M} b_k \, x[n-k]
b_k are the filter coefficients (taps). No past outputs y[n−k] appear — purely feedforward. The order M equals the number of taps minus one.

An IIR filter also feeds back past outputs, creating a recursive loop:

IIR Difference Equation
y[n] = \sum_{k=0}^{M} b_k \, x[n-k] - \sum_{k=1}^{N} a_k \, y[n-k]
The feedback terms a_k · y[n−k] give the IIR filter its poles. Even a small number of b and a coefficients can create a very sharp frequency response that would take hundreds of FIR taps to match.

Side-by-Side Comparison

FIR Filter
  • Unconditionally stable — no feedback
  • Can achieve perfect linear phase
  • Impulse response has finite length M+1
  • Requires many taps for sharp roll-off
  • Computationally expensive (high-order)
  • No coefficient quantization instability
  • Easy to design with windowed-sinc or Parks-McClellan
IIR Filter
  • Can be unstable — poles must stay inside unit circle
  • Nonlinear phase (group delay varies with frequency)
  • Impulse response decays but never ends
  • Sharp transitions with very few coefficients
  • Computationally efficient (low-order)
  • Quantization can move poles outside unit circle
  • Designed via analog prototype + bilinear transform

Filter Order — The Efficiency Gap

The most striking practical difference is the number of coefficients required to meet the same frequency response specifications. Consider a lowpass filter with:

Filter Type Approximate Order Number of Multiplies/Sample Notes
FIR (Kaiser window) ≈ 60–80 taps 60–80 Linear phase guaranteed
FIR (Parks-McClellan) ≈ 40–60 taps 40–60 Optimal equiripple
IIR Butterworth ≈ 10th order 20–21 Maximally flat
IIR Chebyshev I ≈ 7th order 14–15 Equiripple passband
IIR Elliptic ≈ 5th order 10–11 Minimum order for specs

An elliptic IIR filter achieves the same response with roughly one-tenth the multiplications of an FIR implementation. On embedded processors without hardware multiply-accumulate units, this difference can determine whether real-time operation is feasible at all.

Phase Response and Group Delay

Linear phase is one of the most valued properties in signal processing: when all frequency components are delayed by the same amount, the shape of a signal is perfectly preserved through the filter. Only the time of arrival shifts — not the waveform itself.

FIR filters with symmetric coefficients (b_k = b_{M−k}) have exactly linear phase across all frequencies, for any filter order. The group delay is constant at M/2 samples. This makes FIR the default choice for:

IIR filters are recursive and cannot achieve exactly linear phase. Their group delay varies across the passband — sharpest near the band edges. For audio applications where phase distortion is audible, or for data processing where phase coherence matters, IIR filters require an additional zero-phase filtering pass (forward-backward filtering) that doubles the computational cost and introduces latency incompatible with real-time use.

Zero-Phase IIR Filtering

The filtfilt() function in MATLAB and SciPy runs the IIR filter forward, then backward through the result. This doubles the effective order (squaring the magnitude response) and zeroes out the phase entirely — but it cannot be done in real time since the entire signal must be available before processing begins.

Real-time linear phase → FIR only. Offline zero-phase → filtfilt()

Stability and Coefficient Quantization

FIR filters are unconditionally stable. Because there is no feedback, there are no poles — the transfer function only has zeros. Zeros can be anywhere in the z-plane without causing instability. Quantizing the coefficients of an FIR filter can change its frequency response slightly, but it cannot make it unstable.

IIR filters require careful attention to stability. The analog prototype design guarantees that poles start inside the unit circle, but two factors can move them outside:

The standard remedy is to implement IIR filters as cascaded second-order sections (biquads) rather than a single high-order filter. Each biquad handles two poles, and its coefficients are far less sensitive to quantization because the pole locations are controlled by fewer bits simultaneously.

Always Use Biquad Sections for IIR

A 10th-order IIR implemented as a single structure has 10 feedback coefficients, and quantization of any one of them shifts all 10 poles simultaneously. As five cascaded biquads, each coefficient only affects one pair of poles. Quantization sensitivity drops dramatically — and limit cycles are easier to control with dedicated biquad implementations.

High-order IIR: always cascade second-order sections (SOS)

Computational Complexity

Both filter types perform multiply-accumulate (MAC) operations, but at very different rates. For an N-th order filter processing one sample at a time:

Operation FIR (order N) IIR (order N)
Multiplications/sample N + 1 N + M + 1
Additions/sample N N + M
Memory (delay line) N samples N + M samples
Typical order for sharp LP 50–200 taps 4–10th order
Real-time suitability Depends on processor speed Excellent on most hardware

For very long FIR filters (hundreds of taps), the overlap-add or overlap-save methods compute the output using block FFTs in O(N log N) operations rather than O(N) per sample — which can make long FIRs competitive with IIR in throughput when blocks are processed together.

The Decision Flowchart

In practice, the choice between FIR and IIR reduces to a small set of decisive questions:

Choose FIR when…
  • Linear phase is required (audio, ECG, coherent comms)
  • The system cannot tolerate instability under any conditions
  • Fixed-point arithmetic is used and quantization stability is critical
  • The target hardware has DSP-accelerated MAC units (e.g., ARM CMSIS-DSP)
  • Block processing is acceptable (latency not critical)
  • The filter specification uses very wide transition bands
Choose IIR when…
  • Computational resources are scarce (embedded MCU, battery-powered)
  • Very sharp transitions are needed with minimal coefficients
  • Phase distortion is acceptable (e.g., speech intelligibility, not music fidelity)
  • The filter mimics an analog circuit (audio tone controls, crossovers)
  • Memory is limited and filter order must be kept low
  • Floating-point arithmetic is available (reduces quantization concerns)

When Neither Wins Clearly

Some applications sit in a gray zone. Audio crossover networks in loudspeaker systems traditionally use analog-derived IIR filters (Butterworth or Linkwitz-Riley) because the slope and phase relationships between drivers must be precise at the crossover frequency — but phase linearity matters for the overall system. Modern high-end DSP amplifiers often use linear-phase FIR crossovers despite the computational cost, precisely because they eliminate driver-related phase artifacts.

Anti-aliasing and reconstruction filters are another gray area. The pre-filter before an ADC must attenuate frequencies above f_s/2 sharply — an ideal job for a low-order elliptic IIR. But in audio DACs, oversampling shifts the image band so far from the audio band that a gentle FIR interpolation filter with linear phase becomes the preferred choice.

The bottom line: both filter families are indispensable. Knowing their trade-offs deeply — not just their surface properties — allows you to match the tool to the task with confidence.

Key Takeaways
  • FIR filters are feedforward-only, unconditionally stable, and can achieve perfect linear phase with symmetric coefficients.
  • IIR filters use feedback (poles), are recursively efficient, but require stability checks and are sensitive to coefficient quantization.
  • For a given frequency response specification, IIR filters typically need one-tenth or fewer the coefficients of an equivalent FIR design.
  • Linear phase requires FIR — IIR phase is inherently nonlinear, though offline zero-phase filtering (filtfilt) is an option for non-real-time use.
  • IIR filters on fixed-point hardware should always be implemented as cascaded biquad sections to control quantization sensitivity and limit cycles.
  • Choose FIR for phase-critical, safety-critical, or fixed-point applications; choose IIR for computationally constrained real-time systems with acceptable phase distortion.
  • Overlap-add/overlap-save methods can make long FIRs competitive with IIR in throughput by leveraging FFT-based block convolution.
Previous Bilinear Transform Module Overview Next Module Power Spectral Density