Digital Signal Processing/FIR Filter Design

Filter design
The design procedure most frequently starts from the desired transfer function amplitude. The inverse Laplace transform provides the impulse response in the form of sampled values.

The length of the impulse response is also called the filter order.

Ideal lowpass filter
The ideal (brickwall or sinc filter) lowpass filter has an impulse response in the form of a sinc function:
 * $$h(n) = \frac{\omega_c}{\pi} \frac{sin(\omega_c n)}{\omega_c n}$$

This function is of infinite length. As such it can not be implemented in practice. Yet it can be approximated via truncation. The corresponding transfer function ripples on the sides of the cutoff frequency transition step. This is known as the Gibbs phenomenon.

Window design method
In order to smooth-out the transfer function ripples close to the cutoff frequency, one can replace the brickwall shape by a continuous function such as the Hamming, Hanning, Blackman and further shapes. These functions are also called window functions and are also used for smoothing a set of samples before processing it.

The following code illustrates the design of a Hamming window FIR:

Filter structure
A Finite Impulse Response (FIR) filter's output is given by the following sequence:


 * $$y(n) = b_0 \cdot x(n) + b_1 \cdot x(n-1) + b_2 \cdot x(n-2) + \cdots + b_{N-1} \cdot x(n-(N-1))$$

The following figure shows the direct implementation of the above formula, for a 4th order filter (N = 4):



With this structure, the filter coefficients are equal to the sample values of the impulse response.

- &larr; Digital Signal Processing &rarr;