DSP: E71: Lab 8: FIR Filter Design

 

Aron Dobos, David Luong, Brian Park, and Mark Piper

April 13, 2006

 

Part 1

 

brec = fir1(22, .3, rectwin(23));

% bhan = fir1(22, .3, hanning(23));

% bham = fir1(22, .3, hamming(23));

% bbla = fir1(22, .3, blackman(23));

 

fvtool(brec,1);

% fvtool(bhan,1);

% fvtool(bham,1);

% fvtool(bbla,1);

 

Rectangular

Hanning

Hamming

Blackman

 

 

The amplitude responses among the filters with the various windows are quite distinct.  We compare the filter performance in terms of the peak of the absolute error, in other words the side-lobe height.  The rectangular window exhibits the worst peak and progressively nears negative infinity in dB in the other filters, corresponding to a zero response.  The Blackman filter has the lowest side-lobe height.  The Hamming window has a more equi-ripple side-lobe roll-off.

 

Part 2

 

h=remez(20,[0,.4,.5,1],[1 1 0 0])

fvtool(h,1)

[B,ERR,RES]=firpm(20,[0,.4,.5,1],[1 1 0 0]);

RES.fextr;

We observe three ripples in the pass-band of our magnitude plot.  The RES.fextr command shows 12 extremal frequencies:

 

0.0909

0.1875

0.2784

0.3580

0.4000

0.5000

0.5398

0.6193

0.7102

0.8068

0.9034

1.0000

 

Increasing the order produces more ripples both in the pass-band and stop-band, but also decreases their amplitudes. 

 

fvtool(remez(50,[0,.4,.5,1],[1 1 0 0]),1)

 

As we make the transition width greater, we notice fewer ripples and a lower side-lobe height. 

 

fvtool(remez(20,[0,.4,.8,1],[1 1 0 0]),1)

 

Changing the weights alters the emphasis to put on minimizing the error in each band relative to the other bands.  These observations were verified at our own pleasure.

 

fvtool(remez(20,[0,.4,.5,1],[1 1 0.1 0.1],[1 .1]),1)