PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

642 Practical MATLAB® Applications for Engineers


Example 6.16

Rerun Example 6.15 given by the script fi le multiban for the fi lter’s specs given by
a. 0.2 ≤ W ≤ 0.4, H(W) = 0.3
b. 0.6 ≤ W ≤ 0.8, H(W) = 0.6
c. Zero everywhere else, that is,
0 ≤ W < 0.2, H(W) = 0
0.4 < W < 0.6, H(W) = 0
0.8 < W ≤ 1, H(W) = 0

MATLAB Solution
The new fi lter’s specs translate in modifying the frequency–magnitude vectors of the
script fi le multiban as follows:

w = [0 .1 .2 .3 .4 .5 .6 .7 .8 1]
mag = [0 0 .3 .3 0 0 .6 .6 0 0]

The modifi ed script fi le multiban is executed and the resulting plots are shown in
Figure 6.67.

FIGURE 6.66
Multiband fi lter’s plots of Example 6.15.


0
0 0.1 0.2 0.3 0.4 0.5 0.6

Multiban filter using fir2 (with bartlett window)

Multiban filter using remez

Multiban filter using yulewalk

frequency W (in rad)

frequency W (in rad)

frequency W (in rad)

0.7 0.8 0.9 1

0.5
gain

gain

gain

1

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

1

0.5

1.5

0

1

0.5

1.5

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Free download pdf