Learning · Step 8

FIR filters

An FIR filter is a tapped delay line: y[n] = Σ h[k]·x[n−k]. The h[k] are the filter coefficients — designed as real numbers (a windowed sinc, a Parks–McClellan design, …). Porting an FIR to fixed-point means quantizing those coefficients. The input and accumulator side is ordinary multiply-accumulate (step 4); this step is about the coefficients.

Pick the coefficient Q the same way you pick it for any data (step 3): find max|h[k]|, give the integer side enough bits to cover it, and the rest is fractional resolution. A normalised low-pass has every |h| < 1, so the coefficients live in a fractional format — B_c bits = 1 sign + (B_c−1) fraction.

The headline rule: coefficient word length sets the stopband. Quantizing each coefficient rounds it by up to ±½ LSB; those tiny errors form an "error filter" that leaks into the stopband and lifts its floor. The attenuation you can reach is capped by the coefficient word length — each coefficient bit buys roughly 6 dB of stopband depth. Need 90 dB? Budget about 15–16 coefficient bits. The explorer below shows it directly.

Three rules bite in practice. Round, don't truncate the coefficients — truncation biases every tap the same way and pulls the DC gain off. Preserve symmetry — a linear-phase FIR has h[k] = h[L−1−k]; quantize one half and mirror it, or independent rounding can break the symmetry and with it the linear phase. Re-normalise the DC gain — rounding shifts Σh[k] slightly; nudge the centre tap to put it back.

x[n] tapped delay line L taps × h[k] coefficients Σ y[n] The coefficients h[k] are what you quantize — their word length sets the stopband.

Try it

A 41-tap low-pass (cutoff 0.22·fs). Drag the coefficient word length and watch the quantized stopband floor — the blue curve — rise toward the ideal design.

0-20-40-60-80-100-120 00.10.20.30.40.5 dB freq · fs
ideal design quantized coefficients quantized stopband floor

What to notice

Key fixed-point rules

Step exam

Answer all 3 questions correctly to complete this step.

  1. Quantizing FIR coefficients to fewer bits mainly degrades:

  2. Roughly how much stopband attenuation does each extra coefficient bit buy?

  3. When quantizing a linear-phase FIR you must: