You are on page 1of 63

Convolution for CT

and DT
Dr. Ajay Singh Raghuvanshi
Electronics & Telecommunication
Engineering, NIT, Raipur
The Convolution Integral
 Convolution operation given symbol ‘*’

y (t )  xt  * h(t )   x  h t   d


“y” equals “x” convolved with “h”


The Convolution Integral
 The time domain output of an LTI system is
equal to the convolution of the impulse
response of the system with the input signal
 Much simpler relationship between frequency
domain input and output
 First look at graphical interpretation of
convolution integral
Graphical Interpretation of
Convolution Integral
 To correctly understand convolution it is often
easier to think graphically

h(


Graphical Interpretation of
Convolution Integral

h(-

h(


Take impulse response and reverse it in time


Graphical Interpretation of
Convolution Integral
h(-
h(t-

 
t

Then shift it by time t


Graphical Interpretation of
Convolution Integral

h(t-

x(


a t

Overlay input function x(t) and integrate over times where functions
overlap - in this case between a and t
Graphical Interpretation of the
Convolution Integral
 Convolving two functions involves
 flipping or reversing one function in time
 sliding this reversed or flipped function over the
other and
 integrating between the times when BOTH
functions overlap
Example
 Convolution of two gate pulses each of height
1
x1( x2(

0 1  0 2 

y  x1 * x2   x  x t   d

1 2
Example

x2(- x2(

-2 0 2 

Reverse function
Example

x2(- x1(

-1 0 1 

Reverse function, slide x2 over x1 and evaluate integral


Example
x2(t- x1(

for 0  t  1
t
0 1 
y  x1 * x2   1dt  t
0
t

Area of overlap is increasing linearly


Example

x2(t- for 1  t  2
x1(
y  x1 * x2  1
0 1   area of smaller pulse
t-2
t x1 ( )


1
Area of overlap constant
11d   0  1
1

0
Example

x1(

x2(t-
for 2  t  3
0 1  y  x1 * x2  3  t


1
t-2 t 11d   t 2  1  t  2  3  t
2

t 2
Area declining linearly -
width of shaded area = 1-(t-2)=3-t
Example
x1(

x2(t-
for t  3
0 1  y  x1 * x2  0
t

After time t=3 the convolution integral is zero


Example
x1(t)*x2(t)

0 1 2 3 
tint=0; axis([0 10 0 10])
tfinal=10; axis([0 10 0 5])
tstep=.01; t2=2*tint:tstep:2*tfinal;
t=tint:tstep:tfinal; y=conv(x,h)*tstep;
x=5*((t>=0)&(t<=4)); subplot(3,1,3),plot(t2,y)
subplot(3,1,1), plot(t,x) axis([0 10 0 40])
axis([0 10 0 10])
h=3*((t>=0)&(t<=2));
subplot(3,1,2),plot(t,h)
Example 2
 Convolve the following functions
x1(t) x2(t)

1.0

0 1 t 0 1 t
Example 2

x2

-1 0 1 

Reversal
Example 2

x2t

-1 0 t 1 

Shift reversed function


Example 2

x2t x1 for 0  t  1


t
x1 * x2   1dt  t
0
-1 0 t 1 

Overlay shift reversed function onto other function


and integrate overlapping section
Example 2

x1 for 1  t  2
x2t 1
x1 * x2   1dt  2  t
t 1
-1 0 1 t 

t-1
Overlay shift reversed function onto other function
and integrate overlapping section
Example 2
x1(t)*x2(t)

0 1 2
Example 3

Given the impulse response of an LTI system is


h(t )  5e  2t u(t) compute the output of this system
due to an input whic h is a 4 second pulse of height 3.
Example 3
x(t )
2t
5 h(t )  5e u (t )
3

t
0 4
Example 3

5
h( )

Reverse h(
Example 3

h (t   )
t 4 

Shift the reversed h( by t


Example 3

t
 2 t  
5
Output y (t )   3  5e d
h (t   ) 0

t 4 

Performing integral for 0<t<4


Example 3
t t
 2 t  
y (t )   15e d  15e  2t
 e 2
d
0 0
t
 2t  1 2 
 15e 2 e 
 0
 y (t )  7.5 1  e  2t

Example 3

h (t   )

t 4 
4
 2 t  
y(t )   15e d
Performing integral for t>4

0
Example 3

4 4
 2 t  
y (t )   15e d  15e  2t
e
2
d
0 0
4

 15e  2t  1 2   2t
 2 e   7.5e e  1
8
 
0
Example 3

0 t0
y (t )  7.51  e  0  t  4
  2t

7.5e  2t e8  1 t  4

Commutativity of Convolution
Operation
 The actions of flipping and shifting can be
applied to EITHER function

x(t ) * h(t )   x  h t   d


  h xt   d h(t ) * x(t )

Example 4
 Repeat example 3 by flipping and shifting x(t)
rather than h(t)
for 0  t  4
t t
y (t )   3  5e  2 d   15e  2 d
0 0

0 t
Example 4

for 0  t  4

 
t
y (t )   15e  2
d   7.5e  2 t
0
0


y (t )  7.5 1  e 2t 

0 t
Example 4

for t  4
t
y (t )   15e  2
d
t 4

0 t
t-4
Example 4

for t  4
  1  2 
t t

y (t )   15e  2
d  15 e 
t 4 2  t 4
 y (t )  7.5e  2 t  4 
e  2t
  7.5e 8
 1e  2t
Example 4

0 t0
y (t )  7.51  e  0  t  4
  2t

7.5e  2t e8  1 t  4

Same result as before


Numerical Convolution

EE 327
Numerical Convolution
 Numerical evaluation of the convolution
integral
 For difficult-to-solve convolution problems
 We will focus on the Matlab conv function
Discretizing the Time
Convolution Integral

y t    h xt   d


Discretize the Time


t  nT
n  sample value
T  sampling period

y nT    h xnT   d

Break the Integral into Pieces
(T-second intervals)
T 2T
y nT      h xnT   d   h xnT   d
0 T
iT T
  h xnT   d  
iT
 iT T
   h xnT   d
i   iT
Let T be sufficiently small that h xnT   
is relatively constant over T
Then
h   hiT  
 for iT    iT  T
xnT     xnT  iT 
 iT T
y nT     hiT xnT  iT d
i   iT

 iT T
  hiT xnT  iT   d
i   iT

  hiT xnT  iT iT  T  iT 
i  

  T  hiT xnT  iT 
i  

y nT    T  hiT xnT  iT 
i  

In discrete-time notation


yn   T  hi xn  i 
i  
Numerical Convolution in Matlab

 Use conv function


 yy = conv(T*hh,xx);
 yy = conv(hh,T*xx);
Keys to Numerical Convolution
 Convert to discrete time
 The smaller the sampling period, T, the more
exact the solution
 Tradeoff  computation time vs. exactness of
solution
 Remember to account for T in the convolution
 ex. T*hh
Discrete-Time
Convolution

EE 327
Addition Method of Discrete-Time
Convolution
 Produces the same output as the graphical method
 Effectively a “short cut” method

Let x[n] = 0 for all n<N (sample value N is the first non-zero value of x[n]
Let h[n] = 0 for all n<M (sample value M is the first non-zero value of h[n]

 0 for n  M  N
M
 yn  xn hn   xi hn  i 

i  N
for n  M  N

To compute the convolution, use the following array


Discrete-Time Convolution Array
x[N] x[N+1] x[N+2] x[N+3] …
1st row – values of x[n]
h[M] h[M+1] h[M+2] h[M+3] … 2nd row – values of h[n]
Sum down a column

x[N]h[M] x[N+1]h[M] x[N+2]h[M] x[N+3]h[M] …


(1st row) x (1st element of 2nd
x[N]h[M+1] x[N+1]h[M+1] x[N_2]h[M+1] …
row)
(1st row) x (2nd element of 2nd
row)
x[N]h[M+2] x[N+1]h[M+2] … (1st row) x (3rd element of 2nd
row)


+

y[N+M] y[N+M+1] y[N+M+2] y[N+M+3] …

The resulting values in the output sequence


Discrete-Time Convolution Example
Find the output of a system if the input and impulse response are given as follows.

xn   n  1  2 n  3 n  1  4 n  2
hn   n  2  5 n  1  3 n

Solution
Then, N = -1  Index of the first non-zero value of x[n]
M = -2  Index of the first non-zero value of h[n]

Next, write an array


Discrete-Time Convolution Example

1 2 3 4 Coefficients of x[n]

-1 5 3 Coefficients of h[n]

-1 -2 -3 -4 First Row times (-1)

5 10 15 20 First Row times (5)

3 6 9 12 First Row times (3)

-1 3 10 17 29 12 Summation of columns

y[n] = 0 for n < N+M = -3

yn   n  3  3 n  3  10 n  1  17 n  29 n 1  12 n  2


Numerical Convolution Using MATLAB

 Define x[n] and h[n]


 xx = [5 7 -9 10];
 hh = [1 2 3];
 May also be useful to use the zeros and ones
functions (especially for matching up sample
values)
 Use the conv function
 yy = conv(xx,hh);
Methods of Performing Convolution

Direct Evaluation Method


Graphical Method
Sliding Scale Method
Tabular Method
Transformation Method

14-10-2018 Dr. Ajay Singh Raghuvanshi 55


Direct Evaluation Method utilize these closed form series expansion expression to
directly evaluate convolution summation We may explain with Example

14-10-2018 Dr. Ajay Singh Raghuvanshi 56


14-10-2018 Dr. Ajay Singh Raghuvanshi 57
Example :
Find Convolution sum of following Sequence

1 1  n  3
xn   hn  1, 2, 3
  
0 0  n  3

14-10-2018 Dr. Ajay Singh Raghuvanshi 58


14-10-2018 Dr. Ajay Singh Raghuvanshi 59
14-10-2018 Dr. Ajay Singh Raghuvanshi 60
14-10-2018 Dr. Ajay Singh Raghuvanshi 61
Transform Method
 Take Z-transform of Sequences say X(z) and
H(z)
 Find X(z) H(z)
 Inverse transform to get Convolution

14-10-2018 Dr. Ajay Singh Raghuvanshi 62


Assignment No.5

Problem No.1

Problem No.2

Problem No.3

14-10-2018 Dr. Ajay Singh Raghuvanshi 63

You might also like