Skip to content

Chapter 19

FIR filter design

Four lessons in Part VII, Filter design. Read them in order, or start anywhere: a prerequisite is a link, never a gate.

Start with 19.1
0 of 4 read1 on the essential pathabout 88 minutes

Lessons in this chapter

Two stacked panels. Taps: 12.4's 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: 12.4's 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.

Lesson 1 Essential20 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.

Lesson 218 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.

Lesson 325 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.

Lesson 425 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.

After this chapter

Where to go next.

The chapters either side, and the rest of Part VII in the library.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look