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 , system function , or frequency response .
Digital angular frequency is normalized to the sampling frequency:
The DT frequency response is -periodic, so a principal interval such as is sufficient. The point corresponds to the Nyquist frequency .
Ideal Frequency-Selective Filters
Section titled “Ideal Frequency-Selective Filters”For a real zero-phase ideal response, the four basic magnitude specifications over 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 . 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,
Applying the inverse DTFT gives
This sinc-shaped sequence extends to both and . Therefore it depends on future input samples and is noncausal. No finite delay can move an infinitely long negative-time tail entirely to . The other ideal responses are combinations of ideal low-pass responses:
They inherit the same infinite two-sided support. Moreover, the 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 , stopband edge , maximum passband ripple , and maximum stopband level . A narrower transition band or smaller allowed ripple requires a higher order, more computation, or both.
Finite Impulse Response Filters
Section titled “Finite Impulse Response Filters”An FIR filter has an impulse response of finite duration. A causal FIR filter of order and length 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 before summation.
The direct or transversal realization is a tapped delay line. It uses unit delays, coefficient multipliers, and additions when all taps are nonzero. Each delay exposes another input sample, each multiplier forms , and the adder chain forms the convolution sum.
For finite coefficients,
Hence every such FIR filter is BIBO stable. In the -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.
Exact linear phase
Section titled “Exact linear phase”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 factors the frequency response as
where is real for symmetric coefficients and is purely imaginary apart from a constant factor for antisymmetric coefficients. Therefore the phase is linear, apart from jumps where changes sign, and the group delay is constant:
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.
| Type | Coefficient relation | Length and order | Forced frequency-response zeros |
|---|---|---|---|
| I | Symmetric | odd, even | None at or |
| II | Symmetric | even, odd | |
| III | Antisymmetric | odd, even | and |
| IV | Antisymmetric | even, odd |
Four types of real-coefficient linear-phase FIR filters.
Type III has a zero center coefficient because antisymmetry requires . The forced-zero restrictions matter in selecting a type: for example, Type II cannot realize a high-pass response with nonzero gain at , and antisymmetric Types III and IV are suited to differentiators and Hilbert transformers rather than ordinary low-pass filters.
FIR characteristics and applications
Section titled “FIR characteristics and applications”-
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.
Infinite Impulse Response Filters
Section titled “Infinite Impulse Response Filters”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 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.
IIR Direct-Form Realizations
Section titled “IIR Direct-Form Realizations”Let
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: separate delay lines
Section titled “Direct Form I: separate delay lines”Direct Form I implements the original recursion directly. The feedforward part stores , while a separate feedback line stores . For a second-order example,
IIR Direct Form I realization. The numerator taps use delayed input samples, while the signed denominator taps use a separate delayed-output line.
The general DF-I realization uses delays, feedforward multipliers, and 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.
Direct Form II: shared state delay line
Section titled “Direct Form II: shared state delay line”Factor the system as an all-pole section followed by a feedforward section and define the intermediate state :
Taking the -transform with zero initial state confirms
The same delayed values serve both sums, so the two lines merge. Coefficients missing when are treated as zero.
IIR Direct Form II, the canonical realization. Feedback taps and feedforward taps use the same stored states , reducing the memory to delays.
DF-II uses only delays and is therefore called the canonical direct form. For the usual case , it uses state delays. Its economy comes with a numerical trade-off: the internal 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.
Order, state, and delay count
Section titled “Order, state, and delay count”For the coefficient form in the equation, the numerator order is , the denominator order is , and the direct realization order is normally after leading zero coefficients and common factors are removed. “FIR order ” means delays but taps; this common off-by-one distinction is exam-relevant.
| Realization | Unit delays | Multipliers | Main structural fact |
|---|---|---|---|
| FIR direct form | One tapped input delay line; no feedback | ||
| IIR Direct Form I | Separate input and output delay lines | ||
| IIR Direct Form II | Shared 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 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 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 , 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.
FIR and IIR Comparison
Section titled “FIR and IIR Comparison”| Feature | FIR filter | IIR filter |
|---|---|---|
| Impulse response | Finite duration | Theoretically infinite duration |
| Difference equation | Feedforward finite convolution | Feedforward plus recursive feedback |
| Structure | Non-recursive | Recursive |
| Feedback | None | Uses past outputs or internal states |
| Stability | Always BIBO stable for finite coefficients | Depends on pole locations; causal poles must satisfy $ |
| Phase | Exact linear phase is possible by symmetry or antisymmetry | Generally nonlinear phase; exact causal linear phase is not normally possible for a nontrivial stable IIR |
| Order for a sharp cutoff | Usually higher | Usually lower |
| Computation | More multiplications for the same magnitude specification | Fewer multiplications and delays for a comparable sharp response |
| Quantization sensitivity | Lower; errors do not recur | Higher; pole movement and feedback amplify finite-word effects |
| Limit cycles | No feedback-induced zero-input limit cycles | Round-off or overflow limit cycles are possible |
| Typical design route | Windowing, frequency sampling, or optimal/equiripple design | Digital design or transformation of an analog prototype |
| Principal advantage | Guaranteed stability and controllable exact linear phase | Sharp transition with low order and low arithmetic cost |
| Principal limitation | Higher order, memory, computation, and delay | Possible instability, nonlinear phase, and finite-word sensitivity |
Exam-oriented comparison of FIR and IIR digital filters.
Design and Application Notes
Section titled “Design and Application Notes”FIR design routes
Section titled “FIR design routes”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 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 design routes
Section titled “IIR design routes”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.