Sunteți pe pagina 1din 49

UNIT - 2: Properties of Discrete Fourier Transforms

(DFT)[?, ?, ?, ?]

Dr. Manjunatha. P
manjup.jnnce@gmail.com

Professor
Dept. of ECE

J.N.N. College of Engineering, Shimoga

September 14, 2014


DSP Syllabus Introduction

Digital Signal Processing: Introduction [?, ?, ?, ?]

Slides are prepared to use in class room purpose, may be used as a


reference material
All the slides are prepared based on the reference material
Most of the figures/content used in this material are redrawn, some
of the figures/pictures are downloaded from the Internet.
This material is not for commercial purpose.
This material is prepared based on Digital Signal Processing for
ECE/TCE course as per Visvesvaraya Technological University (VTU)
syllabus (Karnataka State, India).

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?, ?]
14, 2014 2 / 49
DSP Syllabus

DSP Syllabus

PART - A

UNIT - 2: Properties of Discrete Fourier Transforms (DFT)


Properties of DFT.
Multiplication of two DFTs- the circular convolution.
Additional DFT properties
Use of DFT in linear filtering,
Overlap-save and overlap-add method. 7 Hours

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?, ?]
14, 2014 3 / 49
Properties of Discrete Fourier Transform (DFT)

Properties of Discrete Fourier Transform (DFT)

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?, ?]
14, 2014 4 / 49
Properties of Discrete Fourier Transform (DFT)

Periodicity
DFT
x(n) ↔ X (k)
if
x(n + N) = x(n)
Then
X (k + N) = X (k)
N−1
X 2π kn
X (k) = x(n)e −j N

n=0

N−1 N−1
X 2π (k+N)n X 2π kn
X (k + N) = x(n)e −j N = x(n)e −j2πn e −j N

n=0 n=0

N−1
X 2π kn
X (k + N) = x(n)e −j N = X (k) since e −j2πn = 1
n=0

Hence we note that X(k+N) = X(k)


This tells us that DFT is periodic with period N. This is known as the cyclical property of
DFT.

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?, ?]
14, 2014 5 / 49
Properties of Discrete Fourier Transform (DFT)

Linearity
DFT
x1 (n) ↔ X1 (k)
DFT
x2 (n) ↔ X2 (k)

DFT
ax1 (n) + bx2 (n) ↔ aX1 (k) + bX2 (k)

Proof

N−1
X
X (k) = ax1 (n) + bx2 (n)WNkn
n=0
N−1
X N−1
X
= ax1 (n)WNkn + bx2 (n)WNkn
n=0 n=0
= aX1 (k) + bX2 (k)

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?, ?]
14, 2014 6 / 49
Properties of Discrete Fourier Transform (DFT)

Circular Symmetries Of a Sequence


Consider sequence x(n) and its DFT is X(K). When IDFT taken it get periodic sequence xp (n)

X
xp (n) = x(n − lN)
l=−∞

x(n) and xp (n) are related by



xp (n) for 0 ≤ n ≤ N − 1
x(n) =
0 otherwise
0
let xp (n) shifted by k units to the right then xp (n)

0
xp (n) = xp (n − k)

X
= x(n − k − lN)
l=−∞
 0
0 xp (n) for 0 ≤ n ≤ N − 1
x (n) =
0 otherwise

0
x (n) = x(n − k − lN)
= x(n − k, modulo N)
= x((n − k))N

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?, ?]
14, 2014 7 / 49
Properties of Discrete Fourier Transform (DFT)

x ( n)
0≤n≤3
5
4 The sequence
x(n)

Amplitude
2

0 1 2 3 n

Amplitude
xp (n)
The sequence
x(n)
5 5 5
4 4 4
3 3 3
2 2 2

-4 -3 -2 -1 0 1 2 3 4 5 6 7 n

Amplitude
x 'p (n) = x p (n − 2)
The sequence
x(n)
5 5 5
4 4 4
3 3
2 2

-2 -1 0 1 2 3 4 5 6 7

The sequence
x(n) circularly
shifted by two
samples

5 4
3
Amplitude

0 1 2 3 4 n

Figure 1: Circular shift of a sequence

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?, ?]
14, 2014 8 / 49
Properties of Discrete Fourier Transform (DFT)

0
x (n) = x((n − k))N
0
Consider x (n) with k=2 and N=4 then
0
x (n) = x((n − 2))4
0 0
x (0) = x(−2)4 = x(2) x (1) = x(−1)4 = x(3)
0 0
x (2) = x(0)4 = x(0) x (3) = x(1)4 = x(1)
These shifting operations are as shown in Figures
x(1)=4 x(1)=5

x(2)=3 x(0)=5 x(2)=4 x(0)=2

x(3)=2 x(n) x(3)=3 x(n-1)

x(1)=2 x(1)=3

x(2)=5 x(0)=3 x(2)=2 x(0)=4

x(3)=4 x(n-2) x(3)=5 x(n-3)

Figure 2: Circular shift of a sequence

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?, ?]
14, 2014 9 / 49
Properties of Discrete Fourier Transform (DFT)

The circularly shifting in clockwise is represented by x((n + 1))4 and is as shown in Figure

x(2)=3

x(3)=2
x(1)=4

x(0)=5 X((n+1))4

Figure 3: Circular shift of a sequence

The circularly folded sequence is represented by x((−n))4 and is as shown in Figure

x(1)=4 Folded sequence x(3)=2


( x(n) is plotted in clockwise)

x(2)=3 x(0)=5 x(2)=3 x(0)=5

x(3)=2 x(n) x(1)=4 x((-n))4

Figure 4: Folded sequence

x((−n))N = x(N − n) 0≤n ≤N −1

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 10 / 49
Properties of Discrete Fourier Transform (DFT) Symmetry Property

Symmetry Property
Let the sequence x(n) be of complex valued and is expressed as
x(n) = xR (n) + jxI (n)
Its DFT is
X (k) = XR (k) + jXI (k)

N−1
X 2π kn
X (k) = x(n)e −j N

n=0
N−1
X 2π kn
= [xR (n) + jxI (n)]e −j N

n=0
N−1     
X 2π 2π
= [xR (n) + jxI (n)] cos kn − jsin kn
n=0
N N
N−1
X    
2π 2π
= xR (n)cos kn + jxI (n)sin kn
n=0
N N
N−1
X    
2π 2π
−j xR (n)sin kn − xI (n)cos kn
n=0
N N

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 11 / 49
Properties of Discrete Fourier Transform (DFT) Symmetry Property

X (k) = XR (k) + jXI (k) real and imaginary parts of X (k) is

N−1
X    
2π 2π
XR (k) = xR (n)cos kn + xI (n)sin kn
n=0
N N

N−1
X    
2π 2π
XI (k) = − xR (n)sin kn − xI (n)cos kn
n=0
N N

x(n) = xR (n) + jxI (n) real and imaginary parts of sequence x(n) is

N−1     
1 X 2π 2π
xR (n) = XR (k)cos kn − XI (k)sin kn
N k=0 N N

N−1     
1 X 2π 2π
xI (n) = XR (k)sin kn + XI (k)cos kn
N k=0 N N

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 12 / 49
Properties of Discrete Fourier Transform (DFT) Symmetry Property

Real and even sequence


If x(n) = x(N − n) then its DFT becomes

N−1  
X 2π
X (k) = x(n)cos kn
n=0
N

Real and even sequence


If x(n) = −x(N − n) then its DFT becomes

N−1  
X 2π
X (k) = −j x(n)sin kn
n=0
N

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 13 / 49
Properties of Discrete Fourier Transform (DFT) Symmetry Property

Symmetry property of real value of x(n)


N−1
X
X (k) = x(n)e −j2πkn/N
n=0

Let k = N − k :
N−1
X N−1
X
X (N − k) = x(n)e −j2π(N−k)n/N = x(n)e j2πkn/N e −j2πn
n=0 n=0

But e −j2πn = 1 for n = 0, 1, 2, ...


Therefore

N−1
X
X (N − k) = x(n)e j2πkn/N = X ∗ (k) complex conjugate of X (k)
n=0

X (N − k) = X ∗ (k)

When N is even, |Xk| is symmetric about N/2.


The phase, Xk, has odd symmetry about N/2.

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 14 / 49
Properties of Discrete Fourier Transform (DFT) Symmetry Property

The first five points of the eight point DFT of a real valued sequence are {0.25, 0.125 - j0.3018,
0, 0.125 - j0.0518, 0} Determine the remaining three points
X(0)=0.25 X(1)=0.125 - j0.3018, X(2)=0, X(3)=0.125 - j0.0518, X(4)=0}
The remaining three points X(5), X(6) and X(7) are determined using symmetry property
X (N − k) = X ∗ (k)
X (8 − k) = X ∗ (k)
By taking complex conjugate on both sides
X ∗ (8 − k) = X (k)
X (k) = X ∗ (8 − k)
For k=5
X (5) = X ∗ (8 − 5) = X ∗ (3)
But X (3) = 0.125 − j0.0518 and X ∗ (3) = 0.125 + j0.0518 = X (5)
For k=6
X (6) = X ∗ (8 − 6) = X ∗ (2)
But X (2) = 0 and X ∗ (2) = 0 = X (6)
For k=7
X (7) = X ∗ (8 − 7) = X ∗ (1)
But X (1) = 0.125 − j0.3018 and X ∗ (1) = 0.125 + j0.3018 = X (7)
Hence The remaining the DFTs are {0.125 + j0.0518, 0, 0.125 + j0.3018}

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 15 / 49
Properties of Discrete Fourier Transform (DFT) Symmetry Property

The first five points of the eight point DFT of a real valued sequence are {0.25, -j0.3018, 0, 0,
0.125-j0.0518} Determine the remaining three points
X(0)=0.25 X(1)=-j0.3018, X(2)=0, X(3)=0, X(4)=0.125-j0.0518}
The remaining three points X(5), X(6) and X(7) are determined using symmetry property
X (N − k) = X ∗ (k)
X (8 − k) = X ∗ (k)
By taking complex conjugate on both sides
X ∗ (8 − k) = X (k)
X (k) = X ∗ (8 − k)
For k=5
X (5) = X ∗ (8 − 5) = X ∗ (3)
X (3) = 0 X ∗ (3) = 0
For k=6
X (6) = X ∗ (8 − 6) = X ∗ (2)
X (2) = 0 X ∗ (2) = 0
For k=7
X (7) = X ∗ (8 − 7) = X ∗ (1)
X (1) = −j0.3018 X ∗ (1) = +j0.3018
Hence the remaining the DFTs are {0.25, −j0.3018, 0, 0.125 − j0.0518, 0, 0, j0.3018}

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 16 / 49
Properties of Discrete Fourier Transform (DFT) Symmetry Property

Circular Shift
Circular shift of x(n) can be defined:

xm (n) = x((n + m))N RN (n)

Xm (k) = DFT [xm (n)] = DFT [x((n + m))N RN (n)] = WN−mk X (k)

DFT [x((n + m))N RN (n)] = DFT [x̃(n + m)RN (n)]


= DFS[x̃(n + m)]RN (k)

= WN−mk X̃ (k)RN (k)

= WN−mk X (k)

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 17 / 49
Properties of Discrete Fourier Transform (DFT) Symmetry Property

Shift of a sequence
DFS
x̃ [n] ↔ X̃ [k]
DFS
x̃ [n − m] ↔ WNkm X̃ [k]

WN = e −j(2π/N)
DFS
WN−nl x̃ [n] ↔ X̃ [k − l]

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 18 / 49
Properties of Discrete Fourier Transform (DFT) Symmetry Property

Circular Frequency Shift


DFT
x(n) ↔ X (k)

then
DFT
x(n)e j2πn/N ↔ X ((k − l))N
Shifting the frequency components of DFT circularly is equivalent to multiplying the time
domain sequence by e j2πn/N

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 19 / 49
Properties of Discrete Fourier Transform (DFT) Circular Correlation

Circular Correlation
DFT
x(n) ←−
−→ X (k)
N

DFT
y (n) ←−
−→ Y (k)
N

DFT
−→= R̃xy (k) = X (k)Y ∗ (k)
r̃xy (l) ←−
N

where rxy (l) is the circular cross correlation which is given as


N−1
X
r̃xy (l) = x(n)y ∗ ((n − l))N
n=0

Multiplication of DFT one sequence and conjugate DFT of another sequence is equivalent
to circular cross correlation of these two sequences in time domain

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 20 / 49
Properties of Discrete Fourier Transform (DFT) Circular Correlation

Proof:
N−1
X
r̃xy (l) = x(n)y ∗ ((n − l))N
n=0

y ∗ ((n − l))N can be written as y ∗ ((−[l − n]))N


N−1
X
r̃xy (l) = x(n)y ∗ ((−[l − n]))N
n=0

Based on circular convolution the above equation can be written as

r̃xy = x(l) N y ∗ (−l)

DFT {rxy (l)} = DFT {x(l)}DFT {y ∗ (−l)}

R̃xy (k) = X (k)DFT {y ∗ (−l)}

N−1
X 2π kl
DFT {y ∗ (−l)} = y ∗ (−l)e −j N

l=0

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 21 / 49
Properties of Discrete Fourier Transform (DFT) Circular Correlation

let n = −l
when l = 0 n = 0 and
when l = N − 1 n = −(N − 1)
−(N−1)
X 2π kN
DFT {y ∗ (−l)} = y ∗ (n)e j N

n=0

N−1
X 2π kN
DFT {y ∗ (−l)} = y ∗ (n)e j N

l=0
"N−1 #∗
X 2π nk
= y (n)e −j N

n=0
= [Y (k)]∗ = [Y ∗ (k)]

R̃xy = X (k)Y ∗ (k)

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 22 / 49
Properties of Discrete Fourier Transform (DFT) Complex Conjugate Properties

Complex Conjugate Properties


DFT
x(n) ↔ X (k)
then
DFT
x ∗ (n) ↔ X ∗ ((−k))N = X ∗ (N − k)
and
DFT
x ∗ ((−n))N = x ∗ (N − k) ↔ X ∗ (k)

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 23 / 49
Properties of Discrete Fourier Transform (DFT) Complex Conjugate Properties

N−1
X 2π kn
DFT {x ∗ (n)} = x ∗ (n)e −j N

n=0

2πnN
ej N =1

N−1
X 2π kn 2πnN
DFT {x ∗ (n)} = x ∗ (n)e −j N ej N

n=0

N−1
X 2π kn 2πnN
DFT {x ∗ (n)} = x ∗ (n)e −j N ej N

n=0
N−1
X 2πn (N−k)
= x ∗ (n)e j N

n=0
"N−1 #∗
X 2πn (N−k)
= x(n)e −j N

n=0
= [X (N − k)]∗ = [X ∗ (N − k)]

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 24 / 49
Properties of Discrete Fourier Transform (DFT) Time Reversal of a sequence

Time Reversal of a sequence


DFT
x(n) ⇔ X (k)

DFT
x((−n))N = x(N − n) = ↔ X ((−k))N = X (N − k)

Proof
If the sequence is circularly folded its DFT is also circularly folded.

x((−n))N = x(N − n)
N−1
X 2π kn
DFT {x(N − n)} = x(N − n)e −j N

n=0

Let m=N-n then the summation limits are


n=0 m=N
n=N-1 m=N-N+1=1
1
X 2π k(N−m)
DFT {x(N − n)} = x(m)e −j N

m=N

x(N − n) is circular and DFT is periodic. The summation is performed from 0 to N-1 i.e
for N samples. If the index is changed from (0+N) to (N-1+N). The limits are same

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 25 / 49
Properties of Discrete Fourier Transform (DFT) Time Reversal of a sequence

N−1 N−1
X 2π k(N−m) X
DFT {x(N − n)} = x(m)e −j N = x(m)e −j2πk e −j2πkm/N
m=0 m=0
N−1
X
= x(m)e j2πkm/N
m=0

Multiply RHS by e −j2πm ∵ e −j2πm = 1

N−1
X
DFT {x(N − n)} = x(m)e −j2πkm/N e −j2πm
m=0
N−1
X
= x(m)e −j2πm(N−k)/N
m=0

DFT {x(N − n)} = X (N − k)


DFT is periodic over period N

DFT {x(N − n)} = X (N − k)


= X ((−k))N

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 26 / 49
Properties of Discrete Fourier Transform (DFT) Circular Correlation

Multiplication Of Two Sequences


DFT
x(n) ←−
−→ X (k)
N

DFT
y (n) ←−
−→ Y (k)
N

Then
DFT 1
y (n)y (n) ←−
−→ X (k) N Y (k)
N N
Multiplication of two sequences in time domain is equivalent to circular convolution of their
DFTs in frequency domain

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 27 / 49
Circular Convolution Circular Convolution

Circular Convolution

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 28 / 49
Circular Convolution Circular Convolution

For two finite-duration sequences x1 (n) and (x2 (n) both of length N, with DFTs X1 (k)
and X2 (k)
DFT DFT
x1 (n) ↔ X1 (k) and x2 (n) ↔ X2 (k)
Then
X1 (k)X2 (k) = x1 (n) N x2 (n)
Consider X3 (k)
X3 (k) = X1 (k)X2 (k)
Now consider x3 (m) is an IDFT of X3 (k) and is represented as
N−1
1 X 2π
x3 (m) = X3 (k)e j N km
N k=0

N−1
1 X 2π
x3 (m) = X1 (k)X2 (k)e j N km
N k=0

N−1 N−1 N−1


" #
1 X X 2π X 2π 2π
x3 (m) = x1 (n)e −j N kn x2 (l)e −j N kl e j N km
N k=0 n=0 l=0

N−1 N−1
"N−1 #
j 2π
X X X
k(m−n−l)
x3 (m) = x1 (n) x2 (l) e N

n=0 l=0 k=0

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 29 / 49
Circular Convolution Circular Convolution

N−1 N−1
"N−1 #
X X X 2π k(m−n−l)
x3 (m) = x1 (n) x2 (l) ej N

n=0 l=0 k=0


N−1
(
X N for a = 1
ak = 1−aN
1−a
for a 6= 1
k=0
when (m-n-l)=N,2N,3N,.... multiple of N then a=1
because 2π 2π
e j N kN = e j N 2kN .... = 1

N−1
X 2π k(m−n−l)
ej N =N when (m − n − l) is multiple ofN
K =0
N−1
X 2π k(m−n−l) 1 − e j2πk(m−n−l)
ej N = 2π k(m−n−l)
when (m − n − l) is not multiple of N
K =0 1 − ej N

e j2πk(m−n−l) = 1
N−1
X 2π k(m−n−l) 1−1
ej N = =0 when (m − n − l) is not multiple of N
j 2π k(m−n−l)
K =0 1−e N

N−1 
X 2π k(m−n−l) N when (m − n − l) is not multiple of N
ej N =
0 otherwise
k=0
Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,
September
?, ?,14,
?] 2014 30 / 49
Circular Convolution Circular Convolution

N−1 N−1
1 X X
x3 (m) = x1 (n) x2 (l)N when (m − n − l) is not multiple of N
N n=0 l=0
N−1
X N−1
X
= x1 (n) x2 (l)
n=0 l=0

(m-n-l) is multiple of N i.e., (m-n-l)=pN where p is some integer it may positive or


negative

m − n − l = −pN Then l = m − n + pN

N−1
X
x3 (m) = x1 (n)x2 (m − n + pN)
n=0
x2 (m − n + pN) represents x2 shifted circularly by n samples

x2 (m − n + pN) = x2 (m − n, mpdulo N)
x2 (m − n + pN) = x2 ((m − n))N

N−1
X
x3 (m) = x1 (n)x2 ((m − n))N m = 0, 1, . . . N − 1
n=0

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 31 / 49
Circular Convolution Circular Convolution

Circular convolution of x1 (n) x2 (n)is represented by x1 (n) N x2 (n) and is given by


N−1
X
x3 (m) = x1 (n) N x2 (n) = x1 (n)x2 ((m − n))N m = 0, 1, . . . N − 1
n=0

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 32 / 49
Circular Convolution Circular Convolution

N−1
X
x3 (m) = x1 (n) N x2 (n) = x1 (n)x2 ((m − n))N m = 0, 1, . . . N − 1
n=0

x1 =[4 3 5 2] and x2 =[3 4 1 2]


x1 (n) = 4 3 5 2
x2 (−n) = 3 2 1 4
P3
x3 (0) = x1 (n)x2 (−n)4 = 12 +6 +5 +8 =31
x=0

x1 (n) = 4 3 5 2
x2 (1 − n) = 4 3 2 1
P3
x3 (1) = x1 (n)x2 (1 − n)4 = 16 +9 +10 +2 =37
x=0
x1 (n) = 4 3 5 2
x2 (2 − n) = 1 4 3 2
P3
x3 (2) = x1 (n)x2 (2 − n)4 = 4 +12 +15 +4 =35
x=0

x1 (n) = 4 3 5 2
x2 (−n) = 2 1 4 3
3
P
x3 (3) = x1 (n)x2 (3 − n)4 = 8 +3 +20 +6 =37
x=0

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 33 / 49
Circular Convolution Circular Convolution

x1 =[4 3 5 2] and x2 =[3 4 1 2]


x2(3)=2 x2(0)=3

3x2=6 3x3=9
x1(1)=3 x1(1)=3

x2(2)=1 x1(2)=5 x1(0)=4 x2(0)=3 x2(3)=2 x1(2)=5 x1(0)=4 x2(1)=4

5x1=5 4x3=12 5x2=10 4x4=16

x1(n) x2((-n))4 x1(n) x2((1-n))4

x1(3)=2 x1(3)=2
2x4=8 2x1=2

x2(1)=4 x2(2)=1

x2(2)=1
x2(1)=4
3x1=3
3x4=12 x1(1)=3
x1(1)=3

x2(1)=4 x2(3)=2
x1(2)=5 x1(0)=4
x2(0)=3 x1(2)=5 x1(0)=4 x2(2)=1 4x2=8
5x4=20
5x3=15 4x1=4 x1(n) x2((3-n))4

x1(n) x2((2-n))4
x1(3)=2
x1(3)=2 2x3=6
2x2=4
x2(0)=3
x2(3)=2

Figure 5: Circular shift of a sequence


Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,
September
?, ?,14,
?] 2014 34 / 49
Circular Convolution Circular Convolution
Using matrix approach for circular convolution

N−1
X
x3 (m) = x1 (m)x2 (m − n), 0≤m ≤N−1
n=0

y (n) = h(n) N x(n), 0≤m ≤N−1

N−1
X
y (m) = x(n)h(m − n), 0≤m ≤N−1
n=0

y (0) = x(0)h(0) + x(1)h(−1) + x(2)h(−2) + . . . + x(N − 2)h(−(N − 2)) + x(N − 1)h(−(N − 1))
= x(0)h(0) + x(1)h(N − 1) + x(2)h(N − 2) + . . . x(N − 2)h(2) + x(N − 1)h(1)

y (1) = x(0)h(1) + x(1)h(0) + x(2)h(N − 2) + . . . + x(N − 2)h(3) + x(N − 1)h(2)


= x(0)h(0) + x(1)h(N − 1) + x(2)h(N − 2) + . . . x(N − 2)h(2) + x(N − 1)h(1)

y (N − 1) = x(0)h(N − 1) + x(1)h(N − 2) + x(2)h(N − 3) + . . . + x(N − 2)h(1) + x(N − 1)h(0)

 y (0)   x(0) 
h(0) h(N − 1) h(N − 2) ··· h(2) h(1)
 
 y (0) x(1)
h(1) h(0) h(N − 1) h(3) h(2)
  
 y (0)     x(2) 
h(2) h(1) h(0) h(4) h(3)
     
 . = = .
     

 .     . 
 .   h(N − 2) h(N − 3) h(N − 4) h(0) h(N − 1)   . 
y (N − 2) x(N − 2)
   
h(N − 1) h(N − 2) h(N − 3) h(1) h(0)
y (N − 2) x(N − 1)

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 35 / 49
Circular Convolution Circular Convolution

x=[4 3 5 2] and h=[3 4 1 2]


The first row of h matrix is obtained by folding the h(n) i.e, [2, 1, 4, 3]and shift circularly
right once it becomes [3, 2, 1, 4]
Similarly shift circularly right once to get second row of h matrix and continue for the
remaining rows of h matrix.
      
y (0) 3 2 1 4 4 12 + 6 + 5 + 8 = 31
 y (1)   4 3 2 1 
 3
   16 + 9 + 10 + 2 = 37 
 = = 
 y (2)   1 4 3 2  5   4 + 12 + 15 + 4 = 35 
y (3) 2 1 4 3 2 8 + 3 + 20 + 6 = 37

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 36 / 49
Circular Convolution Circular Convolution
Using DFT and IDFT method

First determine the DFT of the given sequences and multiply both the DFTs i,e.,

Y (k) = X (k).H(k)

Use IDFT to find the y(n) i.e. convolved sequence

y (n) = IDFT (X (k).H(k))

      
X (0) 1 1 1 1 4 14
 X (1)   1 −j −1 j 
 3

 =  −1 − 1j
  
 X (2)  =  1
   
−1 1 −1   5   4 
X (3) 1 j −1 −j 2 −1 + 1j
      
X (0) 1 1 1 1 3 10
 X (1)   1 −j −1 j 
 4

 =  2 − 2j
  
 X (2)  =  1
   
−1 1 −1   1   −2 
X (3) 1 j −1 −j 2 (2 + 2j)

Y (k) = X (k).H(k)
       
Y (0) 14 × 10 140 140
 =  (−1 − 1j) × (2 − 2j)  =  (−1 − 1j) × (2 − 2j)  =  −4 
 Y (1)       

 Y (2)   4 × (−2)   −8   −8 
Y (3) (−1 + 1j)(2 + 2j) (−1 + 1j)(2 + 2j) −4

y (n) = IDFT (X (k).H(k))


      
y (0) 1 1 1 1 140 31
 y (1)  1  1 j −1 −j   −4   37 
 y (2)  = 4
    =  
 1 −1 1 −1   −8   35 
y (3) 1 −j −1 j −4 37

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 37 / 49
Circular Convolution Circular Convolution

%--------------------------------------------------------------------------
% GENERALAZED CIRCULAR CONVOLUTION COMPUTING CODE IN MATLAB WITHOUT
% USING MATLAB BUILTIN FUNCTION [cconv(a,b,n)]
%--------------------------------------------------------------------------
clc; clear all; close all;
x=[4 3 5 2]
h=[3 4 1 2]

N1=length(x);%To find the length of the sequence


N2=length(h);%To find the length of the sequence
N=max(N1,N2);

a=[x, zeros(1,N2)]%Padding zeros to make sequence length


b=[h, zeros(1,N1)]%Padding zeros to make sequence length

for i=1:N
y(i)=0;
for j=1:N
k=i-j+1;
if(k<=0)
k=k+N;
end
y(i)=y(i)+a(j)*b(k);
end
end
y
y1=cconv(x,h, N)% This is to verify the result
subplot(3,1,1); stem(x);
xlabel(’------------->n’);ylabel(’Sequence x[n]’);
subplot(3,1,2);stem(h);
xlabel(’------------->n’);ylabel(’Sequence h[n]’);
subplot(3,1,3); stem(y);
xlabel(’------------->n’);ylabel(’Y[n]’);title(’Convolution without using "conv" function’);

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 38 / 49
Circular Convolution Circular Convolution

% -----------------------------------------------------------------
% Program for Circular Convolution using DFT & IDFT of equal length
%------------------------------------------------------------------
% 1. Define the sequence x1 and x2
% 2. Take DFT of x1 and x2 i.e., X1=DFT(x1) & X2=DFT(x2)
% 3. Multiply X1 & X2
% 4. Take IDFT for the resultant.
%------------------------------------------------------------------
clc; clear all; close all;
% Let us define the input sequence x1 & x2
x1 = input(’Enter the first sequence:’);
x2 = input(’Enter the second sequence:’);
%Now let us take DFT of x1 and x2 i.e., X1=DFT(x1) & X2=DFT(x2)
X1 = fft(x1)
X2 = fft(x2)
% Now let us multiply X1 & X2
Y = X1.*X2
% Now let us take IDFT for the resultant
y = ifft(Y)
% Now let us plot this result
subplot(5,2,1); stem(x1); title(’First Sequence’);
subplot(5,2,2); stem(x2); title(’Second Sequence’);
subplot(5,2,3); stem(abs(X1)); title(’Magnitude of DFT of Sequence x1’);
subplot(5,2,4); stem(abs(X2)); title(’Magnitude of DFT of Sequence x2’);
subplot(5,2,5); stem(angle(X1)); title(’Angle of DFT of Sequence x2’);
subplot(5,2,6); stem(angle(X2)*pi/180); title(’Angle of DFT of Sequence x2’);
subplot(5,2,7); stem(abs(Y)); title(’Magnitude of multiplied o/p of X1 & X2 = Y’);
subplot(5,2,8); stem(angle(Y)); title(’Angle of multiplied o/p of X1 & X2 = Y’);
subplot(5,2,9); stem(abs(y)); title(’Magnitude of IDFT of Sequence Y’);
subplot(5,2,10); stem(angle(y)); title(’Angle of IDFT of Sequence Y’);

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 39 / 49
Circular Convolution Circular Convolution

Let x(n) be the sequence x(n) = δ(n) + 2δ(n − 2) + δ(n − 3)


(i) Find the 4 point DFT of x(n)
(ii) If y (n) is the 4 point circular convolution with itself find y (n) and the four point DFT
Y(K)
Solution:
x(n) = δ(n) + 2δ(n − 2) + δ(n − 3)
x(0) = δ(0) + 2δ(0 − 2) + δ(0 − 3) = 1 + 0 + 0 = 1
x(1) = δ(1) + 2δ(1 − 2) + δ(1 − 3) = 0 + 0 + 0 = 0
x(2) = δ(2) + 2δ(2 − 2) + δ(2 − 3) = 0 + 2 + 0 = 2
x(3) = δ(3) + 2δ(3 − 2) + δ(3 − 3) = 0 + 0 + 1 = 1
The 4 point DFT x(n) can be obtained by matrix method

X [N] = [WN ]x(n)

      
X (0) 1 1 1 1 1 4
 X (1)   1 −j −1 j 
 0
   −1 + j 
 X (2)  = 
   = 
1 −1 1 −1   2   2 
X (3) 1 j −1 −j 1 −1 − j

The DFT of the sequence x(n) = [1 0 2 1] is [4, − 1 + j, 2, = 1 − j]

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 40 / 49
Circular Convolution Circular Convolution

The circular convolution of x(n) with itself Y (n)


DFT
Y (n) = x(n) ~ x(n) ←−−− ⇐⇒ X (k).X (k) = Y (k)

     
4 4 16
 −1 + j   −1 + j   −j2 
 . = 
 2   2   4 
−1 − j −1 − j j2

Determine the y (n) by taking IDFT of Y (k)


     

x(0) 1 1 1 1 16 1
= 1 1 −1 −j 
  −j2
 x(1)   j    0 
 = 
 x(2)  4  1 −1 1 −1   4   2 
x(3) 1 −j −1 j j2 1

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 41 / 49
Circular Convolution Circular Convolution

Let x(n) be the sequence x(n) = 2δ(n) + δ(n − 1) + δ(n − 3) Find the sequence
y (n) = x(n) 5 x(n) i.e. 5 point circular convolution of x(n) with itself
Solution:
x(n) = 2δ(n) + δ(n − 1) + δ(n − 3)
x(0) = 2δ(0) + δ(0 − 1) + δ(0 − 3) = 2 + 0 + 0 = 2
x(1) = 2δ(1) + δ(1 − 1) + δ(1 − 3) = 0 + 1 + 0 = 1
x(2) = 2δ(2) + δ(2 − 1) + δ(2 − 3) = 0 + 0 + 0 = 0
x(3) = 2δ(3) + δ(3 − 1) + δ(3 − 3) = 0 + 0 + 1 = 1
x(n) = [2, 1, 0, 1]
The 5 point circular convolution is achieved by appending zero at the end of the sequence
x(n) i.e., x(n) = [2 1 0 1 0]
Using Matrix approach
x=[2 1 0 1 0] folded sequence is =[0 1 0 1 2]
Then shift circularly right once it becomes [2 0 1 0 1]

y (0) 2 0 1 0 1 2 4+0+0+0+0=4
      
 y (1)   1 2 0 1 0  1   2 + 2 + 0 + 1 + 0 = 5 
 y (2)  =  0 1 2 0 1  0  =  0 + 1 + 0 + 0 + 0 = 1
      

 y (3)   1 0 1 2 0  1   2 + 0 + 0 + 2 + 0 = 4 
y (4) 0 1 0 1 2 0 0+1+0+1+0=2

y (n) = x(n) 5 x(n) is [4 5 1 4 2]

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 42 / 49
Circular Convolution Circular Convolution

k=0 k=1 k=2 k=3 k=4


n=0 W50 W50 W50 W50 W50
n=1 W50 W51 W52 W53 W54
n=2 W50 W51 W54 W54 W58
n=3 W50 W53 W56 W59 W512
n=4 W50 W54 W58 W512 W516

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 43 / 49
Circular Convolution Circular Convolution

Compute the circular convolution between the following sequences using DFT and IDFT method
x(n) = {1, 2, 3, 4} y (n) = {−1, −2, −3, −4} x(n) and y (n) are periodic sequences with period
↑ ↑
N=4.
The 4 point DFT x(n) can be obtained by matrix method

X [N] = [WN ]x(n)

      
X (0) 1 1 1 1 1 10
 X (1)   1
 = −j −1 j 
 2
   −2 + j2
=


 X (2)   1 −1 1 −1   3   −2 
X (3) 1 j −1 −j 4 −2 − j2

The DFT of the sequence x(n) = [1 2 3 4] is [10, − 2 + j2, − 2, − 2 − j2]


      
Y (0) 1 1 1 1 −1 −10
 Y (1)   1 −j −1   −2
j     2 − j2 
 Y (2)  = 
   = 
1 −1 1 −1   −3   2 
Y (3) 1 j −1 −j −4 2 + j2

The DFT of the sequence y (n) = [1 0 2 1] is [−10, 2 − j2, 2, 2 + j2]

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 44 / 49
Circular Convolution Circular Convolution

The circular convolution of x(n) with itself Y (n)


DFT
Z (n) = x(n) ~ x(n) ←−−− ⇐⇒ X (k).X (k) = Z (k)

     
10 10 −100
 −2 + j2   2 − j2   j8 
 . = 
 −2   2   −4 
−2 − j2 2 + j2 −j8

Determine the y (n) by taking IDFT of Y (k)


      
Z (0) 1 1 1 1 −100 −26
= 1 1 −1 −j 
 Z (1)  j   −28 
  j8
 
 = 
 Z (2)  4  1 −1 1 −1   −4   −26 
Z (3) 1 −j −1 j −j8 −20

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 45 / 49
Circular Convolution Circular Convolution

Evaluate circular convolution y (n) = x(n) N x(n) where x(n) = u(n) − u(n − 4) and
h(n) = u(n) − u(n − 3) assuming N=8 show your calculations by int0 approximate usage of
equations and relevant sketches. Plot y(n). (ii) Verify the result using DFT and IDFT method
u(n)
u(n)
Unit step sequence u(n)
Unit step sequence u(n)

0 1 2 3 4 5 6 7 8 9 10 11 n
0 1 2 3 4 5 6 7 8 9 10 11 n
u(n-4)
u(n-3)
Unit step sequence u(n) delayed by 4 samples Unit step sequence u(n) delayed by 3 samples

0 1 2 3 4 5 6 7 8 9 10 11 n
0 1 2 3 4 5 6 7 8 9 10 11 n
x(n)=u(n-u(n-4)
h(n)=u(n-u(n-3)
x(n) is generated by subtracting u(n) by u(n-4)
h(n) is generated by subtracting u(n) by u(n-3)

0 1 2 3 4 5 6 7 8 9 10 11 n
0 1 2 3 4 5 6 7 8 9 10 11 n

Figure 6: Sequence x(n)=u(n)+u(n-4) Figure 7: Sequence h(n)=u(n)+u(n-3)

y(n)
4

Sketch of convolved sequence h(n)


3
2
1
0

0 1 2 3 4 5 6 n

Figure 8: Convolved Sequence y(n)


Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,
September
?, ?,14,
?] 2014 46 / 49
Circular Convolution Circular Convolution

Using Matrix approach

y (n) = x(n) 8 h(n)

x(n) = [1, 1, 1, 1] and h(n) = [1, 1, 1]


The 8 point circular convolution is achieved by appending zero at the end of the sequence
x(n) i.e., x(n) = [1, 1, 1, 1, 0, 0, 0, 0] and h(n) = [1, 1, 1, 0, 0, 0, 0, 0]
The first row of h matrix is obtained by folding the h(n) i.e, [0, 0, 0, 0, 0, 0, 1, 1, 1]and
shift circularly right once it becomes [1, 0, 0, 0, 0, 0, 1, 1]
Similarly shift circularly right once to get second row of h matrix and continue for the
remaining rows of h matrix.

y (0) 1 0 0 0 0 0 1 1 1 1
      
 y (1)   1 1 0 0 0 0 0 1  1   2 
y (2) 1 1 1 0 0 0 0 0 1 3
      
      
y (3) 0 1 1 1 0 0 0 0 1 3
      
= =
      
y (4) 0 0 1 1 1 0 0 0 0 2
  
      
y (5) 0 0 0 1 1 1 0 0 0 1
      
      
 y (6)   0 0 0 0 1 1 1 0  0   0 
y (7) 0 0 0 0 0 1 1 1 0 0

The convolved sequence is y (n) = [1, 2, 3, 3, 2, 1, 0, 0]

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 47 / 49
Circular Convolution Circular Convolution

If X(k)is the DFT the 


sequence x(n)determine  the N point DFT of the sequence
xc (n) = x(n)cos 2πln
N
and xs (n) = x(n)sin 2πln
N
for 0 ≤ n ≤ N − 1) in terms of X(k)
 
2πln 1  j2πln j2πln 
xc (n) = x(n)cos = x(n) e N + e− N
N 2

N−1
X j2πkn
Xc (k) = xc (n)e − N

n=0

N−1
1 X  j2πln j2πln  j2πkn
Xc (k) = x(n) e N + e − N e− N
2 n=0
N−1 N−1
1 X j2πln j2πkn 1 X j2πln j2πkn
= x(n)e N e − N + x(n)e − N e − N
2 n=0 2 n=0

DFT DFT
x(n)e j2πn/N ↔ X ((k − l))N = x(n)e −j2πn/N ↔ X ((k + l))N

1 1
Xc (k) = X ((k − l))N + X ((k + l))N
2 2

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 48 / 49
Circular Convolution Circular Convolution

 
2πln 1  j2πln j2πln 
xs (n) = x(n)sin = x(n) e N − e− N
N 2j

N−1
X j2πkn
Xs (k) = xs (n)e − N

n=0

N−1
1 X  j2πln j2πln  j2πkn
Xs (k) = x(n) e N − e − N e− N
2j n=0
N−1 N−1
1 X j2πln j2πkn 1 X j2πln j2πkn
= x(n)e N e − N − x(n)e − N e − N
2j n=0 2j n=0

DFT DFT
x(n)e j2πn/N ↔ X ((k − l))N = x(n)e −j2πn/N ↔ X ((k + l))N

1 1
Xc (k) = X ((k − l))N − X ((k + l))N
2j 2j

Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,


September
?, ?,14,
?] 2014 49 / 49

S-ar putea să vă placă și