FIR Filter Designer

MagnitudedB
Point at the curve for an exact reading
Impulse response101 taps
Coefficients
101taps50 samples · 1.042 msdelay55.6 dBstopband attenuation0.125 dBpassband ripple, peak to peak1512 Hztransition, −0.1 dB to stopband

Shareable link

Settings are written to the URL as you change them. Nothing differs from the defaults yet.

Set the response, the edges and the tap count, and read the filter off the plot. The stats under the tool are measured from the finished taps, so they describe the filter you copy, not the one the textbook promises.

The window method

A perfect low-pass has an impulse response that never ends. Cutting it to a finite length and tapering the ends with a window gives a usable filter, and the window decides the trade between stopband depth and transition width. These are the figures for 101 taps with a 4000 Hz cutoff at 48000 Hz:

Window Stopband attenuation Transition, −0.1 dB to stopband
Rectangular 20.4 dB 498 Hz
Hann 43.9 dB 1477 Hz
Hamming 55.6 dB 1512 Hz
Blackman 75.2 dB 2297 Hz
Blackman-Harris 109.4 dB 3041 Hz
Kaiser, set to 80 dB 79.7 dB 2109 Hz

The cutoff is the −6 dB point, in the middle of the transition. The Kaiser window is the only one with a dial: set the attenuation you need and it takes no more transition width than that requires.

Equiripple (Parks-McClellan)

The Parks-McClellan algorithm finds the taps that make the largest error as small as it can be, which spreads the ripple evenly across each band. It needs to know where the bands end, so it has a transition width control, centred on each cutoff. With 101 taps and a 4000 Hz cutoff at 48000 Hz:

Transition Stopband weight Stopband attenuation Passband ripple
500 Hz 1 25.0 dB 0.936 dB
1000 Hz 1 41.6 dB 0.144 dB
1000 Hz 10 52.4 dB 0.415 dB
2000 Hz 1 71.2 dB 0.004 dB

Stopband weight moves error from one band to the other. At 10, the stopband ripple is ten times smaller than the passband ripple, and the passband pays for it.

Choosing the tap count

Attenuation and transition width are bought with taps, and taps cost delay and arithmetic. Each output sample takes one multiply per tap, and the signal comes out (taps − 1) / 2 samples late. The slider stops at 511, which is a transition of roughly 340 Hz at 48000 Hz and 60 dB. A narrower filter than that is usually better built as a decimator followed by a short filter at the lower rate.

Export formats

  • One per line is plain text for a spreadsheet or a config file.
  • C float array and NumPy array paste into source.
  • C int16 array, Q15 multiplies each tap by 32768 and rounds. Rounding to 16 bits raises the stopband floor: the 101-tap Blackman-Harris design above falls from 109.4 dB to 73.5 dB once its taps are stored as Q15.
  • WAV impulse writes the taps as a mono 24-bit file at the design sample rate. Any convolution processor then applies the filter.

Because the taps are symmetric, the order does not matter to libraries that want them reversed, such as arm_fir_f32.

Linear phase and its cost

Every filter here delays all frequencies by the same amount, so a waveform keeps its shape. The price is pre-ringing: the impulse response is symmetric, so half of the ripple arrives before the main tap. On a steep low-pass near the top of the audio band that is inaudible. On a steep filter at a few hundred hertz it can be heard ahead of a transient, and a minimum-phase IIR such as a cascade of biquads is the better tool.

Questions about FIR Filter Designer

What does the designer produce, and what does it need from me?

It produces the taps of a linear-phase FIR filter. It needs a response (low-pass, high-pass, band-pass or band-stop), a sample rate, one or two edge frequencies and a tap count. There is no audio file to load.

Window or equiripple: which method should I pick?

Start with the window method: it has one choice to make and never fails. Switch to equiripple when the tap count is fixed and you need the most attenuation it can give, or when the passband and stopband need different tolerances. For the same taps and transition width, the equiripple design has the smaller worst-case error.

Why is the tap count always odd?

An odd-length symmetric filter is the one linear-phase type that can realise all four responses, and its delay is a whole number of samples. An even-length symmetric filter has a forced zero at Nyquist, so it cannot be a high-pass or a band-stop.

How many taps do I need?

Kaiser's estimate is taps = (A − 7.95) / (14.36 × transition / sample rate) + 1, with A the stopband attenuation in dB. For 60 dB and a 1000 Hz transition at 48000 Hz that is about 175. Halving the transition width doubles the count.

What is the delay of the filter?

Half the tap count minus a half: (taps − 1) / 2 samples, at every frequency. A 101-tap filter delays the signal by 50 samples, which is 1.042 ms at 48000 Hz.

Why did the equiripple design fail?

The specification left it no room. Either the transition band is wider than a pass or stop band, so a band has no width left, or the tap count is too low for the exchange to find enough ripples. Widen the transition, move the cutoff, or change the tap count.

How accurate are the coefficients?

They are computed in double precision. The window designs were checked against scipy.signal.firwin and the equiripple designs against scipy.signal.remez, and agree to 12 decimal places or better across the test set. The copied text carries 10 significant digits.

Related tools

Browse all tools