Transcript DSP

Lecture 8
Convolution
Lecture 8
1
Outline
 Convolution
– linear (DTFT)
– periodic (DFS)
– circular (DFT)
 Circular
convolution theorem
 Example
 Linear convolution using DFT
Lecture 8
2
Linear convolution
For
general x[n],
h[n]

y[n] = x[n]*h[n] =  x[k] h[n-k]
k=-
Important
because the response of a linear time
system to any input x[n] can be represented
in terms of its impulse response h[n]
Lecture 8
3
Linear convolution
FT
x[n] X(e jw)
FT
h[n] H(e jw)
FT
x[n]*h[n] X[e jw] H[e jw]
Lecture 8
4
Periodic convolution
For
~
~
periodic x1[n], x2[n] with period N
DFS ~
~
x1[n] X1[k]
DFS
~
~
x2[n] X2[k]
~
~
~
X3[k] = X1[k] X2[k]
Lecture 8
5
Periodic convolution
DFS
~
x3[n] X3[k]
~
N-1
x3[n] =  x1[m] x2[n-m]
~
~
~
m=0
N-1
DFS
~

x1[m] x2[n-m] X1[k] X2[k]
m=0
~
~
Lecture 8
~
6
Circular convolution
For
finite duration x1[n], x2[n] of length N
N-DFT
x1[n] X1[k]
N-DFT
x2[n] X2[k]
X3[k] = X1[k] X2[k]
The
corresponding periodic sequence are
x1[((n))N] and x2[((n))N]
Lecture 8
7
Circular convolution
N-DFT
x3[n] X3[k]
N-1
x3[n] =  x1[m] x2[((n-m))N] RN[n]
m=0
x3[n] = x1[n]
x [n]
N 2
Lecture 8
8
N-1
X3[k] =
 x3[n]e-j(2p/N) kn,
n=0
N-1
N-1
=
 e-j(2p/N) kn 
x1[m] x2[((n-m))N]
m=0
n=0
N-1
=
0 k N-1
N-1

x1[m]  x2[((n-m))N] e-j(2p/N) kn
m=0
n=0
N-1
=

x1[m] e-j(2p/N) km X2[k]
m=0
Lecture 8
9
N-1
=

x1[m] e-j(2p/N) km X2[k]
m=0
N-1
= X2[k]  x1[m] e-j(2p/N) km
m=0
= X1[k] X2[k]
Lecture 8
10
Circular convolution
N-DFT
x1[n]
x [n] X1[k] X2[k]
N 2
N-DFT 1
N
x1[n] x2[n] X1[k] NX2[k]
Lecture 8
11
x1[n]
Example
1
0.5
0
x2[n]
1
1
0
Let’s
compute x3[n] for N=4
Lecture 8
12
3
x3[n] =  x1[m] x2[((n-m))N]
m=0
x2[((n))N]
1 1
1 1
0
x2[((0-m))N]
1 1
1 1
0
Lecture 8
13
3
x3[n] =  x1[m] x2[((n-m))N]
x1[n]
m=0
1
x2[((0-m))N]
0.5
1
1
x3[0] = 1
0
x2[((1-m))N]
x3[1] = 1.5
0
x2[((2-m))N]
x2[((3-m))N]
x3[2] = 0.5
0
Lecture 8
x3[3] = 0
14
1.5
1
0.5
0
x3[n] = x1[n]
Lecture 8
x [n]
4 2
15
x3[n] for N=2
x1[n]
1
0.5
0
x2[n]
1
1
0
1.5 1.5
x3[n]
0
Lecture 8
16
Let’s
compute X1[k],
X2[k] for N=2
1
X1[k] =
{
 x1[n]e-j(2p/N) kn,
0 k N-1
0,
otherwise
n=0
= 1 + 0.5 e-jpk
1.5
X1[n]
0.5
0
Lecture 8
17
1
X2[k] =
{
 x2[n]e-j(2p/2) kn,
0 k 1
0,
otherwise
n=0
= 1+ 1 e-jpk
2
X2[n]
0
0
Lecture 8
18
X3[k] = X1[k] X2[k]
1.5
X1[n]
0.5
0
2
X2[n]
0
0
3
X3[n]
0
0
Lecture 8
19
1
x3[n]=
{
1
2

X3[k]e j (2p/2)kn, 0 k 1
k=0
0,
= 1.5
otherwise
1.5 1.5
x3[n]
0
Lecture 8
20
Linear convolution
 We
can perform circular convolution as:
– Compute the N-DFT of the two sequences
– Multiply the N-DFT sequences
– Compute the N-IDFT of the result
 This
is efficient because we have very
efficient DFT algorithms
 But the linear convolution is more useful to
us (e.g., to implement an LTI system)
Lecture 8
21
Linear convolution
 Consider
points
x1[n] of L points, and x2[n] of P

x3[n] =  x1[m] x2[n-m]
m=-
 For
n<0 and n>(L+P-2), x3[n]
 Thus
=0
x3[n] is L+P-1 long
Lecture 8
22
x1[n]
L
0
x2[-1-m]
-P
-1 0
x2[n-m]
0
n-P+1
0
n
x2[L+P-1-m]
L
Lecture 8
L+P-1
23
Reminder
N-DFT
N-IDFT
x[n] X[k] 


x[n+rN ]RN[k]
r=-
 That
is, if the sequence is longer than N we
get time aliasing
Lecture 8
24
Linear convolution

x3[n] =  x1[m] x2[n-m]
m=-
X3(e jw) = X2(e jw) X2(e jw)
 If
we sample X3(e jw) at N points we get
X3[k] = X1[k] X2[k]
 What
is the N-IDFT of X3[k] like?
Lecture 8
25
Linear convolution
sequence x3p[n], which is the N-IDFT
of X3[k] is
 The

x3p[n] =

x3[n+rN ]RN[k]
r=-
 That
is, circular convolution is equivalent to
linear convolution followed by time aliasing
 If N  (L+P-1), they are identical
Lecture 8
26
x1[n]
Example
1
0.5
0
x2[n]
1
1
0
x3[n] = x1[n]
x [n]
4 2
1
0.5
0
Lecture 8
27
1.5
1
x3[n]
0.5
0
x3[n-2]+x3[n+2]
1.5
1
0.5
1.5
1
0.5
1.5 1.5
x1[n]
x [n]
2 2
Lecture 8
28
Reading
 Convolution
theorem for DFS and DTFT:
8.2.5, 2.9.6
 Convolution theorem for DFT: 8.7.5
 Linear convolution using DFT: 8.9.1, 8.9.2
Lecture 8
29