You are on page 1of 2

24.

378 Signal Processing I


Laboratory 2
Part I:
Please answer the following questions regarding convolutions. Use at home the application that performs graphical
convolution of continuous-time signals that can be found in:
http://www.jhu.edu/~signals/convolve/index.html
Discuss your results with your group during the lab. If you disagree and need to confirm your answers, use Matlab
and create simple discrete signals and use the command conv to reach an agreement between the members of your
team.
1.1 If h(t) is a unit-step function and x(t) is a ramp (slope of one), then the output y(t) will be a
a) step function b) ramp function c) triangular pulse d) quadratic function
Please use the convolution formula and calculate y(t). Assume infinite length signals and the ramp starts at zero
1.2 If the unit-impulse response of an LTI system and the input signal both are rectangular pulses, then the response
will be a:
a) rectangular pulse b) triangular pulse c) ramp function d) none of the above
1.3 If an input signal is applied to two LTI systems with respective unit-impulse responses h(t) and 3h(t-2), then the
response of the second system is the response of the first:
a) amplitude scaled by 3 and delayed by 2 b) amplitude scaled by 3 and advanced by 2 c) amplitude scaled
by 3 d) none of the above
1.4 If h(t) = 2sin(wt)u(t), where u(t) is the unit-step function, and w is large, then the behaviour of the system is such
that:
a) low frequency input signals are amplified, b) high frequency signals are amplified c) low frequency
input signals are attenuated, c) the response to a unit-step input is identically zero
1.5 If x(t) = h(-t), then
a) y(t) = 2h(t) b) y(t) = y(-t) c) y(t) = - y(-t) d) the largest value of y(t) occurs at t = 0
1.6 The impulse response of two systems is given by rectangular pulses of length a and b respectively: h1(t) = u(t)
u(t-a), h2(t) = u(t) u(t-b). If a is very small (a percentage of the wavelength of a sinusoid) and b is considerably
large (few times the wavelength of same sinusoid), then:
a) h1(t) attenuates high frequency signals more than h2(t). b) h2(t) attenuates high frequency signals more
than h1(t). c) Attenuation is the same for both systems regardless of a and b. d) None of the above.
Part II:
(a) Recall: Using Convolution to Remove Multipath Distortion.
Create in Matlab a vector of 100 samples with value zero. Then change the value of the first 10 samples to
1. This will be a rectangular pulse and your signal of interest.
Change the values between 50 to 59 to 0.5. This will be your echo of the rectangular pulse delayed by 50 or
49 samples - depending on your Matlab implementation, with an attenuation of 0.5. Plot both vectors and
verify your delay and amplitude distortion. Hint: you can use the plot(x,o) command to plot a vector x and
verify that the there are the same number of samples in the original pulse and the echo pulse.

Create a filter as:

hi (t ) = ( ) k (t ktd ) , where td is the delay and is


k =0

the attenuation value. To perform convolutions use the conv command.


Do you have better results as you increase N. Explain.
You were given the values of td and . In a more real scenario, you may not know this. Use your filter with
different values of td and and see the results.
Having seen the results above, would you say that computing the energy of the output of your filter given
by: energy =

y (t ) 2 dt for different values of td and can be a way to determine these parameters?

Compute the energy of y(t) which in discrete time can be approximated in Matlab as sum(y.^2) for different
delay and attenuation values. Would you find the minimum or maximum energy at the correct values?
Which parameter (delay or attenuation) is more accurate? Plot the energies for these different values using
the mesh command. You will have a 2D matrix at that time with the x axis indicating the delay values and y
axis indicating the attenuation values (or vice versa depending on your implementation).

(b)
You are given an audio file which name is echo2.wav. You can read the signal within Matlab by using the
command: wavread which inputs the samples as well as the sampling frequency. In order to determine the
delay value, compute the auto-correlation. You have two options for doing this, use the command xcorr or use the
conv command. If you use the convolution command, what do you need to do in order to have the same result as
using xcorr? What is the value of td? Assume that td is a number rounded by the hundreds.
Hint: Start with a simple signal, lets say
x = [0 0 0 2 3 1 0 0 0 0 0 1 1.5 0.5 0 0 0 0];
Plot it using the stem command. These samples contain an original signal
and its repetition separated by 8 samples (that is N = 8). How does the
cross-correlation looks like? How many peaks do you see and why? What is
the distance between these peaks?
(c)

Given that = 0.5, use a similar filter as in part (a) and try to eliminate the echo.

You might also like