Calculate the overall impulse response of the cascaded echo system, Eq. (1), and echo removal system, Eq. (2), by convolving he with her and store the result in hoa. Plot the overall impulse response. You should notice that the result is not a unit impulse. Given that you have computed her to be the inverse of he, why is this the case?
NOTE:
a = [0.5, 1];
b = 1;
% he
sys = tf(b, a);
he = impulse(sys, 46);
d = [1;
zeros(1, 4000)];
Z = filter(b, a, d);
% her
her = impulse(Z, 4000);
NOTE:
In this exercise, you will consider the problem of removing an echo from a recording of a speech signal. This exercise will use the audio capabilities of MATLAB to play recordings of both the original speech and the result of your processing. To begin this exercise, you will need to load the speech file lineup.mat. If this speech file is already somewhere in your MATLABPATH, then you can load the data into MATLAB by typing >> load lineup.mat. You can check your MATLABPATH, which is a list of all the directories that are currently accessible by MATLAB, by typing path. The file lineup.mat must be in one of these directories. Once you have loaded the data into MATLAB, the speech waveform will be stored in the variable y. Since the speech was recorded with a sampling rate of 8192 Hz, you can hear the speech by typing sound(y, 8192). You should hear the phrase "line up" with an echo. The signal y[n], represented by the vector y, is of the form y[n] = z[n] + a * x[n - N] (Eq. 1) where x[n] is the uncorrupted speech signal, which has been delayed by N samples and added back in with its amplitude decreased by a < 1. This is a reasonable model for an echo resulting from the signal reflecting off of an absorbing surface like a wall. If a microphone is placed in the center of a room, and a person is speaking at one end of the room, the recording will contain the speech which travels directly to the microphone, as well as an echo which traveled across the room, reflected off of the far wall, and then into the microphone. Since the echo must travel further, it will be delayed in time. Also, since the speech is partially absorbed by the wall, it will be decreased in amplitude. For simplicity, ignore any further reflections or other sources of echo. For the problems in this exercise, you will use the value of the echo time, N = 1000, and the echo amplitude, a = 0.5. Consider an echo removal system described by the difference equation z[n] + a * z[n - N] = y[n] (Eq. 2)