**Homework Assignment 14 **

Due Dec. 8, 2004

- Problem 7.15 (a) (b). Do these by hand.
- Problem 7.15 (a) (b) (c) (d). Do these by ifft(fft(x).*fft(v)). Show that (a) and (b) agree with the hand calculations.
- Problem 7.21. Do signals (i), (ii), (iii), (vi)
- Problem 7.29 (a) (b) (c)
- Download the sound file falling.wav. Read the
file into MATLAB with the command

**x = wavread('falling.wav');**

The data is recorded at an 8 kHz rate. Make a time vector t with the command

**t = (0:length(x)-1)/8000;**- Plot the sound signal x vs the time vector t.
- As in problem 7.21 (a) of the text, find the unit pulse response
*h*of an ideal lowpass filter which has a cutoff frequency of 400 Hz. (First find the discrete-time frequency which corresponds to 400 Hz. Note the the discrete time frequency 2 π corresponds to the continuous time sampling frequency 8 kHz.)_{lp}[n] - Let
*hd*be the sequence_{lp}*h*for_{lp}[n]*n = -100 to 100*. Use a*stem*plot to plot*hd*._{lp} - Let
**N = length(x) + length(hd)**. Plot the magnitude of the N-point DFT of*hd*vs. continuous-time frequency. Verify that this filter will pass low frequencies and block high frequencies._{lp} - To find the output of the filter, let
*x*be the linear convolution of_{lp}*x*and*hd*. (To do the linear convolution in MATLAB, take the inverse DFT of the N-point DFT of_{lp}*x*times the N-point DFT of*hd*.)_{lp} - Take the N-point DFT of x using the MATLAB FFT command. Plot the magnitude of the DFT vs. the continuous time frequency.
- Plot the magnitude of the N-point DFT of
*x*. Verify that the low frequencies are gone._{lp} - Repeat (b), (c), (d), (e) and (g) to find
*x*using a high-pass filter with a cutoff frequency of 400 Hz. Note: Once you have_{hp}*h*, it is very easy to find_{lp}[n]*h*. Just use the fact that_{hp}[n]*H*._{hp}(Ω) = 1 - H_{lp}(Ω) - Save your output sounds using the MATLAB
**wavewrite**command:

**wavwrite(xlp,'falling_low.wav');**

**wavwrite(xhp,'falling_high.wav');**

Listen to the three sound files. Did the filters separate the low-frequency sounds from the high-frequency sounds? - If you want to, listen to the effects of the above filters on some of your favorite music.