0% found this document useful (0 votes)
36 views50 pages

Chapter5 PDF

The document summarizes key concepts from a lecture on the discrete Fourier transform (DFT). It discusses how the DFT can be used to calculate the frequency spectrum of a signal using a digital computer by approximating the continuous-time Fourier transform. It provides the formulas for the DFT and inverse DFT, and examples of calculating them. It also covers topics like frequency resolution of the DFT, circular shift and convolution properties, and how zero padding can be used to calculate linear convolution using the DFT.

Uploaded by

Hương Hương
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)
36 views50 pages

Chapter5 PDF

The document summarizes key concepts from a lecture on the discrete Fourier transform (DFT). It discusses how the DFT can be used to calculate the frequency spectrum of a signal using a digital computer by approximating the continuous-time Fourier transform. It provides the formulas for the DFT and inverse DFT, and examples of calculating them. It also covers topics like frequency resolution of the DFT, circular shift and convolution properties, and how zero padding can be used to calculate linear convolution using the DFT.

Uploaded by

Hương Hương
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/ 50

CHAPTER 5:

DISCRETE FOURIER TRANSFORM


(DFT)

Lecture 9: DFT and Inverse DFT


Lecture 10: Fast Fourier Transform (FFT)
Duration: 4 hrs
Lecture 9
DFT and Inverse DFT

 Duration: 2 hrs
 Outline:
1. Review of DTFT of DT periodic signals
2. DFT and Inverse DFT
3. Frequency resolution
4. DFT properties
Procedure to calculate DTFT of
periodic signals

Step 1:
Start with x0(n) – one period of x(n), with zero everywhere else
Step 2:
Find the DTFT X0(Ω) of the signal x0[n] above
Step 3:
Find X0(Ω) at N equally spacing frequency points X0(k2π/N)
Step 4:
2 2 2
Obtain the DTFT of x(n): X () 
N
k X 0 (k N ) (  k N )
Example of calculating DTFT of
periodic signals

0 1 2 3
3
X 0 ()   x0 (n)e  jn
 1 e  j
 2e  j 3

n 0

k = 0  X0(0) = 4; k = 1  X0(1) = 1+j


k = 2  X0(2) = -2; k = 3  X0(3) = 1-j
Example (cont)
Lecture 9
DFT and Inverse DFT

 Duration: 2 hrs
 Outline:
1. Review of DTFT of DT periodic signals
2. DFT and Inverse DFT
3. Frequency resolution
4. Applications
DFT to the rescue!

Could we calculate the frequency spectrum of a signal


using a digital computer with CTFT/DTFT?

 Both CTFT and DTFT produce continuous function of


frequency  can’t calculate an infinite continuum of
frequencies using a computer
 Most real-world data is not in the simple form such as
anu(n)

DFT can be used as a FT approximation that can calculate a


finite set of discrete-frequency spectrum values from a
finite set of discrete-time samples of an analog signal
Building the DFT formula
Continuous time
signal x(t)
“Window” x(n) is like multiplying
the signal by the finite length
sample
rectangular window

Discrete time
signal x(n)

window

Discrete time
signal x0(n)
Finite length
Building the DFT formula (cont)
Continuous time
signal x(t)

sample

Discrete time
signal x(n)
 N 1

window X 0 ()  0
x [ n
n  
]e  jn
 0
x [
n 0
n ]e  jn

DTFT
Discrete time
signal x0(n)
Finite length
Building the DFT formula (cont)
Continuous time
signal x(t)
Discrete Fourier Transform DFT X(k)
Discrete + periodic with period N
sample
Sample
Discrete time at N
signal x(n) values
around
window the unit
circle N=8

DTFT
Discrete time X0(Ω)
signal x0(n) Continuous + periodic
Finite length with period 2π
DFT and inverse DFT formulas
2
j
Notation: WN  e N

You only have to store N points


Examples of calculation DFT and IDFT

Ex.1. Find the DFT of x(n) = 1, n = 0, 1, 2, …, (N-1)

k = 0  X(k) = X(0) = N
k ≠ 0  X(k) = 0
Examples of calculation DFT and IDFT

Ex.2. Given y(n) = δ(n-2) and N = 8, find Y(k)


Examples of calculation DFT and IDFT

Ex.3. Find the IDFT of X(k) = 1, k = 0, 1, …, 7.


Examples of calculation DFT and IDFT

Ex.4. Given x(n) = δ(n) + 2δ(n-1) +3δ(n-2) + δ(n-3) and


N = 4. Find X(k).
 x = [1 2 3 1];
 >> X = fft(x)

 X = 7.0000 -2.0000 - 1.0000i 1.0000 -2.0000


+ 1.0000i
 7.0000 1.7071 - 5.1213i -2.0000 - 1.0000i 0.2929 +
0.8787i

 Columns 5 through 8

 1.0000 0.2929 - 0.8787i -2.0000 + 1.0000i 1.7071


+ 5.1213i
Lecture 9
DFT and Inverse DFT

 Duration: 2 hrs
 Outline:
1. Review of DTFT of DT periodic signals
2. DFT and Inverse DFT
3. Frequency resolution
4. DFT properties
Frequency resolution of the DFT

Discrete frequency spectrum computed from DFT has


the spacing between frequency samples of:

fs 2
f   
N N
 The choice of N determines the resolution of the
frequency spectrum, or vice-versa

 To obtain the adequate resolution, some zeros can be


appended to the signal (zero padding)
Examples of N = 5 and N = 15

0
0 0.5 1 1.5 2 2.5 3 3.5 4

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

0
0 5 10 15 20 25 30
Examples of N = 15 and N = 30
6

0
0 0.5 1 1.5 2 2.5 3 3.5 4

0
0 5 10 15 20 25 30

0
0 10 20 30 40 50 60
Lecture 9
DFT and Inverse DFT

 Duration: 2 hrs
 Outline:
1. Review of DTFT of DT periodic signals
2. DFT and Inverse DFT
3. Frequency resolution
4. DFT properties
Circular shift property of the DFT

x(n) N periodic extension xp(n)


Finite length truncate Infinite length,
periodic

x(n) is one period of signal xp(n)

DFT
x[n  m]  W X[k ] km
x(n)

Circular
shift xp(n)
property
of the
DFT xp(n+2)

x(n+2)

Circular shift by m is the same as a shift by m modulo N


Recall linear convolution


y[n]  x1[n] * x2 [n]   x [ p]x [n  p]
p  
1 2

 N1: the non-zero length of x1(n); N2: the non-zero


length of x2(n); Ny = N1 + N2 -1
 The shift operation is the regular shift
 The flip operation is the regular flip
Circular convolution of the DFT

N 1
y[n]  x1[n]  x2 [n]   x1[ p]x2 [n  p]mod N
p 0

 The non-zero length of x1(n), x2(n) and y(n) can be no


longer than N
 The shift operation is circular shift
 The flip operation is circular flip
Direct method to calculate circular
convolution

1. Draw a circle with N values of x(n) with N equally spaced angles


in a counterclockwise direction.
2. Draw a smaller radius circle with N values of h(n) with equally
spaced angles in a clockwise direction. Superimpose the centers of 2
circles, and have h(0) in front of x(0).
3. Calculate y(0) by multiplying the corresponding values on each
radial line, and then adding the products.
4. Find succeeding values of y(n) in the same way after rotating the
inner disk counterclockwise through the angle 2πk/N
Example to calculate circular convolution

Evaluate the circular convolution, y(n) of 2 signals:


x1(n) = [ 1 2 3 4 ]; x2(n) = [ 0 1 2 3 ]
1 1

0 1
2 3 1 4 2 0 2 4
2 3

3 3
y(0) = 16 y(1) = 18
Example (cont)

1 1

2 3
2 1 3 4 2 2 0 4
0 1

3 3

y(2) = 16 y(3) = 10
Another method to calculate circular
convolution

x1(n) DFT X1(k)


IDFT y(n)
DFT
x2(n) X2(k)

Ex. x1(n) = [ 1 2 3 4 ]; x2(n) = [ 0 1 2 3 ]


X1(k) = [ 10, -2+j2, -2, -2-j2 ];
X2(k) = [ 6, -2+j2, -2, -2-j2 ];
Y(k) = X1(k).X2(k) = [ 60, -j8, 4, j8 ]
y(n) = [ 16, 18, 16, 10 ]
Calculation of the linear convolution

The circular convolution of 2 sequences of length N1 and N2


can be made equal to the linear convolution of 2 sequences
by zero padding both sequences so that they both consists
of N1+N2-1 samples.

Zero padding
x1(n) x’1(n) DFT
(N2-1) zeros
N1 samples IDFT
Zero padding x1(n)*x2(n)
x2(n) x’2(n) DFT
(N1-1) zeros
N2 samples
Example of calculation the linear convolution

x1(n) = [ 1 2 3 4 ]; x2(n) = [ 0 1 2 3 ]
x’1(n) = [ 1 2 3 4 0 0 0 ]; x’2(n) = [ 0 1 2 3 0 0 0 ]
X’1(k) = [ 10, -2.0245-j6.2240, 0.3460+j2.4791, 0.1784-
j2.4220, 0.1784+j2.4220, 0.3460-j2.4791, -2.0245-j6.2240 ];
X’2(k) = [ 6, -2.5245-j4.0333, -0.1540+j2.2383, -0.3216-
j1.7950, -0.3216+j1.7950, -0.1540-j2.2383, -2.5245+j4.0333];
Y’(k) = [ 60, -19.9928+j23.8775, -5.6024+j0.3927, -5.8342-
j0.8644, -4.4049+j0.4585, -5.6024-j0.3927, -19.9928
+j23.8775 ]
IDFT{Y’(k)} = y’(n) = [ 0 1 4 10 16 17 12 ]
HW

Prob.1
Compute the DFT with N time samples:

(a ) x[n ]  [n ]
(b) x[n ]  a {u[n ]  u[n  N]}
n

1 n even
(c) x[n ]  
0 n odd 0  n  N  1
HW

Prob.2
Given the two four-point sequences:

x(n) = [ 1 0.75 0.5 0.25 ]


y(n) = [ 0.75 0.5 0.25 1]

Express the DFT Y(k) in terms of the DFT X(k)


HW

Prob.3
Given signals below and their DFT-5

(a ) x1[n ]  [n  1]  2[n  2]  3[n  3]  4[n  4]


(b) x 2 [n ]  [n  1]
(c) s[n ]  [n ]

1. Find y[n] so that Y[k] = X1[k].X2[k]


2. Does x3[n] exist, if S[k] = X1[k].X3[k]?
HW

Prob.4 Given x(n) and its 8-point DFT, X(k)

1, 0  n  3
x[n ]  
0, 4  n  7
Express the DFTs of the signals below in terms of X(k).
1, n  0

(a ) x1[n ]  0, 1  n  4
1, 5  n  7

0, 0  n  1

(b) x 2 [n ]  1, 2  n  5
0, 6  n  7

HW

Prob.5 The 8-point DFTs of x(n) and h(n) are:


X(k) = [0, -j0.707, -j, -j0.707, 0, j0.707, j, j0.707]
and
H(k) = [3, 2.414, 1, -0.414, -1, -0.414, 1, 2.414]

Find the value of y(2), where y(n) is the circular convolution


of x(n) and h(n).
Lecture 10
Fast Fourier Transform (FFT)

 Duration: 2 hrs
 Outline:
1. What is FFT?
2. The decomposition-in-time Fast Fourier
Transform algorithm
Recall DFT and IDFT definition

N 1
X[k ]   x[n ]WNnk 0  k  N 1
n 0 2
j

1 N 1 WN  e N

x[n ]   X[k ]WN nk 0  n  N 1


N n 0

DFT plays an important role in the analysis, design and


implementation of the DT signal processing algorithms and
systems.
Major reason: existence of efficient algorithms for computing
DFT called FFT
Direct computation of the DFT
N 1
X[k ]   x[n ]W nk
N 0  k  N 1
n 0

The direct computation of the DFT requires:


1. N complex multiplications for each of k
2. N2 complex multiplications for all N points of X(k)
3. (N-1) complex summations for each of k
4. N(N-1) complex summations for all N points of X(k)
 FFT optimize computational processes (1) & (2) in different
algorithms
Decomposition in time FFT (DIT-FFT)

Breaking an N-point DFT into smaller DFTs


 Fewer calculations with the same output
For example: N is radix-2 number

N
 log N complex multiplications
2
N 2 2
Comparing DFT and FFT efficiency
10000
Complex multiplication numbers

8000

6000

4000

2000

DIT-FFT
0

N
-2000
0 10 20 30 40 50 60 70 80 90 100
Computation of DFT
 Some properties of W  nk
N can be exploited

W
k ( N n )
N
W N 
 kn
W knN , complex conjugate symmetry
*

k ( n N ) (k  N )n
W N W N
kn
W N
, periodicit y in n and k

 Other useful properties:


N
(k  )n
nN
 jn
 kn
W N , if n even
W N W W N e 
kn kn
W 2 2

W N , if n odd
kn

N N

W
2 kn kn
W N
N
2
Lecture 10
Fast Fourier Transform (FFT)

 Duration: 2 hrs
 Outline:
1. What is FFT?
2. The decomposition-in-time Fast Fourier
Transform algorithm
DIT-FFT with N as a 2-radix number

 G(k) is N/2 points DFT of the even numbered data: x(0),


x(2), x(4), …., x(N-2).
 H(k) is the N/2 points DFT of the odd numbered data:
x(1), x(3), …, x(N-1).

X [k ]   x[n]W
neven
kn
  x[n]W
nodd
kn
DIT-FFT (cont)
N 1 N 1

X [k ]   x[2m]W 2 mk   x[2m  1]W k (2 m1) 


2 2

m0 m0
N 1 N 1

 
2 2

= x[2 m](W 2 mk
)  W k
x[2 m  1](W ) 
2 mk

m0 m0

W  e
2
N

 j2  / N 2
e  j 2  /( N / 2 )
 WN / 2

X(k)  G(k)  WN H(k), k  0,1,..., N  1


k

G(k) and H(k) are of length N/2; X(k) is of length N


G(k)=G(k+N/2) and H(k)=H(k+N/2)
8-point FFT
X [k ]8  G[k ]4  W8k H [k ]4 DFT N = 4

X[0]  G[0]  W80 H[0]


2
N
X[1]  G[1]  W H[1]
2 2
1
   N  N N  N
2

8 N 2 complex multiplications
2 2 2

X[2]  G[2]  W82 H[2]


DFT N = 4
X[3]  G[3]  W H[3]8
3

X[4]  G[0]  W84 H[0]


X[5]  G[1]  W85 H[1]
X[6]  G[2]  W86 H[2]
X[7]  G[3]  W87 H[3] The new computation counts are reduced
G[0]
W0
DFT N = 2
G[1]
W2
G[2]
W4
DFT N = 2
G[3]
W6

8-point 0
H[0]
W0 W
DFT N = 2
FFT H[1]
W2
(cont) W0 H[2]
W4
DFT N = 2
H[3]
W6
2-point FFT

Wr - r+N/2
W 1

Wr+N/2 = -Wr
8-point
FFT

Now the overall computation is reduced to:

N
 log N complex multiplications
2
N 2 2
HW

Prob.6
(a) Draw an eight-point DIT FFT signal-flow diagram, and use
it to solve for the DFT of the sequence x(n)
x(n) = (0.5) n [u(n) – u(n-8)]

(b) Use Matlab (fft) to confirm the result of part (a)

You might also like