Fiveable

🔌Intro to Electrical Engineering Unit 21 Review

QR code for Intro to Electrical Engineering practice questions

21.3 Digital filters: FIR and IIR

21.3 Digital filters: FIR and IIR

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
🔌Intro to Electrical Engineering
Unit & Topic Study Guides

FIR and IIR Filters

Finite Impulse Response (FIR) Filters

An FIR filter produces an output based only on current and past input values. There's no feedback loop, so the impulse response always dies out after a finite number of samples. This non-recursive structure is what gives FIR filters their key advantages.

  • Inherently stable because there are no feedback paths that could cause the output to blow up
  • Can achieve linear phase response, meaning all frequency components are delayed by the same amount (critical in audio processing and communications)
  • Implemented with feed-forward taps only: delay elements, multipliers, and a summing junction
  • The trade-off: FIR filters typically require more coefficients than IIR filters to achieve a comparable frequency response sharpness

The general FIR difference equation looks like:

y[n]=b0x[n]+b1x[n1]+b2x[n2]++bMx[nM]y[n] = b_0 x[n] + b_1 x[n-1] + b_2 x[n-2] + \cdots + b_M x[n-M]

where the bkb_k coefficients are the impulse response samples, and MM is the filter order.

Infinite Impulse Response (IIR) Filters

An IIR filter uses both feed-forward and feedback paths. Because the output is fed back into the computation, the impulse response theoretically extends forever, though in practice it decays toward zero if the filter is stable.

  • More efficient: achieves steep frequency rolloff with fewer coefficients than an equivalent FIR filter
  • Can be unstable if the feedback coefficients are poorly chosen. Stability requires that all poles of the transfer function lie inside the unit circle in the Z-plane.
  • Cannot achieve linear phase, which means different frequencies experience different delays. This can cause phase distortion.
  • Commonly designed by transforming well-known analog filter prototypes (Butterworth, Chebyshev, Elliptic) into discrete-time equivalents

The general IIR difference equation is:

y[n]=b0x[n]+b1x[n1]++bMx[nM]a1y[n1]a2y[n2]aNy[nN]y[n] = b_0 x[n] + b_1 x[n-1] + \cdots + b_M x[n-M] - a_1 y[n-1] - a_2 y[n-2] - \cdots - a_N y[n-N]

The aka_k terms are the feedback coefficients, and their presence is what makes the impulse response infinite.

FIR vs. IIR at a glance: FIR gives you guaranteed stability and linear phase but costs more computation. IIR gives you sharper filtering with fewer coefficients but requires careful design to stay stable and introduces nonlinear phase.

Filter Coefficients and Windowing

Filter coefficients directly determine a filter's frequency response. For FIR filters, the coefficients are simply the impulse response values. For IIR filters, you have two sets: the feed-forward coefficients (bkb_k) and the feedback coefficients (aka_k).

Windowing is a common FIR design method. The idea is straightforward:

  1. Start with the ideal (infinite-length) impulse response for the desired frequency response.
  2. Truncate it to a finite length. This truncation causes unwanted ripples in the frequency response (called Gibbs oscillations).
  3. Multiply the truncated impulse response by a window function to smooth out those ripples.

Different windows offer different trade-offs:

  • Rectangular window: sharpest main lobe (best frequency resolution) but the worst side lobes (most ripple)
  • Hamming / Hanning windows: wider main lobe but much lower side lobes, reducing ripple significantly
  • Blackman window: even lower side lobes at the cost of an even wider main lobe

Choosing a window is about balancing transition width against ripple suppression.

Finite Impulse Response (FIR) Filters, 2.2 Finite impulse response (FIR) filter design methods | Digital Filter Design

Filter Characteristics

Frequency Response

The frequency response tells you how a filter treats each frequency component in the input signal. It has two parts: magnitude response (how much gain or attenuation at each frequency) and phase response (how much phase shift at each frequency).

For an ideal filter, the passband would be perfectly flat, the stopband would have complete attenuation, and the transition between them would be infinitely sharp. Real filters can't achieve this, so you work with practical specifications:

  • Cut-off frequency (ωc\omega_c): the boundary between the passband and the transition band, usually defined at the 3-3 dB point
  • Passband ripple: how much the gain fluctuates within the passband
  • Stopband attenuation: how much the signal is suppressed in the stopband
  • Transition width: how gradually the filter rolls off from passband to stopband

These four parameters are the main knobs you turn during filter design. Tightening one often loosens another, or requires a higher filter order.

Phase Response

Phase response describes the phase shift a filter introduces at each frequency. If the phase shift is a linear function of frequency, every frequency component gets delayed by the same amount. This is linear phase, and it preserves the shape of the signal.

  • FIR filters can be designed with perfectly linear phase by making their coefficients symmetric.
  • IIR filters inherently have nonlinear phase due to their feedback structure.

Group delay is the negative derivative of phase with respect to frequency:

τ(ω)=dϕ(ω)dω\tau(\omega) = -\frac{d\phi(\omega)}{d\omega}

A constant group delay across all frequencies means linear phase and no signal distortion. When group delay varies with frequency, different frequency components arrive at different times, which distorts the signal's shape.

Finite Impulse Response (FIR) Filters, Finite impulse response filter | TikZ example

Filter Design Techniques

Butterworth, Chebyshev, and Elliptic are all analog filter prototypes commonly used to design IIR digital filters. You design the analog version first, then convert it to a discrete-time filter using techniques like the bilinear transform.

Butterworth Filters

Butterworth filters are designed for a maximally flat magnitude response in the passband. There's no ripple at all in the passband, and the rolloff into the stopband is smooth and monotonic.

  • The steepness of the rolloff depends on the filter order NN. Higher order means a sharper transition, but also more computation and more delay.
  • A first-order Butterworth rolls off at 2020 dB/decade; a second-order at 4040 dB/decade, and so on.
  • Butterworth filters are a good default choice when you need a clean passband and don't need the absolute sharpest cutoff.

Chebyshev Filters

Chebyshev filters achieve a steeper rolloff than Butterworth filters of the same order by allowing some ripple.

  • Type I: equiripple in the passband, monotonically decreasing in the stopband. You specify how much passband ripple you can tolerate (e.g., 0.5 dB), and the filter uses that budget to sharpen the transition.
  • Type II (inverse Chebyshev): flat in the passband, equiripple in the stopband. Less commonly used but useful when passband flatness is critical.

For the same filter order, a Chebyshev filter will always have a sharper transition than a Butterworth. The cost is that ripple in the passband (or stopband) can be unacceptable for some applications.

Elliptic Filters

Elliptic filters (also called Cauer filters) push efficiency to the extreme. They allow equiripple in both the passband and the stopband, which gives them the steepest possible rolloff for any given filter order.

  • For a fixed set of specs (passband ripple, stopband attenuation, transition width), an elliptic filter requires the lowest order of any standard filter type.
  • The trade-off is ripple everywhere and a more complex design process.
  • The transfer function contains both poles and zeros, making implementation and analysis more involved than Butterworth or Chebyshev designs.

Comparing the three: Butterworth is the smoothest but needs the highest order. Chebyshev trades ripple in one band for a sharper cutoff. Elliptic trades ripple in both bands for the sharpest cutoff at the lowest order. Pick based on which imperfections your application can tolerate.