fir filter coefficients calculator

FIR Filter Coefficients Calculator

Design linear-phase FIR filters with the windowed-sinc method. Enter your specs, click generate, and copy the coefficients directly into your DSP code.

Use an odd tap count for clean linear-phase symmetry and spectral inversion.

What this calculator does

This FIR filter coefficients calculator creates finite impulse response (FIR) taps using the classic windowed-sinc design method. It supports low-pass, high-pass, band-pass, and band-stop designs and applies common windows such as Hamming, Hann, Blackman, Rectangular, and Kaiser.

The output is a coefficient list you can directly use in embedded C/C++, Python (NumPy/SciPy pipelines), MATLAB, audio plugins, SDR projects, or FPGA DSP chains.

How the FIR design works

1) Start from an ideal response

The calculator builds an ideal impulse response from the sinc function. For example, the low-pass prototype is based on:

h[n] = sin(2πfc(n-M)) / (π(n-M)), with center index M = (N-1)/2.

2) Apply a window

Ideal filters are infinitely long, so we truncate them to N taps. Truncation causes ripples (Gibbs effect), so a window smooths the edges and improves stopband behavior. Different windows trade transition width for attenuation.

3) Normalize gain

If enabled, the tool scales coefficients so passband gain is close to 1. This helps avoid accidental amplitude shifts when you insert the filter into a signal chain.

Input parameter guide

  • Sampling Frequency: your system sample rate (e.g., 48000 Hz).
  • Number of Taps: larger means sharper transition but higher CPU cost and latency.
  • Cutoff Frequency: for low/high pass.
  • Lower + Upper Cutoff: for band-pass and notch filters.
  • Window Type: controls ripple and attenuation characteristics.

Practical tips for better FIR filters

Choose tap count by transition sharpness

If your passband and stopband are very close, you need more taps. If they are far apart, fewer taps can work.

Keep cutoff inside valid range

Cutoffs must be strictly between 0 and Nyquist (Fs/2). For band-pass and band-stop, ensure lower cutoff is less than upper cutoff.

Use odd taps for linear-phase symmetry

This page enforces odd tap counts because they provide a clean center tap and reliable behavior for spectral inversion in high-pass and notch modes.

Example use cases

  • Audio denoising: low-pass at 8 kHz for speech-band processing.
  • Sensor smoothing: low-pass for IMU or temperature signals.
  • Hum removal: band-stop around 50/60 Hz (with suitable bandwidth).
  • SDR channel selection: narrow band-pass around target channel.

How to use the generated coefficients in code

Once you generate taps, implement FIR convolution:

y[n] = Σ (h[k] * x[n-k])

Most DSP frameworks accept coefficients as an array. Keep taps in the same order shown by the calculator.

Common mistakes to avoid

  • Using too few taps for a very steep transition requirement.
  • Setting cutoff at or above Nyquist.
  • Forgetting to match the design sample rate to runtime sample rate.
  • Assuming all windows behave the same—window choice materially affects stopband attenuation.

Final note

This is an engineering-first FIR coefficient tool for fast iteration. If you need exact equiripple constraints, consider Parks–McClellan (Remez) methods. For many real-world pipelines, however, windowed-sinc FIR design is robust, interpretable, and fast to deploy.

🔗 Related Calculators