Problems 705
11.15. IIR comb filters—MATLAB
Consider a filter with transfer function
H(z)=K
1 +z−^4
1 +( 1 / 16 )z−^4
(a) Find the gainKso that this filter has a unit dc gain. Use then MATLAB to find and plot the magnitude
response ofH(z)and its poles and zeros. Indicate why it is called a comb filter.
(b) Use MATLAB to find the phase response of the filterH(z). Why is it that the phase seems to be
wrapped and it cannot be unwrapped by MATLAB?
(c) Suppose you wish to obtain an IIR comb filter that is sharper around the notches ofH(z)and flatter in
between notches. Implement such a filter using the functionbutterto obtain two notch filters of order
10 and appropriate cut-off frequencies. Decide how to connect the two filters. Plot the magnitude and
the phase of the resulting filter and its poles and zeros.
11.16. Three-band discrete spectrum analyzer—MATLAB
To design a three-band discrete spectrum analyzer for speech signals, we need to design a low-pass, a
band-pass, and a high-pass filter. Let the sampling frequency beFs= 10 KHz. Consider the three bands,
in KHz, to be[0 Fs/4],(Fs/4 3Fs/8], and( 3 Fs/ 8 Fs/2]. Let all the filters be of orderN= 4 , and choose
the cut-off frequencies so that the sum of the three filters is approximately an all-pass filter of unit gain.
11.17. FIR filter design with different windows
Design a low-pass FIR digital filter withN= 21. The desired response of the filter is
|Hd(ejwT)|=
{
1 0 ≤f≤ 250 Hz
0 elsewhere in 0 ≤f≤(fs/ 2 )
whereω= 2 πf/fsand the phase is zero for all frequencies. The sampling frequency isfs= 2000 Hz.
(a) Use a rectangular window in your design. Plot the magnitude and the phase of the designed filter.
(b) Use a triangular window in the design and compare the magnitude and the phase plots of this filter
with those obtained in (a).
11.18. FIR filter design—MATLAB
Design an FIR low-pass filter with a cut-off frequency ofπ/ 3 and lengthsN= 21 and thenN= 81 :
(a) Using a rectangular window.
(b) Use MATLAB to design the filter using the rectangular, Hamming, and Kaiser windows, and compare
the magnitude of the resulting filters.
11.19. Modulation property transformation for IIR filters—MATLAB
The modulation-based frequency transformation is applicable to IIR filters. It is obvious in the case of FIR
filters, but requires a few more steps in the case of IIR filters. In fact, if we have that the transfer function
of the prototype IIR low-pass filter isH(z)=B(z)/A(z), with impulse responseh[n], let the transformed
filter beHˆ(z)=Z( 2 h[n] cos(ωon)for some frequencyω 0.
(a) Find the transfer functionHˆ(z)in terms ofH(z).
(b) Consider an IIR low-pass filter
H(z)=
1
1 −0.5z−^1
Ifω 0 =π/ 2 , determineHˆ(z).
(c) How would you obtain a high-pass filter fromH(z)given in the previous item? Use MATLAB to plot
the resulting filters here and in the past item.