Laboratory 5 - The Convolution Integral
Laboratory 5 - The Convolution Integral
Convolution Integral
Signals and Systems
Department of Computer Engineering
College of Computer and Information Sciences
King Saud University
Student Name:
Student ID:
Instructions
Marking Scheme
1
Laboratory 5 - LTI Systems 1 - The
Convolution Integral
Contents
5.1 Continuous-time unit step function . . . . . . . . . . . . . . . 3
5.2 Continuous-time unit impulse function . . . . . . . . . . . . . 4
5.3 Continuous-time convolution integral of LTI systems . . . . . 6
5.4 Student Task 1 - Continuous-time convolution using heaviside 8
5.5 Student Task 2 - Continuous-time convolution without heaviside 9
5.6 Student Task 3 - Continuous-time convolution . . . . . . . . . 10
2
5.1 Continuous-time unit step function
The continuous-time
( unit step function is given by
0, t < 0
u(t) =
1, t > 0
There are several ways of specifying u(t). We will consider two of the most
widely used methods of dealing with u(t). The first uses the built-in function
heaviside.
clear all
close all
t=-5:0.01:5;
u=heaviside(t);
plot(t,u);
The plot of u(t) using heaviside is shown in Figure 1.
clear all
3
close all
t=-5:0.01:5;
u=1*((t>=0)&(t<=5));
plot(t,u);
This specification of u(t) is limited by time t. The plot is similar to the plot
shown in Figure 1.
clear all
close all
syms t
u=heaviside(t);
diff(u,t)
clear all
close all
t=-5:0.01:5;
imp=dirac(t);
plot(t,imp);
4
Figure 2: δ(t)
clear all
close all
t=-5:0.01:5;
imp=zeros(size(t));
imp(ceil(size(t,2)/2))=1;
plot(t,imp);
5
Figure 3: Practical δ(t)
Let us evaluate the convolution of x(t) = e−2t u(t) and h(t) = u(t). This can
be done through the following code
clear all
close all
t=0:0.01:10;
x=exp(-2*t).*((t>=0)&(t<=10));
subplot(4,1,1), plot(t,x)
axis([0 12 0 2])
h=1*((t>=0)&(t<=10));
subplot(4,1,2),plot(t,h)
axis([0 12 0 2])
t2=0:0.01:20;
6
y=conv(x,h)*0.01;
subplot(4,1,3),plot(t2,y)
axis([0 20 0 2])
subplot(4,1,4),plot(t2,y)
axis([0 10 0 1])
We start time t from 0 to 10 with a step size of 0.01. x(t) is coded and plotted
in the first subplot. Although x(t) starts at 0 and goes to ∞, we have limited
the signal to the range of 0 to 10. h(t) is similarly coded and shown in the
second subplot. t2 is defined as twice the length of t as the length of y(t) is
larger than x(t) and h(t).
7
5.4 Student Task 1 - Continuous-time convolution us-
ing heaviside
Task 1. Evaluate the convolution of x(t) = e−2t u(t) and h(t) = u(t) using
heaviside. Add appropriate label(s) and title(s). Write the code, print and
paste the figure(s) here.
8
5.5 Student Task 2 - Continuous-time convolution with-
out heaviside
Task 2. Evaluate the convolution of x(t) = e2t u(−t) and h(t) = e−2t u(t)
without using heaviside. Add appropriate label(s) and title(s). Write the
code, print and paste the figure(s) here.
9
5.6 Student Task 3 - Continuous-time convolution
Task 3. Evaluate the convolution of x(t) = e2t u(−t) and h(t) = u(t − 3).
Add appropriate label(s) and title(s). Write the code, print and paste the
figure(s) here.
10