<< Chapter < Page | Chapter >> Page > |
This integral defines the convolution operator and provides a way of finding the output of any linear system, given its impulse response and the input .
M
atlab has several functions that simplify the numerical
evaluation of convolutions. The most obvious of these is
conv
, which is
used in
convolex.m
to calculate the convolution
of an input
x
(consisting of two delta functions at times
and
) and a system with impulse response
h
that is an exponential pulse. The convolution gives
the output of the system.
Ts=1/100; time=10; % sampling interval and total time
t=0:Ts:time; % create time vectorh=exp(-t); % define impulse response
x=zeros(size(t)); % input is sum of two delta functions...x(1/Ts)=3; x(3/Ts)=2; % ...at times t=1 and t=3
y=conv(h,x); % do convolution and plotsubplot(3,1,1), plot(t,x)
subplot(3,1,2), plot(t,h)subplot(3,1,3), plot(t,y(1:length(t)))
convolex.m
example of numerical convolution
(download file)
[link] shows the input to the system in the top plot,the impulse response in the middle plot, and the output of the system in the bottom plot. Nothing happens before time , and the output is zero. When the first spike occurs,the system responds by jumping to 3 and then decaying slowly at a rate dictated by the shape of . The decay continues smoothly until time , when the second spike enters. At this point, the output jumps up by 2, andis the sum of the response to the second spike, plus the remainder of the response to the first spike. Since there are no more inputs,the output slowly dies away.
Suppose that a system has an impulse response that is an exponential pulse.
Mimic the code in
convolex.m
to find its output
when the input is a white noise (recall
specnoise.m
).
Mimic the code in
convolex.m
to find the output of
a system when the input is an exponential pulse and theimpulse response is a sum of two delta functions at times
and
.
The next two problems show that linear filters commute with differentiation, and with each other.
Use the definition to show that convolution is commutative (i.e., that ). Hint: Apply the change of variables in [link] .
Let be the rectangular pulse of [link] . What is ? Hint: A pulse shaped like a triangle.
Redo Exercise
[link] numerically by suitably modifying
convolex.m
. Let
seconds.
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?