0% found this document useful (0 votes)
109 views10 pages

Laboratory 5 - The Convolution Integral

This document provides instructions for students on completing tasks involving continuous-time convolution integrals in MATLAB. It introduces key concepts like the unit step function u(t), unit impulse function δ(t), and defines the continuous-time convolution integral. The document contains 3 tasks that require students to evaluate different convolution integrals, write MATLAB code to calculate and plot the results, and paste their code and figures into the document.

Uploaded by

Osama Alqahtani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views10 pages

Laboratory 5 - The Convolution Integral

This document provides instructions for students on completing tasks involving continuous-time convolution integrals in MATLAB. It introduces key concepts like the unit step function u(t), unit impulse function δ(t), and defines the continuous-time convolution integral. The document contains 3 tasks that require students to evaluate different convolution integrals, write MATLAB code to calculate and plot the results, and paste their code and figures into the document.

Uploaded by

Osama Alqahtani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Laboratory 5 - LTI Systems 1 - The

Convolution Integral
Signals and Systems
Department of Computer Engineering
College of Computer and Information Sciences
King Saud University
Student Name:

Student ID:

Instructions

1. Read this document before coming to the laboratory.

2. Print this document and bring it with you to the laboratory.

3. Mobile phones are not allowed.

4. Do not copy paste the code - type it.

5. Use only the front side of the sheets.

Marking Scheme

Task Points Obtained


1 20
2 40
3 40
Total 100

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.

Figure 1: u(t) using heaviside

An important difference from our definition of u(t), in Matlab given by


heaviside, is that heaviside(0) = 0.5 and u(t), according to our definition,
is discontinuous at t = 0.
Usually, for practical systems the value of u(t) at t=0 has insignificant impact
on the performance of the system. We will not be considering instantaneous
response of the system for the rest of this Laboratory. This leads us to the
second way of specifying u(t).

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.

5.2 Continuous-time unit impulse function


The derivative of u(t) with respect to t gives the unit impulse function, δ(t).
This can be calculated using symbolic variables. The following piece of code
will perform the differentiation of u(t) with respect to t. The response or
ans is dirac(t), δ(t).

clear all
close all
syms t
u=heaviside(t);
diff(u,t)

The continuous-time unit impulse function is considered to be an idealiza-


tion. It is defined in Matlab by the following equation
(
∞, t = 0
δ(t) =
0, t 6= 0
We can plot δ(t) using the following code

clear all
close all
t=-5:0.01:5;
imp=dirac(t);
plot(t,imp);

Figure 2 shows the plot of δ(t), note the discontinuity at t = 0.

4
Figure 2: δ(t)

For practical purposes, we need to associate a value to δ(t), at t = 0. The


following script allows us to equate 1 to δ(0), δ(0) = 1. The resulting plot is
shown in Figure 3.

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)

5.3 Continuous-time convolution integral of LTI sys-


tems
The symbolic representation of two continuous-time signals x(t) and h(t) is
given by

y(t) = x(t) ∗ h(t) (1)


This is calculated through the convolution integral, given by the following
equation
Z ∞
y(t) = x(τ )h(t − τ )dτ (2)
−∞

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).

Convolution is calculated and the result is stored in the variable y. The


result of convolution is shown in the third subplot. Note how y(t) suddenly
starts to drop after t = 10. This happens because we have limited x(t) and
h(t) in the range 0 ≤ t ≤ 10. The forth subplot is considered as the correct
result in the range 0 ≤ t ≤ 10. The resulting plot is shown in Figure 4.

Figure 4: Convolution of x(t) = e−2t u(t) and h(t) = u(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

You might also like