Reading
Stories Mode

What is an FIR Filter?

~13 min read Lesson 1 of Module 7

Filtering: Shaping the Spectrum

Every signal you encounter in the real world contains a mix of frequencies — some wanted, some not. A microphone picks up room noise alongside the speaker's voice. A sensor reading carries both the physical measurement and 60 Hz electrical interference. A radio receiver captures dozens of channels at once. Filtering is the operation that selectively passes certain frequencies while attenuating others, and it is one of the most fundamental operations in all of DSP.

There are two great families of digital filters: FIR (Finite Impulse Response) and IIR (Infinite Impulse Response). This module focuses on FIR filters — the simpler, more predictable, and in many respects more powerful of the two. Understanding what makes an FIR filter tick will unlock everything that follows: design methods, filter types, and the remarkable linear-phase property.

The Defining Idea: No Feedback

An FIR filter computes its output as a weighted sum of the current and a finite number of past input samples. That is it. There is no feedback — the output never feeds back into future calculations. This single structural choice gives FIR filters all of their most desirable properties.

Mathematically, the output at time n is:

FIR Difference Equation
y[n] = \sum_{k=0}^{M} b_k\, x[n-k] = b_0 x[n] + b_1 x[n-1] + \cdots + b_M x[n-M]
y[n] is the output, x[n−k] are the current and M past input samples, and b_k are the filter coefficients (weights). The filter has M+1 taps and order M.

The coefficients b_0, b_1, …, b_M are the design knobs. Choosing them wisely shapes the frequency response of the filter into whatever passband, stopband, and transition width you need.

The Impulse Response Is the Filter

Recall from Module 3 that an LTI system is completely characterised by its impulse response h[n]. For an FIR filter, the impulse response is exactly the set of coefficients:

Impulse Response
h[n] = \begin{cases} b_n & 0 \le n \le M \\ 0 & \text{otherwise} \end{cases}
h[k] = b_k for k = 0, 1, …, M; zero everywhere else. The impulse response has finite length M+1 — that is why the filter is called "finite impulse response."

Because h[n] has finite length, the output is simply the convolution of the input with that finite sequence: y[n] = x[n] * h[n]. There is nothing more to it. The filter output at any moment is a sliding dot product between the last M+1 input samples and the coefficient vector.

The Frequency Response

The frequency response of an FIR filter is the Discrete-Time Fourier Transform (DTFT) of its impulse response. Evaluating on the unit circle (z = e^{jω}):

Frequency Response
H(e^{j\omega}) = \sum_{k=0}^{M} b_k\, e^{-j\omega k}
H(e^{jω}) is a polynomial in e^{−jω}. The magnitude |H(e^{jω})| describes how each frequency is amplified or attenuated; the phase angle ∠H(e^{jω}) describes the time delay imposed at each frequency.

Unlike an analog filter whose order is constrained by the complexity of the circuit, an FIR filter can be made arbitrarily long — more coefficients means sharper transitions and flatter passbands, at the cost of more computation.

Unconditional Stability

One of the most important practical advantages of FIR filters is that they are always stable. Recall the BIBO stability criterion: a system is stable if and only if all its poles lie strictly inside the unit circle. Because an FIR filter has no feedback, its transfer function is a polynomial in z⁻¹ — it has zeros but no poles (or equivalently, all its poles are at the origin, z = 0, which is trivially inside the unit circle).

Why Stability Matters

An unstable filter produces outputs that grow without bound even for a bounded input — disastrous in a real-time audio or control system. IIR filters, which have feedback, can become unstable if the coefficients are not carefully designed or if finite-word-length effects push a pole outside the unit circle. With FIR filters, you simply never have to worry about this. Change any coefficient to any value and the filter remains stable.

No poles → no instability. FIR filters are unconditionally BIBO stable.

The Linear Phase Property

Perhaps the most celebrated property of FIR filters is the ability to achieve linear phase. A filter has linear phase if its phase response is a straight line: ∠H(e^{jω}) = −αω for some constant α. Linear phase means every frequency component is delayed by exactly the same amount (α samples). The waveform shape of a signal passing through a linear-phase filter is preserved — only the timing shifts.

Linear phase is achieved whenever the impulse response coefficients are symmetric (or antisymmetric). Specifically:

Symmetric
h[n] = h[M − n]
Mirror symmetry about the centre tap. Gives zero phase distortion. The most common case — used for low-pass, high-pass, and band-pass FIR filters.
Antisymmetric
h[n] = −h[M − n]
Odd symmetry about the centre. Adds a 90° phase shift to the linear phase. Used for differentiators and Hilbert transformers.

This symmetry condition is a powerful constraint: it halves the number of multiplications needed (because b_k = b_{M−k}, only half the coefficients are unique) and guarantees that the frequency response phase is linear — something that IIR filters can never achieve exactly.

Computational Cost

The price of FIR filters is computational: producing each output sample requires M+1 multiplications and M additions. A 101-tap low-pass filter (M = 100) requires 101 multiply-accumulate operations per sample. At 48 kHz audio, that is 4.85 million MACs per second — trivial for a modern DSP or microcontroller, but a meaningful consideration in very high sample-rate or very low-power applications.

Filter Length Taps (M+1) MACs / sample Typical Use
Short 11 – 31 11 – 31 Simple smoothing, pre-emphasis
Medium 51 – 127 51 – 127 Audio EQ, anti-aliasing
Long 255 – 1023 255 – 1023 Sharp crossovers, channel equalization
Very long 4096+ 4096+ Room correction, convolution reverb

For very long FIR filters (hundreds to thousands of taps), direct convolution becomes expensive. The overlap-add and overlap-save methods exploit the FFT to implement the convolution in the frequency domain at O(N log N) cost per block — a major speedup when the filter is much longer than the input block.

FIR Filters in Practice

FIR filters appear everywhere in digital signal processing:

Audio
Equalizers & Crossovers
Professional audio equalizers and loudspeaker crossover networks use linear-phase FIR filters to shape frequency response without introducing audible phase distortion.
Communications
Pulse Shaping
Root raised-cosine (RRC) filters are FIR filters used in digital modems and mobile radios to limit bandwidth and control inter-symbol interference.
Multirate
Anti-aliasing & Anti-imaging
The decimation and interpolation filters from Module 11 are almost always FIR: their unconditional stability and linear phase make them ideal for sample-rate conversion pipelines.
Biomedical
ECG / EEG Processing
ECG and EEG filters need linear phase to preserve waveform morphology — a slight phase distortion can make a normal QRS complex look pathological. FIR filters are the only choice.
Key Takeaways
  • An FIR filter computes its output as a weighted sum of the current and M past input samples — no feedback, no recursion.
  • The difference equation is y[n] = Σ b_k · x[n−k], where the M+1 coefficients b_k are the design parameters.
  • The impulse response equals the coefficient sequence: h[k] = b_k. It has finite length, which is why the filter is called "finite impulse response."
  • FIR filters are unconditionally BIBO stable — with no poles, there is nothing to go unstable, regardless of coefficient values.
  • A symmetric impulse response (h[n] = h[M−n]) guarantees linear phase: every frequency is delayed by the same amount, so waveform shape is preserved.
  • The computational cost is M+1 MACs per output sample; long FIR filters are typically implemented via the overlap-add FFT method for efficiency.
  • FIR filters are ubiquitous: audio EQ, pulse shaping in communications, multirate filtering, and biomedical signal processing all rely on their stability and phase properties.
Previous Real-Time Spectrum Analysis Module Overview Next Windowed-Sinc Method