642 Practical MATLAB® Applications for Engineers
Example 6.16Rerun 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) = 0MATLAB 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.6Multiban filter using fir2 (with bartlett window)Multiban filter using remezMultiban filter using yulewalkfrequency W (in rad)frequency W (in rad)frequency W (in rad)0.7 0.8 0.9 10.5
gaingaingain10
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 110.51.5010.51.50 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1