You are on page 1of 4

FIR FILTER DESIGN

Design of FIR filters are based on directly approximating the desired frequency response of the discrete time system. Most techniques used to design FIR filters use linear phase constraint. The simplest method of FIR filter design is called window method. To obtain a casual FIR filter a window truncates frequency response of the ideal filter. FIR filters have the following advantages: Exactly linear phase is possible Always stable, even when quantized Design methods are generally linear Efficient hardware realizations Startup transients have finite duration

FIR filters have the following disadvantages: Higher filter order than IIR filters Corresponding greater delays

FIR Block Diagram

The FIR Filter consist of three main components:

1) A D Flip-Flop to implement a simple delay. 2) A Multiplier to implement the coefficients, which in our case we are using a Boxcar filter, meaning all coefficients are 1. 3) A Full adder to sum the nodes at the end of each Tap.

FIR Methods
Filter Method Windowing Description
Apply window to truncated inverse Fourier transform of desired filter

Filter Functions fir1, fir2, kaiserord

Multiband with Transition Bands Constrained Least Squares

Equiripple or least squares approach over frequency sub-bands

firls, firpm, firpmord

Minimize squared integral error over entire frequency range subject to maximum error constraints

fircls, fircls1

Arbitrary Response Raised Cosine

Arbitrary responses, including nonlinear phase and complex filters

cfirpm

Lowpass response with smooth, sinusoidal transition

firrcos

Digital filters with finite-duration impulse response (all-zero, or FIR filters) have both advantages and disadvantages compared to infinite-duration impulse response (IIR) filters. FIR filters have the following primary advantages: They can have exactly linear phase. They are always stable. The design methods are generally linear. They can be realized efficiently in hardware. The filter startup transients have finite duration.

The primary disadvantage of FIR filters is that they often require a much higher filter order than IIR filters to achieve a given level of performance. Correspondingly, the delay of these filters is often much greater than for an equal performance IIR filter. In order to design a FIR filter using Matlab we can use fir1 and Filter commands. The format of fir1 is as follows: LOW PASS: - B = FIR1(N,Wn) designs an N' th order low pass FIR digital filter and returns the filter coefficients in length N+1 vector B. For example in order to design a FIR filter assuming a sampling rate of 48khz and having a low pass filter with the cut off frequency of 10khz by windowing method: B=fir1(40,10.0/(48.0/2))=fir1( N, fc/(fs/2) )

HIGH PASS: - B = FIR1(N,Wn,'high')=FIR1(N,fc/(fs/2),high) designs an N'th order high pass filter.

BAND PASS: If Wn is a two-element vector, Wn = [W1 W2], FIR1 returns an order N band pass filter with pass band W1 < W < W2. Example: FIR1( N , [f1/(fs/2) f2/(fs/2)] )

BAND STOP: If Wn = [W1 W2], B = FIR1(N,Wn,'stop') will design a band stop filter. FIR1( N , * f1/(fs/2) f2/(fs/2) +, stop )

FILTER command (One-dimensional digital filter) : Y = FILTER(B,A,X) filters the data in vector X with the filter described by vectors A and B to create the filtered data Y. For FIR filters A=1 because they do not contain any poles.

FREQZ(b,1,f,fs) will plot frequency response of the filter designed above for the designated f vector.

You might also like