EE Design Calc
Home/Calculators

FIR Filter Coefficient Designer (Hamming Window)

Enter sampling frequency, cutoff frequency, and filter order to generate Hamming-windowed FIR lowpass coefficients — outputs a C array ready to paste into firmware.

Filter Specifications

Hz
Hz
taps
Design Rules:
- Nyquist theorem: Fc must be less than Fs / 2.
- Higher order M → steeper stopband roll-off, but increases computation delay and complexity proportionally.

Filter Frequency Response (Magnitude)

Enter specifications to plot the frequency response.

Generated C Array

// Hamming Window FIR Lowpass Filter Coefficients
// Fs = 8000 Hz, Fc = 1000 Hz, Taps = 31
#define FIR_LPF_COEFFS_30_TAPS 31

const double FIR_LPF_COEFFS_30[FIR_LPF_COEFFS_30_TAPS] = {
  -0.0012039,
  -0.0020534,
  -0.0020796,
  0.0000000,
  0.0047649,
  0.0098960,
  0.0099785,
  0.0000000,
  -0.0189638,
  -0.0362933,
  -0.0347620,
  0.0000000,
  0.0686323,
  0.1532658,
  0.2234585,
  0.2507202,
  0.2234585,
  0.1532658,
  0.0686323,
  0.0000000,
  -0.0347620,
  -0.0362933,
  -0.0189638,
  0.0000000,
  0.0099785,
  0.0098960,
  0.0047649,
  0.0000000,
  -0.0020796,
  -0.0020534,
  -0.0012039
};

FIR Digital Filter Fundamentals

An FIR (Finite Impulse Response) filter is the most fundamental digital filter in DSP. It multiplies incoming digital samples by a weighted coefficient array and sums the products — a convolution operation — to attenuate high-frequency noise components.

Why a Hamming Window?

The ideal mathematical sinc lowpass filter has infinite duration in time. Real microcontrollers and DSPs must truncate it to a finite number of taps, which causes severe ringing at the cutoff edge (Gibbs phenomenon). Applying a Hamming window function smoothly tapers the coefficient ends, trading a small amount of transition sharpness for a flat, well-behaved stopband attenuation.