You are on page 1of 3

Music 421 Spring 2004-2005 Homework #6 Spectral Smoothing, Window Method 48 points Due in one week (5/18/2005)

1. (5 pts) Derive the ideal impulse response corresponding to the desired amplitude re- sponse

H(e jωT ) =

1,

0,

0 ω 1 ≤ |ω| ≤ ω 2 π/T

otherwise

[Hint: Use a Fourier theorem to make use of the result given for the ideal lowpass ﬁlter in the lecture overheads and/or text.]

2. (10 pts) For the ideal bandpass ﬁlter of the previous problem, with ω 1 T = ω 2 T = π/2 (i.e., the pass-band width is zero), design a length M = 100 real FIR bandpass ﬁlter using the window method. Deﬁne the transition bandwidth to be the width of the main lobe for the window used. Plot an overlay of the ideal and obtained amplitude responses (in dB) for the following window types (please group appropriately to save paper) :

Hamming

Kaiser with β set to give a worst-case stopband rejection of 42 dB

Hann

Kaiser with β set to give 31 dB stopband rejection

Blackman

Kaiser with β set to give 58 dB stopband rejection

Kaiser with β = 10

Describe how the results for the ﬁrst three Kaiser windows compare with those for the respective ﬁrst three Blackman-Harris windows. What stopband rejection does β = 10 yield? In general, how does the stop-band rejection compare to the side-lobe level of the window functions used?

3. (10 pts) For ω c T = π/2, design a length M = 100 real FIR lowpass ﬁlter using the window method. Plot the amplitude response (dB gain versus frequency) for the following windows:

Hamming

Hann

Blackman

1

Impulse response 1
0.8
0.6
0.4
0.2
0
−0.2
−0.4
−50
−40
−30
−20
−10
0
10
20
30
40
50
amplitude

time (samples)

Magnitude Spectrum 0
−20
−40
−60
−80
0
0.5
1
1.5
2
2.5
3
amplitude (dB)

Figure 1: Impulse response of a lowpass ﬁlter and its magnitude spectrum

Kaiser with β = 10

Explain why the stopband rejection is so diﬀerent from that in the previous problem.

4. (13 pts) Download the sound ﬁle noisypeaches.wav 1 containing speech embedded in white noise.

 (a) (5 pts) Plot the spectrogram of noisypeaches.wav to help you understand its spectral content but there is no need to submit it. Design a low pass ﬁlter using the window method with a Kaiser window of length 100 and β=10. The cut-oﬀ frequency of the ﬁlter should be 4 kHz. Plot its impulse response and magnitude of frequency response. (b) (3 pts) Apply this ﬁlter to the noisy speech signal either by the FFT method of simple ﬁltering. Listen and describe the result compared to the original. (c) (5 pts) Now downsample the original noisy speech signal by a factor of two by simply throwing away every other sample. Listen to the result and compare it to the original higher sampling rate. Repeat the same downsampling scheme on the lowpass ﬁltered speech signal and again, compare with its higher sampling rate version. Why does the latter pair (lowpass ﬁltered) sound more similar than the ﬁrst pair (unﬁltered)?

5. (5 pts) Figure 1 shows the impulse response and the corresponding magnitude spectrum of a lowpass ﬁlter.

(a) (3 pts) Without using MATLAB, sketch the magnitude spectrum of the impulse response shown in Figure 2, which was obtained from that in Fig. 1 by negating the odd-numbered samples. Explain how you obtained your answer.

1 http://www-ccrma.stanford.edu/˜jos/hw421/hw6/noisypeaches.wav

2 1
0.8
0.6
0.4
0.2
0
−0.2
−0.4
−0.6
−0.8
−1
−50
−40
−30
−20
−10
0
10
20
30
40
50

Figure 2: Impulse response

(b) (2 pts) Verify your answer by plotting the magnitude spectrum of the above impulse response using MATLAB. You can download a mat ﬁle ir.mat 2 which contains an impulse response vector h(n) shown in Fig. 2.

6. (5 pts) Design a real, linear-phase, FIR bandpass ﬁlter using remez() in Matlab with the following speciﬁcations: Sampling rate f s = 100 Hz, pass-band from 20 Hz to 30 Hz, stop-band from 0 to 10 Hz and 40 to 50 Hz, δ s = 0.01 (40 dB) ripple in the stop-band, and δ p = 0.02 ripple in the pass-band, which is unity gain. The ﬁlter thus has transition bands from 10 to 20 Hz, and from 30 to 40 Hz. Turn in a listing of your Matlab code, and the result of its execution (e.g., using the diary command), which should include a print-out of the ﬁlter length, a listing of the ﬁlter coeﬃcients, and a plot of the ﬁlter amplitude response on a dB vertical scale. [Hint: Start with ’help remezord’ in Matlab.]

2 http://ccrma.stanford.edu/˜jos/hw421/hw6/ir.mat

3