Skip to content

FIR and IIR Filters

A digital filter processes a discrete-time signal to alter its frequency content. It passes desired components, attenuates unwanted components, or changes their relative phase. Every practical LTI digital filter is characterized equivalently by its difference equation, impulse response h[n]h[n], system function H(z)H(z), or frequency response H(ejΩ)H(\mathrm{e}^{\mathrm{j}\Omega}).

Digital angular frequency is normalized to the sampling frequency:

Ω=2πffsrad/sample,f=Ω2πfs.\Omega=2\pi\frac{f}{f_s} \quad\text{rad/sample}, \qquad f=\frac{\Omega}{2\pi}f_s.

The DT frequency response is 2π2\pi-periodic, so a principal interval such as −π≤Ω≤π-\pi\leq\Omega\leq\pi is sufficient. The point Ω=π\Omega=\pi corresponds to the Nyquist frequency fs/2f_s/2.

For a real zero-phase ideal response, the four basic magnitude specifications over ∣Ω∣≤π|\Omega|\leq\pi are

Thus a low-pass filter (LPF) passes low frequencies, a high-pass filter (HPF) passes high frequencies, a band-pass filter (BPF) passes only a selected band, and a band-stop or notch filter (BSF) rejects a selected band. The value assigned at a single cutoff point does not affect the inverse transform.

Ideal one-sided digital-filter magnitude responses over 0 ≤ Ω ≤ π. The negative-frequency halves are obtained by even symmetry for real zero-phase responses.

Ideal one-sided digital-filter magnitude responses over 0≤Ω≤π0\leq\Omega\leq\pi. The negative-frequency halves are obtained by even symmetry for real zero-phase responses.

Why a brick-wall ideal filter is noncausal

Section titled “Why a brick-wall ideal filter is noncausal”

For the zero-phase ideal LPF,

HLP(ejΩ)={1,∣Ω∣≤Ωc,0,Ωc<∣Ω∣≤π.H_{\mathrm{LP}}(\mathrm{e}^{\mathrm{j}\Omega})= \begin{cases} 1,&\left\lvert \Omega\right\rvert\leq\Omega_c,\\ 0,&\Omega_c<\left\lvert \Omega\right\rvert\leq\pi. \end{cases}

Applying the inverse DTFT gives

hLP[n]=12π∫−ΩcΩcejΩndΩ={Ωcπ,n=0,sin⁡(Ωcn)πn,n≠0.\begin{aligned} h_{\mathrm{LP}}[n] &=\frac{1}{2\pi}\int_{-\Omega_c}^{\Omega_c} \mathrm{e}^{\mathrm{j}\Omega n}\mathrm{d}\Omega\\ &=\begin{cases} \dfrac{\Omega_c}{\pi},&n=0,\\[2mm] \dfrac{\sin(\Omega_cn)}{\pi n},&n\neq0. \end{cases} \end{aligned}

This sinc-shaped sequence extends to both n=+∞n=+\infty and n=−∞n=-\infty. Therefore it depends on future input samples and is noncausal. No finite delay can move an infinitely long negative-time tail entirely to n≥0n\geq0. The other ideal responses are combinations of ideal low-pass responses:

hHP[n]=δ[n]−hLP,Ωc[n],hBP[n]=hLP,Ω2[n]−hLP,Ω1[n],hBS[n]=δ[n]−hBP[n].\begin{aligned} h_{\mathrm{HP}}[n] &=\delta[n]-h_{\mathrm{LP},\Omega_c}[n],\\ h_{\mathrm{BP}}[n] &=h_{\mathrm{LP},\Omega_2}[n]-h_{\mathrm{LP},\Omega_1}[n],\\ h_{\mathrm{BS}}[n] &=\delta[n]-h_{\mathrm{BP}}[n]. \end{aligned}

They inherit the same infinite two-sided support. Moreover, the 1/n1/n tail of an exact brick-wall response is not absolutely summable in general, so the ideal zero-phase filter is not a causal BIBO-stable realization.

Practical filters replace the abrupt discontinuity by a transition band. A specification normally states passband edge Ωp\Omega_p, stopband edge Ωs\Omega_s, maximum passband ripple δp\delta_p, and maximum stopband level δs\delta_s. A narrower transition band or smaller allowed ripple requires a higher order, more computation, or both.

An FIR filter has an impulse response of finite duration. A causal FIR filter of order MM and length L=M+1L=M+1 obeys

The output is the finite convolution of the input with the coefficient sequence. It depends only on present and past inputs, never on a past output, so the structure is non-recursive.

Generic FIR direct-form or transversal realization. The tapped delay line stores the present and past input samples and weights them by b₀, …, b_(M) before summation.

Generic FIR direct-form or transversal realization. The tapped delay line stores the present and past input samples and weights them by b0,…,bMb_0,\ldots,b_M before summation.

The direct or transversal realization is a tapped delay line. It uses MM unit delays, M+1M+1 coefficient multipliers, and MM additions when all taps are nonzero. Each delay exposes another input sample, each multiplier forms bkx[n−k]b_kx[n-k], and the adder chain forms the convolution sum.

For finite coefficients,

∑n=−∞∞∣h[n]∣=∑n=0M∣bn∣<∞.\sum_{n=-\infty}^{\infty}\left\lvert h[n]\right\rvert =\sum_{n=0}^{M}\left\lvert b_n\right\rvert<\infty.

Hence every such FIR filter is BIBO stable. In the zz-plane its nontrivial finite zeros shape the response; poles introduced by writing the delay polynomial as a ratio are only at the origin and do not threaten causal stability.

An FIR filter with real coefficients has exact generalized linear phase when its impulse response is symmetric or antisymmetric about its midpoint:

Pairing samples equidistant from M/2M/2 factors the frequency response as

H(ejΩ)=e−jΩM/2A(Ω),H(\mathrm{e}^{\mathrm{j}\Omega}) =\mathrm{e}^{-\mathrm{j}\Omega M/2}A(\Omega),

where A(Ω)A(\Omega) is real for symmetric coefficients and is purely imaginary apart from a constant j\mathrm{j} factor for antisymmetric coefficients. Therefore the phase is linear, apart from π\pi jumps where A(Ω)A(\Omega) changes sign, and the group delay is constant:

τg=−d∠H(ejΩ)dΩ=M2samples.\tau_g=-\frac{\mathrm{d}\angle H(\mathrm{e}^{\mathrm{j}\Omega})}{\mathrm{d}\Omega}=\frac{M}{2} \quad\text{samples}.

Symmetry also reduces arithmetic: paired samples can be added or subtracted before one shared multiplication.

The four real linear-phase FIR types are classified by symmetry and length.

TypeCoefficient relationLength and orderForced frequency-response zeros
ISymmetricLL odd, MM evenNone at 00 or π\pi
IISymmetricLL even, MM oddH(ejπ)=0H(\mathrm{e}^{\mathrm{j}\pi})=0
IIIAntisymmetricLL odd, MM evenH(1)=0H(1)=0 and H(ejπ)=0H(\mathrm{e}^{\mathrm{j}\pi})=0
IVAntisymmetricLL even, MM oddH(1)=0H(1)=0

Four types of real-coefficient linear-phase FIR filters.

Type III has a zero center coefficient because antisymmetry requires h[M/2]=−h[M/2]h[M/2]=-h[M/2]. The forced-zero restrictions matter in selecting a type: for example, Type II cannot realize a high-pass response with nonzero gain at Ω=π\Omega=\pi, and antisymmetric Types III and IV are suited to differentiators and Hilbert transformers rather than ordinary low-pass filters.

  • No feedback: The realization is non-recursive and cannot sustain a zero-input limit cycle.

  • Guaranteed stability: Finite coefficients give an absolutely summable finite impulse response.

  • Phase control: Coefficient symmetry or antisymmetry gives exact linear phase and constant group delay.

  • Main cost: A sharp transition generally requires a higher order, more delays, and more multiplications than an IIR design.

  • Finite-word behavior: Coefficient quantization moves zeros and changes ripple, but there are no feedback poles to move outside the unit circle; round-off errors do not circulate indefinitely.

Typical FIR applications are linear-phase audio processing, communication pulse shaping and matched filtering, moving-average smoothing, multirate decimation/interpolation, and any design in which guaranteed stability or an undistorted waveform shape is more important than minimum order.

An IIR filter uses feedback. Its present output depends on present and past inputs and on past outputs:

The denominator creates recursive modes. After an impulse has entered, a nonzero pole generally causes the response to continue indefinitely, even when all subsequent input samples are zero. Degenerate exact cancellations can shorten the external impulse response, but they should not be relied upon to remove an internal unstable mode.

For a causal rational IIR filter, BIBO stability requires every pole of the reduced H(z)H(z) to lie strictly inside the unit circle. A pole on the unit circle is not BIBO stable, and a pole outside it produces a growing causal natural response. As established in the section, that pole-only shorthand assumes the causal ROC outside the outermost pole.

Let

B(z)=∑m=0Mbmz−m,A(z)=1+∑k=1Nakz−k,H(z)=B(z)A(z).B(z)=\sum_{m=0}^{M}b_mz^{-m}, \qquad A(z)=1+\sum_{k=1}^{N}a_kz^{-k}, \qquad H(z)=\frac{B(z)}{A(z)}.

Delays, coefficient multipliers, and summers can realize this ratio in several mathematically equivalent ways. Internal signal ranges and finite-word sensitivity, however, need not be equivalent.

Direct Form I implements the original recursion directly. The feedforward part stores x[n−m]x[n-m], while a separate feedback line stores y[n−k]y[n-k]. For a second-order example,

y[n]=b0x[n]+b1x[n−1]+b2x[n−2]−a1y[n−1]−a2y[n−2].\begin{aligned} y[n]={}&b_0x[n]+b_1x[n-1]+b_2x[n-2]\\ &{}-a_1y[n-1]-a_2y[n-2]. \end{aligned}

IIR Direct Form I realization. The numerator taps b₀, …, b_(M) use delayed input samples, while the signed denominator taps −a₁, …, −a_(N) use a separate delayed-output line.

IIR Direct Form I realization. The numerator taps b0,…,bMb_0,\ldots,b_M use delayed input samples, while the signed denominator taps −a1,…,−aN-a_1,\ldots,-a_N use a separate delayed-output line.

The general DF-I realization uses M+NM+N delays, M+1M+1 feedforward multipliers, and NN feedback multipliers. Its separate sections use more memory than the canonical form, but the separation can give more convenient internal scaling and can reduce overflow risk at a single shared state node.

Factor the system as an all-pole section followed by a feedforward section and define the intermediate state w[n]w[n]:

Taking the ZZ-transform with zero initial state confirms

W(z)=X(z)A(z),Y(z)=B(z)W(z),Y(z)X(z)=B(z)A(z).W(z)=\frac{X(z)}{A(z)}, \qquad Y(z)=B(z)W(z), \qquad \frac{Y(z)}{X(z)}=\frac{B(z)}{A(z)}.

The same delayed values w[n−k]w[n-k] serve both sums, so the two lines merge. Coefficients missing when M≠NM\neq N are treated as zero.

IIR Direct Form II, the canonical realization. Feedback taps −a₁, …, −a_(N) and feedforward taps b₀, …, b_(M) use the same stored states w(n − k), reducing the memory to max (M, N) delays.

IIR Direct Form II, the canonical realization. Feedback taps −a1,…,−aN-a_1,\ldots,-a_N and feedforward taps b0,…,bMb_0,\ldots,b_M use the same stored states w(n−k)w(n-k), reducing the memory to max⁡(M,N)\max(M,N) delays.

DF-II uses only max⁡(M,N)\max(M,N) delays and is therefore called the canonical direct form. For the usual case M≤NM\leq N, it uses NN state delays. Its economy comes with a numerical trade-off: the internal w[n]w[n] can be much larger than the input or output because pole amplification occurs before numerator attenuation. Careful scaling is therefore more important than in DF-I.

For the coefficient form in the equation, the numerator order is MM, the denominator order is NN, and the direct realization order is normally max⁡(M,N)\max(M,N) after leading zero coefficients and common factors are removed. “FIR order MM” means MM delays but M+1M+1 taps; this common off-by-one distinction is exam-relevant.

RealizationUnit delaysMultipliersMain structural fact
FIR direct formMMM+1M+1One tapped input delay line; no feedback
IIR Direct Form IM+NM+NM+N+1M+N+1Separate input and output delay lines
IIR Direct Form IImax⁡(M,N)\max(M,N)M+N+1M+N+1Shared state line; minimum delay memory

Delay and arithmetic counts for direct realizations with nonzero coefficients.

High-order IIR filters are rarely implemented as one large direct-form polynomial in finite precision. Factoring H(z)H(z) into first- and second-order sections (SOS or biquads), ordering the sections, and scaling between them usually gives much better numerical robustness. Transposed direct forms realize the same transfer function with different internal round-off and overflow behavior.

Finite-Word Effects in FIR and IIR Filters

Section titled “Finite-Word Effects in FIR and IIR Filters”

Real implementations quantize coefficients, products, and stored states. Their consequences differ sharply because IIR errors circulate through feedback.

  • Coefficient quantization: FIR zeros move and the magnitude ripple changes, but stability remains guaranteed. IIR poles also move; a pole close to ∣z∣=1|z|=1 can cross outside and make the quantized filter unstable.

  • Round-off noise: An FIR arithmetic error passes through a finite path and dies out. In an IIR filter it is fed back and can be amplified or spectrally shaped by the poles.

  • Limit cycles: Quantization makes an IIR recursion nonlinear. Even with x[n]=0x[n]=0, rounding or overflow can sustain a periodic zero-input oscillation. FIR filters without feedback do not have this autonomous limit-cycle mechanism.

  • Overflow: Two’s-complement wraparound can create large errors or overflow limit cycles. Saturation arithmetic is usually less destructive but is still nonlinear.

Common IIR precautions are SOS implementation, section ordering, state scaling, guard bits, higher coefficient precision, saturation arithmetic, and rounding instead of truncation. Dither can suppress some small-amplitude deterministic cycles at the cost of added noise. Stability must be checked using the quantized coefficients, not only the ideal design values.

FeatureFIR filterIIR filter
Impulse responseFinite durationTheoretically infinite duration
Difference equationFeedforward finite convolutionFeedforward plus recursive feedback
StructureNon-recursiveRecursive
FeedbackNoneUses past outputs or internal states
StabilityAlways BIBO stable for finite coefficientsDepends on pole locations; causal poles must satisfy $
PhaseExact linear phase is possible by symmetry or antisymmetryGenerally nonlinear phase; exact causal linear phase is not normally possible for a nontrivial stable IIR
Order for a sharp cutoffUsually higherUsually lower
ComputationMore multiplications for the same magnitude specificationFewer multiplications and delays for a comparable sharp response
Quantization sensitivityLower; errors do not recurHigher; pole movement and feedback amplify finite-word effects
Limit cyclesNo feedback-induced zero-input limit cyclesRound-off or overflow limit cycles are possible
Typical design routeWindowing, frequency sampling, or optimal/equiripple designDigital design or transformation of an analog prototype
Principal advantageGuaranteed stability and controllable exact linear phaseSharp transition with low order and low arithmetic cost
Principal limitationHigher order, memory, computation, and delayPossible instability, nonlinear phase, and finite-word sensitivity

Exam-oriented comparison of FIR and IIR digital filters.

An ideal impulse response can be truncated and multiplied by a window. The window length controls transition width; the window shape trades main-lobe width against stopband sidelobes. Frequency-sampling methods prescribe samples of the desired response, while equiripple methods distribute the worst-case weighted error optimally across bands. Increasing order generally narrows the transition, but also increases group delay M/2M/2 for a linear-phase design.

Choose an FIR filter when waveform shape and phase linearity matter, when stability must be unconditional, or when multirate/polyphase implementation can exploit many zero coefficients. Representative uses include audio and image processing, data-communication pulse shaping, channel equalization, matched filtering, and moving-average sensor smoothing.

IIR filters are often obtained from stable analog prototypes. A Butterworth prototype is maximally flat in the passband; a Chebyshev prototype accepts ripple for a sharper transition; an elliptic prototype allows ripple in both passband and stopband for a still lower order. The bilinear transform avoids aliasing but warps frequency and may require prewarping. Impulse invariance maps sampled analog impulse responses but can alias analog spectral copies.

Choose an IIR filter when arithmetic, memory, latency, or processor power is limited and exact linear phase is unnecessary. Applications include low-order real-time audio equalizers and tone controls, speech and communication-channel filtering, biomedical low-pass/high-pass/notch filtering, recursive sensor smoothing, and digital Butterworth, Chebyshev, or elliptic filters.