Vous êtes sur la page 1sur 110

CHAPTER 5:

DISCRETE FOURIER TRANSFORM (DFT)


Lesson #19: DTFT of DT periodic signals
Lesson #20: DFT and Inverse DFT
Lesson #21: DFT properties
Lesson #22: Fast Fourier Transform (FFT)
Lesson #23: Applications of DFT/FFT
Lesson #24: Using of DFT/FFT
Lecture #19
DTFT of periodic signals
1. Review of Fourier Transforms (FT)
2. Fourier Series expansions
3. DTFT of periodic signals
FT of CT periodic signals
T
dt e t x
T
a e a t x
t jk
T
k
t jk
k
k
t
e
e e
2
; ) (
1
; ) (
0
0 0
= = =

=
}

Discrete and aperiodic in


frequency domain
Continuous and periodic
in time domain
FT of CT aperiodic signals
Continuous and aperiodic
in time domain
1
Continuous and aperiodic in
frequency domain
FT of DT aperiodic signals
Discrete and aperiodic
in time domain
Continuous and periodic in
frequency with period 2
Recapitulation
Can guess?
Lecture #19
DTFT of periodic signals
1. Review of Fourier Transforms (FT)
2. Fourier Series expansions
3. DTFT of periodic signals

> e<
O O
> e<
= =
N n
n jk
k
n jk
N k
k
e n x
N
a e a n x
0 0
] [
1
; ] [
N
2
0
t
= O
dt e t x
T
a e a t x
t jk
T
k
t jk
k
k
0 0
) (
1
; ) (
e e

=
}

= =
CT periodic signals with period T:
DT periodic signals with period N:
Note: finite sums over an interval length of one periodic N
n ) N k ( j
n
N
2
) N k ( j n
N
2
jk
n jk
0 0
e e e e
O +
t
+
t
O
= = =
T
2
0
t
= e
Fourier Series expansion
Given a DT periodic signals with period N:
Example of Fourier Series expansion
[ ] [ ]
k
p n n kN o

=
= .

N
1
e ] n [ p
N
1
a
1 N
0 n
N / n 2 jk
k
= =

=
t
. . . -2N -N 0 N 2N . . . . .

=
=
1
0
2
] [
N
k
n
N
jk
k
e a n p
t
Lecture #19
DTFT of periodic signals
1. Review of Fourier Transforms (FT)
2. Fourier Series expansions
3. DTFT of periodic signals
CT periodic signals with period T:
DT periodic signals with period N:
DTFT of periodic signals
) k ( a 2 ) ( X e a ) t ( x
0
k
k
F
t jk
k
k
0
e e o t = e =


=
e

=
) k ( a 2 ) ( X ] n [ x
0
k
k
F
O O o t = O

=
. . . -2N -N 0 N 2N . . . . . . . . n
Example of calculating DTFT of
periodic signals
( )


=

=
|
.
|

\
|
t
O o
t
= O O o t = O
k k
0 k
N
2
k
N
2
k a 2 ) ( P
2/N 2/N 2/N 2/N 2/N
. . . -4/N -2/N 0 2/N 4/N . . . .
Height = 1
Spacing = N
Height = 2/N
Spacing = 2/N
Another approach to get DTFT of
periodic signals
0
[ ] 0 1
[ ]
0 otherwise
x n n N
x n
, s s

=

, .

0 N-1
x(n) is periodic signal; x
0
(n) is a part of x(n) that is repeated
Another approach (cont)
0
[ ] 0 1
[ ]
0 otherwise
x n n N
x n
, s s

=

, .

0 0 0
[ ] [ ] [ ] [ ] [ ] [ ]
k k k
x n x n kN x n n kN x n n kN o o

= = =
= = - = -

p(n) in previous
example
0 0
[ ] [ ] [ ] ( ) ( ) ( )
F
x n x n p n X P X = - O O = O
Another approach (cont)
0 0
[ ] [ ] [ ] ( ) ( ) ( )
F
x n x n p n X P X = - O O = O


O =
|
.
|

\
|
O O = O
k
k
N
k
N
k X
N
N
k
N
X X
)
2
( )
2
(
2
)
2
(
2
) ( ) (
0
0
t
o
t t
t
o
t
It has N distinct values at k = 0, 1, , N-1
Inverse DTFT
{ }

}
}

}

=
O
O

=
O
= O O =
O
(

O =
O O = = O
1
0
2
0
2
0
0
2
0
0
2
0
1
)
2
(
1
)
2
( )
2
(
1
)
2
( )
2
(
2
2
1
) (
2
1
] [ ) (
N
k
N
n k
j
k
n j
n j
k
n j
e
N
k X
N
d e
N
k
N
k X
N
d e
N
k
N
k X
N
d e X n x X DFT
t t
t
t
t t
o
t
t
o
t t
t
t
This is obtained from this property of the impulse:

< s
=
}
elsewhere
b t a t f
dt t t t f
b
a
0
) (
) ( ) (
0 0
0
o
Summary
Procedure to calculate DTFT of
periodic signals
Step 1:
Start with x
0
(n) one period of x(n), with zero everywhere else
Step 2:
Find the DTFT X
0
() of the signal x
0
[n] above
Step 3:
Find X
0
() at N equally spacing frequency points X
0
(k2/N)
Step 4:
Obtain the DTFT of x(n):

O = O
k
N
k
N
k X
N
X )
2
( )
2
(
2
) (
0
t
o
t t
Example of calculating DTFT of
periodic signals
O O
=
O
+ + = = O

3
3
0
0 0
2 1 ) ( ) (
j j
n
n j
e e e n x X
k = 0 X
0
(0) = 4; k = 1 X
0
(1) = 1+j
k = 2 X
0
(2) = -2; k = 3 X
0
(3) = 1-j
0 1 2 3
Example (cont)
Example (cont)
a) Draw the magnitude plot of the FT of a CT sinusoid x(t), that
has a frequency of 24 Hz
b) Sample this signal x(t) at 40 Hz. Draw the magnitude plot of
the FT of the sampled signal
c) Reconstruct a CT signal from the samples above with a LPF, it
will look like a CT sinusoid of what frequency?
d) Consider DT signal that is obtained by the sampling x(t) at a
sampling frequency of 40 Hz is x(n). Is x(n) a periodic signal?
If yes, what is its period?
e) Specify the DTFT of the DT signal x(n).
DTFT and DFS example
a) Draw the magnitude plot of the FT of a CT sinusoid x(t), that has
a frequency of 24 Hz

DTFT and DFS examples
b) Sample this signal x(t) at 40 Hz. Draw the magnitude plot of the
FT of the sampled signal
DTFT and DFS examples
c) Reconstruct a CT signal from the samples above with a LPF, it will
look like a CT sinusoid of what frequency?

DTFT and DFS examples
d) Consider DT signal that is obtained by the sampling x(t) at
a sampling frequency of 40 Hz is x(n). Is x(n) a periodic
signal? If yes, what is its period?

DTFT and DFS examples
e) Specify the DTFT of the DT signal x(n).
DTFT and DFS examples
Lecture #20
DFT and inverse DFT
1. DFT and inverse DFT formulas
2. DFT and inverse DFT examples
3. Frequency resolution of the DFT
DFT to the rescue!
Both CTFT and DTFT produce continuous function of
frequency cant calculate an infinite continuum of frequencies
using a computer
Most real-world data is not in the form like a
n
u(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
Could we calculate the frequency spectrum of a signal
using a digital computer with CTFT/DTFT?
Building the DFT formula
Window x(n) is like multiplying
the signal by the finite length
rectangular window
Discrete time
signal x(n)
Continuous time
signal x(t)
Discrete time
signal x
0
(n)
Finite length
sample
window
Building the DFT formula (cont)
Discrete time
signal x(n)
Continuous time
signal x(t)
Discrete time
signal x
0
(n)
Finite length
sample
window
DTFT


=
O

=
O
= = O
1
0
0 0 0
] [ ] [ ) (
N
n
n j
n
n j
e n x e n x X
Building the DFT formula (cont)
Discrete time
signal x(n)
Continuous time
signal x(t)
Discrete time
signal x
0
(n)
Finite length
sample
window
DTFT
Sample
at N
values
around
the unit
circle
Discrete Fourier Transform DFT X(k)
Discrete + periodic with period N
X
0
()
Continuous + periodic
with period 2
Notation conventions
Notation conventions (cont)
DFT and inverse DFT formulas
Notation
You only have to store N points
N
2
j
N
e W
t

=
Lecture #20
DFT and inverse DFT
1. DFT and inverse DFT formulas
2. DFT and inverse DFT examples
3. Frequency resolution of the DFT
DFT and IDFT examples
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
DFT and IDFT examples
Ex.2. Given y(n) = (n-2) and N = 8, find Y(k)
DFT and IDFT examples
Ex.3. Find the IDFT of X(k) = 1, k = 0, 1, , 7.
DFT and IDFT examples
Ex.4. Given x(n) = (n) + 2(n-1) +3(n-2) + (n-3) and
N = 4. Find X(k).
DFT and IDFT examples
Ex.5. Given X(k) = 2(k) + 2(k-2) and N = 4. Find x(n).
DFT in matrix forms
(
(
(
(
(

=
(
(
(
(

=
(
(
(
(

=
= =

) 1 )( 1 ( ) 1 ( 2 1
) 1 ( 2 1
1
0
1
1
1 1 1 1
] 1 [
] 1 [
] 0 [
] 1 [
] 1 [
] 0 [
: '
1 ,..., 1 , 0 ] [ ] [
N N
N
N
N
N
N
N
N N N
N
N N
N
n
kn
N
W W W
W W W
W
N X
X
X
X
N x
x
x
x
define s Let
N k W n x k X


The N-point DFT
may be expressed
in matrix form as:
X
N
= W
N
x
N

IDFT in matrix forms
(
(
(
(
(

=
(
(
(
(

=
(
(
(
(

=
= =

) 1 )( 1 ( ) 1 ( 2 1
) 1 ( 2 1
1
0
1
1
1 1 1 1
] 1 [
] 1 [
] 0 [
] 1 [
] 1 [
] 0 [
: '
1 ,..., 1 , 0 ] [
1
] [
N N
N
N
N
N
N
N
N N N
N
N N
N
k
kn
N
W W W
W W W
W
N X
X
X
X
N x
x
x
x
define s Let
N n W k X
N
n x


The N-point DFT
may be expressed
in matrix form as:
matrix identity I
NI W W
X W
N
X W x
N
N N N
N N N N N
:
1
*
* 1
=
= =

Example of calculation of DFT in matrix form
Find DFT of the signal
x[n] =
[n-1] + 2[n-2] + 3[n-3]
(
(
(
(

+
= =
(
(
(
(




=
(
(
(
(
(

=
(
(
(
(

=
j
j
x W X Then
j j
j j
W W W
W W W
W W W
W
x
define s Let
2 2
2
2 2
6
.
1 1
1 1 1 1
1 1
1 1 1 1
1
1
1
1 1 1 1
3
2
1
0
: '
4 4 4
9
4
6
4
3
4
6
4
4
4
2
4
3
4
2
4
1
4
4
4
Lecture #20
DFT and inverse DFT
1. DFT and inverse DFT formulas
2. DFT and inverse DFT examples
3. Frequency resolution of the DFT
Discrete frequency spectrum computed from DFT has the
spacing between frequency samples of:
Frequency resolution of the DFT
N
f
f
s
= A
N
2t
= AO
The choice of N determines the resolution of the frequency
spectrum, or vice-versa
To obtain the adequate resolution:
1. Increasing of the duration of data input to the DFT
2. Zero padding, which adds no new information, but effects a better
interpolator

0 0.5 1 1.5 2 2.5 3 3.5 4
0
1
2
3
4
5
0 1 2 3 4 5 6 7 8 9 10
0
1
2
3
4
5
0 5 10 15 20 25 30
0
1
2
3
4
5
Examples of N = 5 and N = 15

0 0.5 1 1.5 2 2.5 3 3.5 4
0
2
4
6
0 5 10 15 20 25 30
0
2
4
6
0 10 20 30 40 50 60
0
2
4
6
Examples of N = 15 and N = 30
Lecture #21
DFT properties
1. Periodicity and Linearity
2. Circular time shift
3. Circular frequency shift
4. Circular convolution
5. Multiplication
6. Parsevals theorem

DFT properties
x(n)
Finite length
x
p
(n)
Periodic
N periodic extension
truncate
N periodic extension
truncate
X(k)
Finite length
X
p
(k)
Periodic
D
F
T

D
F
T
-
1

X
p
()
Periodic
DTFT
DTFT
-1

DFT properties
x(n)
Finite length
x
p
(n)
Periodic
N periodic extension
truncate
N periodic extension
truncate
X(k)
Finite length
X
p
(k)
Periodic
D
F
T

D
F
T
-
1

X
p
()
Periodic
DTFT
DTFT
-1

Periodicity
x[n+N] = x[n] for all n
X[k+N] = X[k] for all k
If x[n] and X[k] are an N-point DFT pair, then
Linearity
Note: The length of x
1
[n] is same with the length of x
2
[n]
] [ ] [ ] [ ] [
2 2 1 1 2 2 1 1
k X a k X a n x a n x a
DFT
+ +
Proof:
Infer from the definition formula of DFT
Lecture #21
DFT properties
1. Periodicity and Linearity
2. Circular time shift
3. Circular frequency shift
4. Circular convolution
5. Multiplication
6. Parsevals theorem

Circular time shift property
] k [ X W ] m n [ x
km
DFT

Proof:
Infer from the relation between DFT and DTFT
] [ ] [ ) (
:
2
) ( ] [
2
k X W k X e X e
N
k
X e m n x
km
m
N
jk
m j
m j
DTFT
= O
O
O

O
O
t
t
Circular

time

shift

Circular shift by m is the same as a shift by m modulo N
x(n)
x
p
(n)
x
p
(n+2)
x(n+2)
Lecture #21
DFT properties
1. Periodicity and Linearity
2. Circular time shift
3. Circular frequency shift
4. Circular convolution
5. Multiplication
6. Parsevals theorem

Circular frequency shift property
] [ ] [
ln
l k X W n x
DFT

Proof:
Similar to the circular time shift property
Lecture #21
DFT properties
1. Periodicity and Linearity
2. Circular time shift
3. Circular frequency shift
4. Circular convolution
5. Multiplication
6. Parsevals theorem
Circular convolution property
The non-zero length of x
1
(n) and x
2
(n) can be no longer
than N
The shift operation is circular shift
The flip operation is circular flip

=
=
1
0
2 1 2 1 2 1
] [ ] [ ] [ ] [ ] [ ]. [
N
p
DFT
p n x p x n x n x k X k X
The circular convolution is not the linear convolution in chapter 2
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 2k/N
Example to calculate circular convolution
Evaluate the circular convolution, y(n) of 2 signals:
x
1
(n) = [ 1 2 3 4 ]; x
2
(n) = [ 0 1 2 3 ]
1
2
3
4
0
1
2
3
y(0) = 16
1
2
3
4
1
2
3
0
y(1) = 18
Example (cont)
Evaluate the circular convolution, y(n) of 2 signals:
x
1
(n) = [ 1 2 3 4 ]; x
2
(n) = [ 0 1 2 3 ]
1
2
3
4
2
3
0
1
y(2) = 16
1
2
3
4
3
0
1
2
y(3) = 10
Another method to calculate circular convolution
x
1
(n)
x
2
(n)
X
1
(k)
X
2
(k)
DFT
DFT
IDFT
y(n)
Ex. x
1
(n) = [ 1 2 3 4 ]; x
2
(n) = [ 0 1 2 3 ]
X
1
(k) = [ 10, -2+j2, -2, -2-j2 ];
X
2
(k) = [ 6, -2+j2, -2, -2-j2 ];
Y(k) = X
1
(k).X
2
(k) = [ 60, -j8, 4, j8 ]
y(n) = [ 16, 18, 16, 10 ]
Lecture #21
DFT properties
1. Periodicity and Linearity
2. Circular time shift
3. Circular frequency shift
4. Circular convolution
5. Multiplication
6. Parsevals theorem
Multiplication
The non-zero length of X
1
(k) and X
2
(k) can be no longer
than N
The shift operation is circular shift
The flip operation is circular flip

=
=
1
0
2 1 2 1 2 1
] [ ] [
1
] [ ] [
1
] [ ]. [
N
l
DFT
l k X l X
N
k X k X
N
n x n x
Lecture #21
DFT properties
1. Periodicity and Linearity
2. Circular time shift
3. Circular frequency shift
4. Circular convolution
5. Multiplication
6. Parsevals theorem
Parsevals theorem
The general form:



Special case:


=

=
=
1
0
1
0
] [ * ] [
1
] [ * ] [
N
k
N
n
k Y k X
N
n y n x


=

=
=
1
0
2
1
0
2
| ] [ |
1
| ] [ |
N
k
N
n
k X
N
n x
Parsevals theorem example
Given x(n) = (n) + 2(n-1) +3(n-2) + (n-3) and N = 4.

=
= = + + + + + =
= + + + =
1
0
2 2 2 2 2 2 2
2 2 2 2
1
0
2
15
4
60
) 1 2 1 1 2 7 (
4
1
| ] [ |
1
15 1 3 2 1 | ] [ |
N
k
N
n
k X
N
n x
Lecture #22
Fast Fourier Transform (FFT)
1. What is FFT?
2. The decomposition-in-time Fast Fourier
Transform algorithm (DIT-FFT)
3. The decomposition-in-frequency Fast
Fourier Transform algorithm (DIF-FFT)
Using some "tricks" and choosing the appropriate N value, the DFT
can be implemented in a very computationally efficient way this is
the Fast Fourier Transform (FFT) - which is the basis of lots of
contemporary DSP hardware
N
2
j
N
e W
t

=
1 N n 0 W ] k [ X
N
1
] n [ x
1 N k 0 W ] n [ x ] k [ X
1 N
0 n
nk
N
1 N
0 n
nk
N
s s =
s s =

=
Recall DFT and IDFT definition
N
th
complex
root of unity:
What does it take to compute DFT or IDFT?
N
2
complex multiplications for all N points of X(k) or x[n]
FFT: the algorithm to optimize the computational process by
breaking the N-point DFT into smaller DFTs
Ex.: N is a power of 2: split N-point DFT into two N/2-point DFTs,
then split each of these into two of length N/4, etc., until we
have N/2 subsequences of length 2
Cooley and Tukey (1965):
Fast Fourier Transform (FFT)
tions multiplica complex
2
log
2
2
N
N
N

0 10 20 30 40 50 60 70 80 90 100
-2000
0
2000
4000
6000
8000
10000
N C
o
m
p
l
e
x

m
u
l
t
i
p
l
i
c
a
t
i
o
n

n
u
m
b
e
r
s

FFT
Comparison of DFT and FFT efficiency
Comparison of DFT and FFT efficiency
Number of Complex multiplications Complex multiplications Speed improvement
points N in direct DFT in FFT factor
4
8
16
32
64
128
256
512
1024
16
64
256
1,024
4,096
16,384
65,536
262,144
1,048,576
4
12
32
80
192
448
1,024
2,304
5,120
4.0
5.3
8.0
12.8
21.3
36.6
64.0
113.8
204.8
Some properties of can be exploited in performing
FFT:



Other useful properties:
{ }
W
nk
N
( )
k and n in y periodicit ,
symmetry conjugate complex ,
) ( ) (
*
) (
W W W
W
W W
n N k
N
N n k
N
kn
N
kn
N
n N k
N
kn
N
+ +

= =
= =
W W
W
W
e W W W W
kn
N
kn
N
kn
N
kn
N
jn kn
N
nN
N
kn
N
n
N
k
N
2
2
2
)
2
(
odd n if ,
even n if ,
=

= = =

+ t
FFT (cont)
Lecture #22
Fast Fourier Transform (FFT)
1. What is FFT?
2. The decomposition-in-time Fast
Fourier Transform algorithm (DIT-FFT)
3. The decomposition-in-frequency Fast
Fourier Transform algorithm (DIF-FFT)
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).
even odd
[ ] [ ] [ ]
kn kn
n n
X k x n W x n W = +

DIT-FFT with N as a 2-radix number
1 N ,..., 1 , 0 k ), k ( H ) k ( G ) k ( X
W
k
N
= + =
We divide X(k) into 2 parts:
2 2
1 1
2 (2 1)
0 0
[ ] [2 ] [2 1]
N N
mk k m
m m
X k x m W x m W

+
= =
= + + =

2 2
1 1
2 2
0 0
[2 ]( ) [2 1]( )
N N
mk k mk
m m
x m W W x m W

= =
+ + =

=
( )
2 / N
) 2 / N /( 2 j
2
N / 2 j 2
N
W e e W = = =
t t
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)
) ( ) ( ] [ ] [ ) (
1
0
2 /
1
0
2 /
2 2
k H k G W m h W W m g k X
W
k
N
m
mk
N
k
N
m
mk
N
N N
+ = + =


=

=
DIT-FFT (cont)
Note:
4
k
8 4 8
] k [ H W ] k [ G ] k [ X + =
] 3 [ H W ] 3 [ G ] 7 [ X ] 3 [ H W ] 3 [ G ] 3 [ X
] 2 [ H W ] 2 [ G ] 6 [ X ] 2 [ H W ] 2 [ G ] 2 [ X
] 1 [ H W ] 1 [ G ] 5 [ X ] 1 [ H W ] 1 [ G ] 1 [ X
] 0 [ H W ] 0 [ G ] 4 [ X ] 0 [ H W ] 0 [ G ] 0 [ X
7
8
3
8
6
8
2
8
5
8
1
8
4
8
0
8
+ = + =
+ = + =
+ = + =
+ = + =
DIT-FFT of length N = 8
DFT
N = 4
DFT
N = 4
# complex multiplications are reduced: 8
2
= 64 2x(4)
2
+ 8 = 40
Signal
flow
graph
for
8-point
FFT
2 4 2 4
] [ ] [ ] [ k H W k G k X
k
+ =
DIT-FFT of length N = 4
] 1 [ ] 1 [ ] 3 [
] 0 [ ] 0 [ ] 2 [
] 1 [ ] 1 [ ] 1 [
] 0 [ ] 0 [ ] 0 [
3
4
2
4
1
4
0
4
H W G X
H W G X
H W G X
H W G X
+ =
+ =
+ =
+ =
] 1 [ ] 1 [ ] 3 [
3
4
H W G X + =
] 1 [ ] 1 [ ] 1 [
1
4
H W G X + =
] 0 [ ] 0 [ ] 2 [
2
4
H W G X + =
] 0 [ ] 0 [ ] 0 [
0
4
H W G X + =
DFT
N = 2
DFT
N = 2
W
0

x[0]
x[2]
x[1]
x[3]
W
1

W
2

W
3

# multiplications are reduced: 4
2
= 16 2x(2)
2
+ 4 = 12
DIT-FFT of length N = 2
# multiplications are
reduced: 2
2
= 4 0;
just 2 additions!!!
x[1] - 1
x[0]
X[0]
X[1]
] 1 [ ] 0 [ ] 1 [ ] 0 [ ] 1 [
] 1 [ ] 0 [ ] 1 [ ] 0 [ ] 0 [
1 , 1 0 , ] [ ] [
1 . 1 1 . 0
0 . 1 0 . 0
2
2
1
0
x x W x W x X
x x W x W x X
e W k W n x k X
j
n
nk
= + =
+ = + =
= = s s =

=

t
Butterfly diagram
DFT
N = 4
DFT
N = 4
First step: split 8-point DFT into two 4-point DFTs
Example

of

8-point

FFT
0
W
0
W
W
4

W
2

W
0

W
0

W
6

W
6

W
2

W
4

DFT N = 2
DFT N = 2
DFT N = 2
DFT N = 2
G[0]
G[1]
G[2]
G[3]
H[0]
H[1]
H[2]
H[3]
Example

of

8-point

FFT

(cont)
Second step: split each of 4-point DFT into two 2-point DFTs
Example

of

8-point

FFT

(cont)
0
W
0
W
W
4

W
2

W
0

W
0

W
6

W
6

W
2

W
4

Third step: combine all signal flow graphs of step 1 and step 2
W
0

W
1

W
2

W
3

W
4

W
5

W
6

W
7

There are 3 = log
2
8 stages; 4 butterfly diagrams in each stage
W
r+N/2
= -W
r

W
r
- 1
Butterfly diagram
Now the overall computation is reduced to:
tions multiplica complex
2
log
2
2
N
N
N

The
overall
signal
flow
graph
for
8-point
DIT-FFT
W
r
- 1
In-place computation
a
b
A
B
Each butterfly takes (a,b) to produce (A,B) no need to save
(a,b) can store (A,B) in the same locations as (a,b)
We need 2N store registers to store the results at each stage and
these registers are also used throughout the computation of the
N-point DFT
The order of the input: bit-reversed order
The order of the output: natural order
Lecture #22
Fast Fourier Transform (FFT)
1. What is FFT?
2. The decomposition-in-time Fast Fourier
Transform algorithm (DIT-FFT)
3. The decomposition-in-frequency Fast
Fourier Transform algorithm (DIF-FFT)
Rewrite the second half:
DIF-FFT with N as a 2-radix number
( )


=

=
+

=
|
.
|

\
|
+ =
|
.
|

\
|
+ =
1 ) 2 / (
0
1 ) 2 / (
0
1
) 2 / (
2 2
) (
2 2
N
n
kn
N
k
N
N
n
n k
N
N
N n
kn
N
W
N
n x W W
N
n x W n x
N N
1 ,..., 1 , 0 , ) ( ) ( ) (
1 ) 2 / (
0
1
) 2 / (
= + =

=
N k W n x W n x k X
N
n
N
N n
kn
N
kn
N
k j N N k j
k
N
e e W
N
) 1 (
) 2 / )( / 2 (
2
= = =
t t
We divide X(k) in half first half and second half
Since:
then
| | 1 ,..., 1 , 0 , ) 2 / ( ) 1 ( ) ( ) (
1 ) 2 / (
0
= + + =

=
N k W N n x n x k X
N
n
kn
N
k
DIF-FFT (cont)
| |
| | { } 1
2
,..., 1 , 0 , ) 2 / ( ) ( ) 1 2 (
1
2
,..., 1 , 0 , ) 2 / ( ) ( ) 2 (
1 ) 2 / (
0
2 /
1 ) 2 / (
0
2 /
= + = +
= + + =

=
N
k W W N n x n x k X
N
k W N n x n x k X
N
n
kn
N
n
N
N
n
kn
N
1
2 /
2
N N
W W =
Decompose X(k) into two frequency sequences, even and odd:
Since:
then,
| |
| | 1
2
,..., 1 , 0 , ) 2 / ( ) ( ) 1 2 (
1
2
,..., 1 , 0 , ) 2 / ( ) ( ) 2 (
1 ) 2 / (
0
) 1 2 (
1 ) 2 / (
0
2
= + = +
= + + =

=
+

=
N
k W N n x n x k X
N
k W N n x n x k X
N
n
n k
N
N
n
kn
N
DIF-FFT butterfly
x[n]
x[n+N/2]
x[n] + x[n+N/2]
(x[n] - x[n+N/2])W
N
n

-1
W
N
n

DIF-FFT of length N = 4
-1
-1
-1
-1
W
4
1

W
4
0

x[0] + x[2]
x[1] + x[3]
(x[0] - x[2])W
4
0

(x[1] - x[3])W
4
1

x[0]
x[1]
x[2]
x[3]
X[0]
X[2]
X[1]
X[3]
Lecture #23
DFT applications
1. Approximation of the Fourier Transform
of analog signals
2. Linear convolution
Approximation of Fourier Transform
Using DFT as a discrete-frequency approximation of the DTFT
and also an approximation of the CTFT
Step1. Determine the resolution = 2/N required for the DFT to
be useful for its intended purpose determine N (N often = 2
n
)
Step 2. Determine the sampling frequency required to sample the
analog signal so as to avoid aliasing
s
2
M

Step 3. Accumulate N samples of the analog signal over N.T
seconds (T = 2/
s
)
Step 4. Calculate DFT directly or using FFT algorithm
0 0.5 1 1.5 2 2.5 3
0
0.5
1
n
f
[
n
]
0 1 2 3 4 5
0
1
2
3
omega
m
a
g
n
i
t
u
d
e
Example
f(t) = rect[(t-1)/2]
F() = 2sinc()e
-j
T
s
= 1s
%Error of sample 1 = 50%
Example
0 5 10 15
0
0.5
1
n
f
[
n
]
0 5 10 15 20 25 30
0
1
2
3
omega
m
a
g
n
i
t
u
d
e
f(t) = rect[(t-1)/2]
F() = 2sinc()e
-j
T
s
= 0.2s
%Error of sample 1 = 10%
0 5 10 15 20 25 30 35
0
0.5
1
n
f
[
n
]
0 10 20 30 40 50 60 70
0
1
2
3
omega
m
a
g
n
i
t
u
d
e
Example
f(t) = rect[(t-1)/2]
F() = 2sinc()e
-j
T
s
= 0.1s
%Error of sample 1 = 5%
Windowing
Source of error: truncation or windowing of the periodic
extension of the DT sequence implied in the DFT development
Windowing = multiplying the periodic extension of x[n] by a
rectangular function with duration N.T DFT involves a convolution
DFT = sampled(DTFT*sinc)
This multiplication causes spectrum-leakage distortion
To reduce the affect of spectrum-leakage distortion:
- Increase the sampling frequency
- Increase the number of samples
- Choose an appropriate windowing function (Hamming, Hanning)
Lecture #23
DFT applications
1. Approximation of the Fourier Transform of
analog signals
2. Linear convolution
Recall linear convolution
N
1
: the non-zero length of x
1
(n); N
2
: the non-zero
length of x
2
(n); N
y
= N
1
+ N
2
-1
The shift operation is the regular shift
The flip operation is the regular flip

=
= =
p
p n x p x n x n x n y ] [ ] [ ] [ * ] [ ] [
2 1 2 1
Recall circular convolution
The non-zero length of x
1
(n) and x
2
(n) can be no longer
than N
The shift operation is circular shift
The flip operation is circular flip

=
= =
1
0
2 1 2 1
] [ ] [ ] [ ] [ ] [
N
p
p n x p x n x n x n y
Calculation of the linear convolution
The circular convolution of 2 sequences of length N
1
and N
2

can be made equal to the linear convolution of 2 sequences
by zero padding both sequences so that they both consists
of N
1
+N
2
-1 samples.
x
1
(n)
N
1
samples
x
2
(n)
N
2
samples
x
1
(n)
x
2
(n)
Zero padding
(N
2
-1) zeros
IDFT
x
1
(n)*x
2
(n)
Zero padding
(N
1
-1) zeros
DFT
DFT
Example of calculation of the linear convolution
x
1
(n) = [ 1 2 3 4 ]; x
2
(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 ]
Lecture #24
Using DFT/FFT in filtering
The response, y(n) of a filter with the impulse response, h(n)
to an input, x(n) can be calculated by using the DFT
Limitations: All sample values of the signal must be
accumulated before the process begins
Great memory
Long time delay
Not suitable for long duration input
Solution: block filtering
Divide long input signal, x(n) into non-overlapped blocks,
x
b
(n) of appropriate length for FFT calculation.
Convolve each block x
b
(n) and h(n) to get the output,
y
b
(n)
Overlap-add outputs, y
b
(n) together to form the output
signal, y(n)
Overlap-add technique in block filtering
Example of overlap-add technique
h(n)
x(n)
Example of overlap-add technique
x
0
(n)
x
1
(n)
x
2
(n)
Example (cont)
y
0
(n)
y
1
(n)
y
2
(n)

Vous aimerez peut-être aussi