FIR and IIR are the two families of digital filters. An FIR (finite impulse response) filter’s output depends only on current and past inputs, no feedback, so its impulse response ends after a fixed number of samples, it is always stable, and it can have exactly linear phase. An IIR (infinite impulse response) filter feeds past outputs back in, so its impulse response never truly ends: it reaches a sharp frequency response with far fewer coefficients, but it can be unstable and its phase is not linear. Same job, opposite trade-offs.
The one-sentence difference
Everything follows from a single structural fact:
- FIR: y[n] = b₀x[n] + b₁x[n−1] + … + bMx[n−M], a weighted sum of inputs. This is convolution with the coefficient list, nothing more.
- IIR: y[n] = (weighted sum of inputs) − a₁y[n−1] − a₂y[n−2] − …, past outputs appear on the right-hand side. That feedback loop is the entire difference, and every row of the comparison table below is a consequence of it.
Because an FIR filter has no feedback, an impulse fed into it produces exactly M+1 non-zero outputs and then silence, a finite impulse response (the coefficients themselves, as our impulse response lesson shows). An IIR filter’s output keeps recirculating: the impulse response decays (if the filter is stable) but never reaches exactly zero, infinite.

FIR vs IIR, side by side
| Property | FIR | IIR |
|---|---|---|
| Feedback | None, inputs only | Yes, past outputs feed back |
| Impulse response | Finite: ends after M+1 samples | Infinite: decays, never exactly zero |
| Stability | Always stable (no poles except at z = 0) | Can be unstable, poles must stay inside the unit circle |
| Phase | Can be exactly linear phase (symmetric coefficients) | Never exactly linear; phase distortion varies with frequency |
| Coefficients for a sharp cutoff | Many (tens to hundreds) | Few (a handful to a dozen) |
| Design heritage | Window methods, Parks–McClellan (equiripple) | Analog prototypes: Butterworth, Chebyshev, elliptic |
| Typical uses | Audio EQ and crossovers, data converters, anywhere phase matters | Control loops, cheap embedded filtering, sharp channel selection on a budget |
The stability row is the z-transform lesson paying rent: an FIR filter’s poles all sit at the origin, safely inside the unit circle, so stability is free. An IIR filter’s poles are placed by the design, inside the circle if the designer did the job right, and a fixed-point implementation can nudge them, which is why IIR designs get a stability check and FIR designs do not.
Head-to-head: the same specification, both designs
Words are cheap, here are two real filters designed in SciPy for one identical job: sample rate 1 kHz, pass 0–80 Hz within 1 dB, and reject everything from 150 Hz up by at least 40 dB.
- IIR (Butterworth): order 8, 8 poles, designed by
scipy.signal.buttord+butter. Meets the spec with a passband worst case of −1.00 dB and stopband −41.8 dB. - FIR (windowed sinc): 44 taps, the smallest length that meets the same spec (passband worst case −0.10 dB, stopband −40.8 dB), designed with
scipy.signal.firwin.

That ratio, roughly five times as many coefficients, is typical, and it is the IIR’s whole sales pitch. The FIR’s counter-pitch is in the impulse-response figure above and in one number: its 44 symmetric coefficients give it a constant group delay of 21.5 samples at every frequency, so a waveform passing through it is delayed but never reshaped. The Butterworth’s delay varies with frequency, which smears transients, audible in audio, visible in sensor edges.
FIR and IIR in Python (tested code)
This is the exact code that produced the designs and numbers above:
import numpy as np
from scipy import signal
fs = 1000.0 # sample rate, Hz
# IIR: let SciPy find the Butterworth order for the spec
order, wn = signal.buttord(80, 150, 1, 40, fs=fs)
b_iir, a_iir = signal.butter(order, wn, fs=fs)
print(order) # 8
# FIR: windowed-sinc design, 44 taps meets the same spec
b_fir = signal.firwin(44, 115, fs=fs)
print(np.allclose(b_fir, b_fir[::-1])) # True: symmetric,
# so linear phase
# Apply either one the same way:
# y = signal.lfilter(b_fir, [1.0], x) # FIR
# y = signal.lfilter(b_iir, a_iir, x) # IIR
Note how the code mirrors the theory: the FIR call passes [1.0] as the denominator, no feedback, while the IIR call passes its real denominator a_iir, the feedback coefficients. You can design the FIR half of this comparison yourself, coefficient by coefficient, in our FIR Filter Designer.
Which one should you choose?
- Phase must stay honest (audio crossovers, measurement, communications pulse shaping): FIR. Linear phase is something IIR simply cannot offer.
- Sharp cutoff, tiny processor, tight budget (control loops, cheap embedded sensing): IIR, then verify the poles and test the fixed-point behaviour.
- Stability must be guaranteed by construction (safety-related, or a design you cannot test exhaustively): FIR.
- Very long filters (room correction, long equalisers): FIR via FFT-based convolution, as in our convolution lesson, the coefficient count stops mattering when the FFT does the work.
- Still unsure? Prototype both against your specification the way this lesson did. The spec, not habit, should pick the family.
Common mistakes
- “IIR is always better because it is cheaper.” Cheaper per sample, yes, until the phase distortion or a stability surprise costs more than the saved arithmetic.
- “FIR filters are slow.” A 44-tap FIR is 44 multiply-adds per sample; modern parts do this trivially, and FFT convolution removes the scaling problem entirely.
- Comparing families at different specifications. An order-4 IIR against a 200-tap FIR proves nothing unless both were designed to the same passband/stopband requirements, insist on one spec, as in the head-to-head above.
- Forgetting quantisation on IIR. In fixed-point arithmetic, coefficient rounding moves the poles. An IIR design that is stable in floating point deserves a re-check in the arithmetic it will actually run in.
Quick quiz
- Which family can be unstable, and why?
- An FIR filter has 44 symmetric taps. What is its group delay, in samples?
- Your application cannot tolerate phase distortion. FIR or IIR?
Answers
- The IIR, its feedback places poles that can fall outside the unit circle. An FIR filter’s poles are all at the origin, so it is always stable.
- (44 − 1) / 2 = 21.5 samples, constant at all frequencies.
- FIR, symmetric FIR coefficients give exactly linear phase; IIR phase is inherently non-linear.
Frequently asked questions
What is the main difference between FIR and IIR filters?
The main difference is feedback. An FIR filter computes each output from current and past inputs only, so its impulse response is finite, it is always stable, and it can have exactly linear phase. An IIR filter also feeds past outputs back into the calculation, giving an infinite impulse response, a much sharper frequency response per coefficient, but possible instability and non-linear phase.
Why do IIR filters need fewer coefficients than FIR filters?
Feedback is leverage: each past output carries a decaying copy of everything that came before it, so a handful of feedback coefficients can sustain the long, sharp-edged response that an FIR filter must build sample by sample. In this lesson’s head-to-head, an order-8 Butterworth matched a 44-tap FIR on the same specification, a typical ratio for comparable designs.
Are FIR filters always stable?
Yes. An FIR filter has no feedback, so its output is a finite weighted sum of bounded inputs and cannot grow without bound; in z-transform terms, its only poles sit at the origin, deep inside the unit circle. Stability is the one property FIR designers never have to check, IIR designers must check it for every design, especially after coefficient quantisation.
Which is better for audio, FIR or IIR?
It depends on the job. IIR (usually as cascaded biquads) dominates real-time audio EQ because it is cheap and its phase behaviour is acceptable, and familiar from analog gear. FIR wins where phase linearity is the point: loudspeaker crossovers and room correction, where an IIR’s frequency-dependent delay would smear transients between drivers. Professional systems often use both in different stages.
Where to go next
The filters cluster continues with the design methods themselves: Window Functions (how the FIR above got its shape) and Butterworth Filter Design (the IIR family in depth) are the next lessons in the Intermediate DSP learning path. If the phase discussion was new, the z-transform lesson is the foundation under it.
References
- “Finite impulse response”, Wikipedia, en.wikipedia.org/wiki/Finite_impulse_response
- “Infinite impulse response”, Wikipedia, en.wikipedia.org/wiki/Infinite_impulse_response
- SciPy documentation: scipy.signal.firwin and scipy.signal.butter
Try it yourself
Design the FIR half of this lesson’s comparison in the browser: set a cutoff, add taps, and watch the impulse response and frequency response trade places exactly as the table predicts. Open the FIR Filter Designer.
Keep going in order: the Intermediate DSP learning path shows what to learn next.