Digital filters are usually classified by the duration of their impulse response, which can be either finite or infinite. For filters with a finite duration of impulse response are called Finite Impulse Response filters or FIR; and filters with an infinite impulse response are called IIR filters. Each filter type has its own advantages and disadvantage. The IIR filter has the advantage of smaller coefficients, sharp cutoff frequencies, and analog filter modeling. Its disadvantages are however instability due to its recursive nature, a non-linear phase response, and roundoff noise can have a profound effect on filter performance. The FIR filter has the advantages of a constant phase and group delay, stability due to its non-recursive structure, and the roundoff noise can be kept to a minimal thus having little effect on filter performance. The disadvantages of FIR filters are however; a FIR fiilter's impulse response duration, although finite, may have to be very long to obtain sharp cutoff characteristics. The design of FIR filters to meet specific performance objectives is generally more difficult than the design of IIR filters for similar applications.
FIR filters use the algorithm of convolution to implement the filtering process, this formula is listed below:

Y(n) =E h(k)*x(n-k)

The design of the actual filter can be broken down into five basic steps.

  1. Filter Specification This may include stating the type of filter, for example lowpass filter, the desired amplitude and/or phase responses and the tolerances (if any) we are prepared to accept, the sampling frequency, and the wordlength of the input data.

  2. Coefficient Calculation At each step, we determine the coefficients of a transfer function H(z), which will satisfy the specifications given in (1). Our choice of coefficient calculation method will be influenced by several factors, the most important of which are the critical requirements in step (1).

  3. Realization This involves converting the transfer function obtained in (2) into a suitable filter network or structure.

  4. Analysis of Finite Wordlength Effects Here, we analyze the effect of quantizing the filter coefficients and the input data as well as the effect of carrying out the filtering operation using fixed wordlengths on the filter peformance.

  5. Implementation This involves producing the software code and/or hardware and performing the actual filtering.
The methods of coefficient calculation are thw Window Method, The Remerez Exchange or Optimal Method, and the Frequency Sampling Method. The window method is the simplest method employing a masking of the ideal impulse response with a windowing function. The two functions are multiplied together to form the actual coefficients. Some of the windowing functions along with the ideal impulse response functions are listed below.

Windowing Functions

Hanning3.1/N44.5+.5 cos((2*(PI)*n)/N)
Hamming3.3/N53.54+.46 cos((2*(pi)*n)/N)
Blackman5.5/N74.42+.5 cos((2*(pi)*n)/(N-1))+0.08 cos((4*(pi)*n)/(N-1))

Ideal Impulse Response Functions

Filter TypeHd(n),n!=0Hd(0)
Lowpass2*fc*(sin (n*wc)/n*wc)2*fc
Highpass-2*fc*(sin (n*wc)/n*wc)1-2*fc
Bandpass2*f2*(sin (n*w2)/n*w2)-2*f1*(sin (n*w1)/n*w1)2*(f2-f1)
Bandstop2*f1*(sin (n*w1)/n*w1)-2*f2*(sin (n*w2)/n*w2)1-2*(f2-f1)