Skip to content

Filter design

FIR filter design

Members: Free account

A finite impulse response (FIR) filter is a set of taps, and designing one means choosing them. This topic covers the window method with Kaiser's formulas, frequency-sampling design, optimal equiripple design by the Remez exchange, and special filters such as differentiators, half-band filters and Hilbert transformers.

Lessons on this topic

Two stacked panels. Taps: the ideal low-pass, Ω_c = 0.25π, cut to 81 taps: stems from n − α = −40 to 40. Gain: the design's H_zp(Ω) from 0 to π against the ideal, a dashed box at 1 up to 0.25π and 0 after it. A dotted level marks its highest value, 1.094; a bracket marks the edge, 0.022π wide from the 0.9 to the 0.1 crossing.Two stacked panels. Taps: the ideal low-pass, Ω_c = 0.25π, cut to 81 taps: stems from n − α = −40 to 40. Gain: the design's H_zp(Ω) from 0 to π against the ideal, a dashed box at 1 up to 0.25π and 0 after it. A dotted level marks its highest value, 1.094; a bracket marks the edge, 0.022π wide from the 0.9 to the 0.1 crossing.

Intermediate · 20 minYou are hereRead

Window-method FIR design

Cut the ideal low-pass to length, taper it with a window, size it with Kaiser’s formulas, and build high-pass, band-pass and band-stop filters from it.

The response panel shows the 17 samples as dots at Ω_k = 2πk/33: 1 for k = 0 to 4, 0 from k = 5. The taps panel shows 33 taps as stems, symmetric about n = 16, where the centre tap is 0.273. The response passes through every dot and ripples between them, up to 1.121 in the pass band and −15.9 dB in the stop band.The response panel shows the 17 samples as dots at Ω_k = 2πk/33: 1 for k = 0 to 4, 0 from k = 5. The taps panel shows 33 taps as stems, symmetric about n = 16, where the centre tap is 0.273. The response passes through every dot and ripples between them, up to 1.121 in the pass band and −15.9 dB in the stop band.

Intermediate · 18 minYou are hereRead

Frequency-sampling design

Choose a filter’s gain at the DFT frequencies, invert the DFT to get the taps, and calm the ripple with one sample in the gap.

Gain in dB from 0 to 4000 Hz with the running spec as hatched zones: the pass band up to 1000 Hz must stay within 1 ± 0.05, the stop band from 1500 Hz below −40 dB. The least squares curve (dashed, faded) fails: −31.7 dB at 1500 Hz in the stop band, a cross, and 0.076 from 1 at 1000 Hz in the pass band, a cross. The equiripple curve (solid) passes: at most −41.9 dB in the stop band and 0.040 from 1 in the pass band.Gain in dB from 0 to 4000 Hz with the running spec as hatched zones: the pass band up to 1000 Hz must stay within 1 ± 0.05, the stop band from 1500 Hz below −40 dB. The least squares curve (dashed, faded) fails: −31.7 dB at 1500 Hz in the stop band, a cross, and 0.076 from 1 at 1000 Hz in the pass band, a cross. The equiripple curve (solid) passes: at most −41.9 dB in the stop band and 0.040 from 1 in the pass band.

Intermediate · 25 minYou are hereRead

Optimal FIR design

Least squares makes the average error smallest and equiripple the worst error; the Remez exchange finds equiripple, which meets the running spec with 26 taps.

Gain against Ω from 0 to π: the ideal gain Ω (dashed); the first difference 2 sin(Ω/2) (dotted); the 61-tap design with cutoff 0.20π (solid). Input x[n], sin(0.04πn) with noise 0.05 RMS, for n from 0 to 239. Slopes per sample for n from 30 to 210, outputs moved back by their delays: the true slope 0.04π cos(0.04πn) (dashed); the first difference's output (dotted), error 0.0752; the 61-tap output (solid), error 0.0075.Gain against Ω from 0 to π: the ideal gain Ω (dashed); the first difference 2 sin(Ω/2) (dotted); the 61-tap design with cutoff 0.20π (solid). Input x[n], sin(0.04πn) with noise 0.05 RMS, for n from 0 to 239. Slopes per sample for n from 30 to 210, outputs moved back by their delays: the true slope 0.04π cos(0.04πn) (dashed); the first difference's output (dotted), error 0.0752; the 61-tap output (solid), error 0.0075.

Advanced · 25 minYou are hereRead

Special FIR filters

Build a differentiator that ignores noise, a half-band filter with every other tap zero, a Hilbert transformer and a fractional delay.

Phasorium

Account

Sign inWith Google, GitHub or your email

Subjects

Site

Look