Lecture 6 Convolution Using DFT
Lecture 6 Convolution Using DFT
Dheeraj Kumar
dheeraj.kumar@ece.iitr.ac.in
February 6, 2023
Table of Contents
1 Circular convolution
2 / 38
Table of Contents
1 Circular convolution
3 / 38
Circular convolution
4 / 38
Circular convolution
N−1
X N−1
X
x3 [n] = x̃1 [m]x̃2 [n − m] = x1 [((m))N ]x2 [((n − m))N ]
m=0 m=0
N−1
X
= x1 [m]x2 [((n − m))N ]
m=0
Since X1 [k ]X2 [k ] =
= x1 [n]⃝x
N 2 [n] = x2 [n]⃝x
N 1 [n]
X2 [k ]X1 [k ]
N−1
X
= x2 [m]x1 [((n − m))N ]
m=0
0,
0 ≤ n < n0
❑ Let x1 [n] = δ[n − n0 ] = 1, n = n0
0, n0 < n ≤ N − 1
❑ Where, 0 < n0 < N
❑ x2 [n] be an arbitrary sequence of length N
6 / 38
Example: circular convolution with a delayed
impulse sequence
7 / 38
Example: circular convolution of two rectangular
pulses
(
1, 0 ≤ n ≤ L − 1
❑ Let x1 [n] = x2 [n] =
0, L ≤ n ≤ N − 1
❑ If L = N, the N-point DFTs are:(
N, k = 0
X1 [k ] = X2 [k ] = N−1 kn
P
n=0 WN =
0, otherwise
(
N 2, k = 0
❑ X3 [k ] = X1 [k ]X2 [k ] =
0, otherwise
❑ → x3 [n] = N, 0 ≤ n ≤ N − 1
8 / 38
Example: circular convolution of two rectangular
pulses
1−WNLk
❑ If N = 2L, the N-point DFTs are: X1 [k ] = X2 [k ] = 1−WNk
!2
1−WNLk
❑ DFT of triangular-shaped sequence x3 [n] is X3 [k ] = 1−WNk
9 / 38
Circular convolution and duality
DF T
❑ x1 [n]⃝x
N 2 [n] ←→ X1 [k ]X2 [k ]
DF T 1 1 PN−1
❑ x1 [n]x2 [n] ←→ N X1 [k ]⃝X2 [k ]
N = N l=0 X1 [l]X2 [((k − l))N ]
10 / 38
Table of Contents
1 Circular convolution
11 / 38
How to compute linear convolution using DFT
X3 [k ]
❑ To obtain a linear convolution x1 [n] ∗ x2 [n], we must ensure that
circular convolution has the effect of linear convolution
❑ By manipulating N
❑ But, why to use this procedure to obtain linear convolution?
❑ Why not directly compute using expression of linear convolution
❑ Efficient algorithms are available for computing DFT of a
finite-duration sequence
❑ Collectively as fast Fourier transform (FFT) algorithms
12 / 38
Linear convolution of two finite-length sequences
13 / 38
Circular convolution as linear convolution with
aliasing
14 / 38
Circular convolution as linear convolution with
aliasing
15 / 38
Circular convolution as linear convolution with
aliasing
P∞
❑ For x3 [n] = x1 [n] ∗ x2 [n] = m=−∞ x1 [m]x2 [n − m]
jω jω jω
❑ X3 (e ) = X1 (e )X2 (e )
❑ N-point DFT of x3 [n]:
2πk 2πk 2πk
❑ X3 [k ] = X3 (ej N ) = X1 (ej N )X2 (ej N ) = X1 [k ]X2 [k ], 0 ≤ k ≤ N − 1
❑ Sequence resulting as the inverse DFT of X3 [k ] is:
(P
∞
r =−∞x3 [n − rN], 0 ≤ n ≤ N − 1
❑ x3p [n] = = x1 [n]⃝x
N 2 [n]
0, otherwise
❑ Circular convolution of two finite-length sequences is equivalent to
their linear convolution, followed by time aliasing
16 / 38
Circular convolution as linear convolution with
aliasing
17 / 38
Example: Linear convolution of two rectangular
pulses
( (
1, 0≤n ≤L−1 1, 0 ≤ n ≤ P − 1
❑ Let x1 [n] = and x2 [n] =
0, otherwise 0, otherwise
❑ L=P=6
18 / 38
Example: Linear convolution of two rectangular
pulses
19 / 38
Example: Linear convolution of two rectangular
pulses
20 / 38
Example: Linear convolution of two rectangular
pulses
21 / 38
Example: Linear convolution of two sequences of
different lengths
22 / 38
Example: Linear convolution of two sequences of
different lengths
❑ L-point circular
(
convolution:
P∞
x1 [n]⃝x
L 2 [n] =
r =−∞ x3 [n − rL], 0 ≤ n ≤ L − 1
❑ x3p [n] =
0, otherwise
❑ For 0 ≤ n ≤ L − 1, x3p [n] is influenced only by x3 [n] and x3 [n + L]
23 / 38
Example: Linear convolution of two sequences of
different lengths
❑ For P < L only the term x3 [n + L] will alias into the interval
0≤n ≤L−1
❑ Last P − 1 points of x3 [n + L] (extending from n = 0 to n = P − 2),
will be added to the first P − 1 points of x3 [n]
❑ Last P − 1 points of x3 [n] extending from n = L to n = L + P − 2 will
be discarded
❑ Since the last P − 1 points of x3 [n + L] and the last P − 1 points of
x3 [n] are identical
❑ Take the P − 1 values of x3 [n] from n = L to L + P − 2 and add them
to the first P − 1 values of x3 [n]
❑ Remaining points from n = P − 1 to L − 1 (i.e., the last L − P + 1
points) are not corrupted
24 / 38
Example: Linear convolution of two sequences of
different lengths
❑ Here, P = 4 and L = 8
25 / 38
Example: Linear convolution of two sequences of
different lengths
26 / 38
Table of Contents
1 Circular convolution
27 / 38
Output of an LTI system for finite-length input
28 / 38
Output of an LTI system for infinite-length input
29 / 38
Example: Block convolution
30 / 38
Example: Block convolution
31 / 38
Example: Block convolution
32 / 38
Example: Block convolution
33 / 38
Alternative approach: Overlap-save
34 / 38
Alternative approach: Overlap-save
35 / 38
Alternative approach: Overlap-save
36 / 38
Alternative approach: Overlap-save
37 / 38
Thanks.