You are on page 1of 23

# EE 422G Notes: Chapter 10

Instructor: Zhang

## Chapter 10 The Discrete Fourier Transform and

Fast Fourier Transform Algorithms
10-1 Introduction
1. x(t) --- Continuous-time signal
X(f) --- Fourier Transform, frequency characteristics
Can we find

X ( f ) =x (t )e j 2ft dt

## if we dont have a mathematical equation for x(t) ? No!

2. What can we do?
(1) Sample x(t) =>
x0, x1, , xN-1 over T (for example 1000 seconds)
Sampling period (interval) t
N (samples) over T => t = T / N
Can we have infinite T and N? Impossible!

N 1

j 2kn / N
=> X k = x n e

k = 1, 2,..., N

n =0

## for the line spectrum at frequency k = (2 )

3. Limited N and T =>
limited frequency resolution 2

k
T

1
T

## limited frequency band (from to in Fourier transform to):

1

0 < 2N / T

N 1

j 2kn / N
4. xn = N X k e
---- periodic function (period N)
k =0
x(t) --- general function
sampling and inverse transform
xn --- periodic function

5. X k

( k = 2

Xk =

N 1

k
T

line spectrum)

xn e j 2kn / N

n =0

Page 10-1

## EE 422G Notes: Chapter 10

Instructor: Zhang

## 10-2 Error Sources in the DFT

1. Preparations
(1) Ideal sampling waveform

y s (t ) =

(t mTs ) :

m =

y s (t ) f s ( f nf s )
=
n

( fs =

1
)
Ts

Fourier
Transform
Pair

in DFT Ts = t = T / N
(2) Rectangular Pulse (window)

t t 0
) T sin c (Tf )e j 2t0 f
T

width
of
the
window

when t0 = 0

Center of the
window
sin x
x
sin Tf
sin c (Tf ) =
Tf
sin cX =

t
( ) T sin c (Tf )
T

(3) x1 (t ) * x2 (t ) X 1 ( f ) X 2 ( f )
(4) x1 (t ) x2 (t ) X 1 ( f ) * X 2 ( f )

## 2. Illustration of Error Sources

Example 10-1: Continuous time signal: two-sided exponential signal
x (t ) = e

|t |

Page 10-2

## EE 422G Notes: Chapter 10

Instructor: Zhang
2
1 + (2f ) 2
( ,+)

in

X(f ) =

not

lim ited

as

in

DFT

## with sampling frequency fs :

|t |

sampled signal x (t ) = y (t )e
s
s
its Fourier transform:
X s ( f ) = Ys ( f ) * F ( e
X s ( f ) = fs

|t |

) = Ys ( f ) * X ( f )

X ( f nf s ) = 2f s

n =

1 + (2 ( f

n =

nf s )) 2

## sampling => (1) possible overlapping if f s 2 f h is not held.

(2) periodic function, introduce frequencies beyond fs .
(2) Limited T (over which x(t) is sampled to collect data for DFT)
t
)
T
t
x sw (t ) = x s (t )( )
T

window

X sw ( f ) = ( 2f s

{1 + 2 ( f

n =

nf s ) 2 }1 ) * (T sin c(Tf ))

## Fourier transform given by sampled data in limited window (T)

X sw ( f ) is a worse estimate of X(f) than Xs(f) due to the introduction of
( Tsinc( Tf ) ) for convolution!
Effect of limited T
X
(
f
)
(3) Dose DFT give s
for every f ?
No! only discrete frequencies.
DFT as an estimate for X(f): even worse than X s ( f ) due to the limited
frequency resolution.

Page 10-3

## EE 422G Notes: Chapter 10

Instructor: Zhang

## 3. Effect of sampling frequency (or number of points) on accuracy when T is

given: Example
t
( )
4

|t |

for e
4. Effect of T (window size)
use

Compare

t
( )
4

and

t
( )
8

|t |

for e

Page 10-4

## EE 422G Notes: Chapter 10

Instructor: Zhang

Page 10-5

## EE 422G Notes: Chapter 10

Instructor: Zhang

5. DFT Errors
(1) Aliasing
X s ( f ) = fs

X ( f

n =

## superposition of the analog signal

spectrum X(f) and its translates (X(f-nfs)
n0)

nf s )

Caused by sampling
Overlapping of X(f) and its translates: aliasing (sampling effect)
(2) Leakage Effect
limited window size T

( ( T ) )

t
X s ( f ) = X s ( f ) * F (( ))
T

t
( f ) = F (( ))
T

## worse than Xs(f) as approximation of X(f).

X s ( f ) : contribution of X s ( f + f ) to X s ( f ) : determined by

weight (f )
frequency energy leaks from one frequency to another!

## (3) Picket Fence Effect:

As an estimation of X(f), does X s ( f ) have picket fence effect? No!
DFT: discrete frequencies (not blocked by the fence).
6. Minimization of DFT Error Effects.

## Major ways: increase T and fs

Problem: DFT for large N.

## 10-3 Examples Illustrating the computation of the DFT

(Preparation for Mathematical Derivation of FFT)
Page 10-6

## EE 422G Notes: Chapter 10

Instructor: Zhang

1. DFT Algorithm
N 1

X ( k ) = x ( n )e

= x ( n ) e j 2 / N

n =0

Denote WN = e
X (k ) =

N 1

j 2kn / N

n =0

j 2 / N

nk

, then

N 1

x(n)WN nk

n =0

Properties of WN m :
(1) WN 0 = (e j 2 / N )0 = e 0 = 1,
N +m
m
= WN
(2) W N

WN N = e j 2 = 1

WN N + m = (e j 2 / N ) N + m
= (e j 2 / N ) N (e j 2 / N ) m
= 1 (e j 2 / N ) m = WN m

(3) WN N / 2 = e j 2 /( N / 2) / N = e j = 1

WN N / 4 = e j 2 /( N / 4) / N = e j / 2 = j
WN

3N / 4

= e j 2 /(3 N / 4) / N = e j 3 / 2 = j

2. Examples
Example 10-3: Two-Point DFT
1

nk
x(0), x(1): X (k ) = x(n)W2

k = 0,1

n =0

n =0

n =0

## X (0) = x(n)W2 n 0 = x(n) = x(0) + x(1)

1

X (1) = x (n)W2
n =0

n1

= x (n)W2
n =0

= x(0)W2 + x(1)W2
= x(0) + x(1)W2

(1 / 2 ) 2

= x(0) + x(1)(1)
= x(0) x(1)

## Example 10-4: Generalization of derivation in example 10-3 to a four-point DFT

x(0), x(1), x(2), x(3)
X (k ) =

x(n)W4 nk

k = 0,1 ,2,3,

n =0

Page 10-7

## EE 422G Notes: Chapter 10

X ( 0) =

Instructor: Zhang

n =0

n =0

3

n

n =0

3

X ( 2) = x(n)W4

2n

n =0

3

X (3) = x( n)W4

3n

n =0

3

## = x(0) + jx(1) + ( 1) x( 2) + ( j ) x (3)

= x(0) + jx(1) x ( 2) jx (3)
X (0) =[ x (0) + x ( 2)] +[ x (1) + x (3)]

## X (1) =[ x (0) x ( 2)] +( j )[ x (1) x (3)]

X ( 2) =[ x (0) + x ( 2)] [ x (1) + x (3)]
X (3) =[ x (0) x ( 2)] + j[ x (1) x (3)]

## Two point DFT

If we denote z(0) = x(0), z(1) = x(2) => Z(0) = z(0) + z(1) = x(0) + x(2)
Z(1) = z(0) - z(1) = x(0) - x(2)
v(0) = x(1), v(1) = x(3) => V(0) = v(0) + v(1) = x(1) + x(3)
V(1) = v(0) - v(1) = x(1) - x(3)
Four point DFT

Two-point DFT

## X(0) = Z(0) + V(0)

X(1) = Z(1) + (-j)V(1)
Page 10-8

## EE 422G Notes: Chapter 10

Instructor: Zhang

## X(2) = Z(0) - V(0)

X(3) = Z(1) + jV(1)

## 10-4 Mathematical Derivation of the FFT

10-4A Decimation-in-Time FFT Algorithm
x(0), x(1), , x(N-1)

g
(
0
),
g
(
1
),

,
g
(
1)

## (( x(0), x (2),, x( N 2))

=>
h(0), h(1),, h( N 1)

2
(( x(1), x(3),, x( N 1))

N = 2m

N
po int s
2
( g ( r ) = x (2r ))
N
odd
po int s
2
(h( r ) = x(2r + 1))

enen

Page 10-9

## EE 422G Notes: Chapter 10

N 1

X (k ) = x( n)W N

Instructor: Zhang
kn

n =0

N / 2 1

g (r )WN

k (2r )

N / 2 1

h(r )W

r =0

N / 2 1

g (r )WN

r =0

2 kr

+ WN

r =0

WN

2 kr

k ( 2 r +1)

(k = 0,1,..., N 1)

N / 2 1

h(r )W
r =0

2 kr
N

= (e j 2 . / N ) 2 kr = (e j 2 /(. N / 2 ) ) kr = W N

kr

X (k ) =

N / 2 1

g (r )W
r =0

kr
N /2

+WN

N / 2 1

h(r )W
r =0

kr
N /2

= G ( k ) + W N H (k )

( G(k): N/2 point DFT output (even indexed), H(k) : N/2 point DFT
output (odd indexed))
X ( k ) = G ( k ) + WN k H ( k )
G (k ) =

N / 2 1

r =0

H (k ) =

g ( r )WN / 2

N / 2 1

r =0

kr

h ( r )WN / 2 kr =

k = 0,1,..., N 1
N / 2 1

r =0

N / 2 1

r =0

x ( 2r )WN / 2

kr

x ( 2r + 1)WN / 2 kr

## Question: X(k) needs G(k), H(k), k= N-1

How do we obtain G(k), H(k), for k > N/2-1 ?
G(k) = G(N/2+k)
k <= N/2-1
H(k) = H(N/2+k)
k <= N/2-1

Page 10-10

## EE 422G Notes: Chapter 10

Future Decimation
g(0), g(1), , g(N/2-1)
h(0), h(1), , h(N/2-1)
N
g (0), g ( 2), , g (
2)
2
N
ge(0), ge(1),...ge(
1)
4
N
g (1), g (3), , g (
1)
2
N
go(0), go(1),...go(
1)
4

Instructor: Zhang

G(k)
H(k)
G (k ) =

N / 2 1

g (r )W
r =0

N / 4 1

ge(m)W

km

( N / 4)

m =0

+W( N / 2 )

kr

( N / 2)

N / 4 1

go(m)W

m =0

km
( N / 4)

= GE ( k ) +W( N / 2 ) Go( k )

even indexed g
(N/4 point)

odd indexed g
(N/4 point)

WN / 2 k = WN 2 k ?

Page 10-11

## EE 422G Notes: Chapter 10

Instructor: Zhang

WN / 2 k = ( e j 2 /( N / 2 ) ) k
= ( e j 2 2 / N ) k = ( e j 2 / N ) 2 k
= WN 2 k

=> G ( k ) = GE ( k ) + WN 2 k Go( k )
Similarly,
H ( k ) = HE ( k ) + WN 2 k Ho(k )

even indexed
h (N/4 point)

odd indexed
h (N/4 point)

For 8 point
g ( 0)

x ( 0)

ge( 0)

g (1)

x ( 2)

go (0)

g ( 2)

x ( 4)

ge(1)

g ( 3)

x ( 6)

go(1)

h ( 0)

x (1)

he( 0)

h (1)

x ( 3)

ho(0)

h ( 2)

x (5)

he(1)

h ( 3)

x ( 7)

ho(1)

Page 10-12

## EE 422G Notes: Chapter 10

Instructor: Zhang

## 10-4B Decimation-in-Frequency FFT Algorithm

x(0), x(1), , x(N-1)
N 1

X ( k ) = x ( n)W N

N = 2m

nk

n =0

N / 2 1

x(n)W N

nk

n =0

N 1

x(n)W

n =N / 2

nk
N

Page 10-13

## EE 422G Notes: Chapter 10

Instructor: Zhang

## n = N-1 => m = N-1-N/2 = N/2-1

X (k ) =

N / 2 1

n =0

N / 2 1

n =0

x ( n )WN nk +

x ( n )WN nk +

N / 2 1

m =0

N / 2 1

m =0

x ( N / 2 + m )WN ( N / 2 + m ) k
N

x ( N / 2 + m )WN mkWN 2 k

WN 2 = 1 WN 2 k = ( 1) k
X (k ) =

N / 2 1

n =0

N / 2 1

n =0

x ( n )WN nk +

N / 2 1

m =0

( 1) k x ( N / 2 + m )WN mk

[ x ( n ) + ( 1) k x ( N / 2 + n )]WN nk

k : even (k = 2r ) X (k ) = X (2r ) =

N / 2 1

[ x(n) + x( N / 2 + n)]W
n =0

WN
N/2 point DFT

2 rn

= (e

j 2 / N

X ( k ) = X ( 2r ) =

) 2 rn = (e j 2 /( N / 2 ) ) rn = W N / 2

N / 2 1

x(n) + x( N / 2 + n)]W
[

n =0

N / 2 1

Y (r) =

n =0

k : odd k = 2r + 1
X (k ) = X ( 2r + 1)
=

[ x(n) x( N / 2 + n)]W

Z (r ) =

n ( 2 r +1)

x( n) x( N / 2 + n)]W W
[

z (n)W

2 rn
N

N / 2 1

z (n)W

z (n)W
n =0

2 rn
N

z (n)

N / 2 1

n =0
N / 2 1

Z (r )

N / 2 1

n =0

rn
N /2

y (n)

N / 2 1

n =0

rn

y ( n )WN / 2 rn

n =0

2 rn
N

rn
N /2

rn
N /2

N
po int
2

DFT

of

z (0), ,

z(

N
1)
2

Page 10-14

## EE 422G Notes: Chapter 10

Instructor: Zhang

## One N/2 point DFT => two N/4 point DFT

two point DFTs
Consider N/2 point DFT
y(0), y(1), , y(N/2-1)
Y (k ) =

N / 2 1

n =0

N / 4 1

n =0

y ( n )WN / 2 rn

[ y ( n ) + ( 1) k y ( N / 4 + n )]WN / 2 nk

k : even k = 2 r
Y (k ) = Y (2r ) =

N / 4 1

n =0

Y 1( r ) =

N / 4 1

n =0

[
y (n )+ y
( N / 4
n
)]WN / 2 nk
+
y1( n )

y1( n )WN / 4 nk N / 4

po int

DFt

Page 10-15

## EE 422G Notes: Chapter 10

Instructor: Zhang

k : odd k = 2 r + 1
Y ( k ) = Y ( 2 r + 1) =

N / 4 1

n =0

Y 2( r ) =

N / 4 1

n =0

[ y ( n ) x ( N / 4 + n )]WN / 2 n WN / 2 2 rn

y 2( n )WN / 4 rn N / 4

y 2( n )

po int

DFT

10-4 C Computation
N point DFT : 4N(N-1) real multiplications
N point FFT : 2Nlog2N real multiplications
(N = 2m)
Computation ration

Page 10-16

## EE 422G Notes: Chapter 10

FFT ' s
DFT ' s

Instructor: Zhang

computations
5 log2 N
=
computations 8( N 1)

N =212 =4096

5 12
= 0.18%
8 4095

## 10-5 Properties of the DFT

Assumptions
(1)
x(n )

X (k )

and

y(n)

Y (k )

( n = 0,..., N 1)
( k = 0,..., N 1)

(3) Subscript e:
Subscript o:

N1
if N even
2

N if N odd
2

Page 10-17

## xo(n) : odd about

Instructor: Zhang

N1
if N even
2

N if N odd
2

N = 10, xe(n)

x(4) = x(5)
x(3) = x(6)
N 1
= 4.5 x(2) = x(7)
2
x(1) = x(8)

x(0) = x(9)

N = 9, xe(n)

x(4) = x(5)
x(3) = x(6)
N
= 4.5 x(2) = x(7)
2
x(1) = x(8)

x(0) = x(9)

(4) Any real sequence can be expressed in terms of its even and odd parts
according to
x ( n ) = xe ( n ) + xo ( n )
1
1
= [ x ( n ) + x ( N n )] + [ x ( n ) x ( N n )]
2
2

even
odd
Question 1: x(n) = 1/2[ ] +1/2 [ ] ?
Question 2: x(n) + x(N-n) even ?
x(n) - x(N-n) odd ?

Yes!

## Example: N = 9 => N/2 = 4.5

Consider n = 2
x(2) + x(9-2) = x(2) + x(7)

Page 10-18

## EE 422G Notes: Chapter 10

is

Instructor: Zhang

## 4.5 + (4.5-2) = 9-2 = 7

4.5 - (7-4.5) = 9-7 = 2
x(2) + x(7) = x(7) + x(2) ?
Yes! => x(n) + x(N-n) even
Is x(2) - x(7) = - [x(7) + x(2)] ?
Yes! => x(n) - x(N-n) odd
(5) subscript r : xr(n)
a real sequence
subscript i : xi(n)
Imaginary part of a complex sequence
x
(
n
)

X
(
k
)
(6)
left
right side:
side:
DFT
sequence
(7) sequences are assumed periodically repeated if necessary
Properties
1. Linearity :
2. Time Shift:

Ax ( n ) + By ( n ) AX ( k ) + BX ( k )

x ( n m) X ( k )e j 2km / N = X ( k )WN k m

3. Frequency Shift:
4. Duality :
why?

x ( n )e j 2km / N X ( k m )

N 1 x ( n) X ( k )

X (k ) =

DFT ( X ( n )) =

N 1

x (m)e j 2mk / N

m =0
N 1

X (n )e j 2nk / N

n =0

DFT of x(m)

Page 10-19

## EE 422G Notes: Chapter 10

Instructor: Zhang

x ( n ) = x ( N n )
=
e

1
N

N 1

X (k )e j 2k ( N n ) / N

k =0

j 2k ( N n ) / N

x ( n ) =

1
N

= e j 2kN / N e j 2kn / N

N 1

X (k )e j 2kn / N

k =0

DFT ( N 1 X ( n )) =

1
N

N 1

X (n )e j 2nk / N

= x ( k )

n =0

5. Circular convolution
N 1

## x(m) y (n m) = x(n)y (n) X (k )Y (k )

m =0

6. Multiplication

x ( n) y ( n) N

N 1

new sequence
z ( n) = x( n) y ( n)

circular convolution

X (m)Y (k m) = N 1 X (k )Y (k )

m =0

7. Parsevals Theorem
N 1

N 1

n =0

k =0

| x(n) |2 = N 1 | X (k ) | 2
8. Transforms of even real functions:
x er ( n) X er ( k )

## (the DFT of an even real sequence is even and real )

9. Transform of odd real functions:
x or ( n) jX oi (k )

## (the DFT of an odd real sequence is odd and imaginary )

10. z(n) = x(n) + jy(n)
z(n) Z(k) = X(k) + jY(k)
Example 10-7

z (n) = x( n) + jy (n) = e jn / 2

= cos( n / 2) + j sin( n / 2)

n = 0,1,2,3

Page 10-20

## EE 422G Notes: Chapter 10

Instructor: Zhang

## X(0) = [x(0) + x(2)] + [x(1) + x(3)]

X(1) = [x(0) - x(2)] + (-j)[x(1) - x(3)]
X(2) = [x(0) + x(2)] - [x(1) + x(3)]
X(3) = [x(0) - x(2)] + j[x(1) - x(3)]
For x(n) = cos(n / 2) =>
x(0) = 1 x (1) = 0 x (2) = 1 x (3) = 0

X (0) = 1

X (1) = 2

X (2) = 0

X (3) = 2

## y (0) = 0 y (1) = 1 y ( 2) = 0 y (3) = 1

Y (0) = 1 Y (1) = j 2

Y ( 2) = 0

Y (3) = j 2

Z ( 0) = 0
Z (1) = 2 j 2
Z ( 2) = 0
Z (3) = 2 + j 2

Example 10-8
DFT of x(n) = (n) :
N 1

X (k ) = ( n)W N

nk

= 1 k = 0,1,..., N 1

n =0

Time-shift property
N 1

DFT [ x(n n0 )] = (n n0 )W N

nk

n=0

= WN 0 = e j 2kn0 / N
Example 10-9: Circular Convolution
n k

x1 (n) = 1 x2 (n) = 1 0 n N 1

N 1

m =0

Page 10-21

## EE 422G Notes: Chapter 10

X 1 (k ) = X 2 (k ) =
=

N1

WN

nk

n= 0

Instructor: Zhang

N1

N1

x1(n)WN = x2 (n)WN nk
nk

n= 0

n= 0

k= 0

N
=
0

k 0

N2
X 3 (k ) = X 1 (k ) X 2 (k ) =
0
x3c ( n) =
=

1
N

1
N

k= 0
k 0

N 1

x3 (k )e j 2nk / N

k =0

N 1

N 2 (k )e j 2nk / N

k =0
N 1

= N e j 2nk / N = Ne j 2nk / N = N
k =0

x3c ( n) = N

## 10-6 Applications of FFT

1. Filtering
x(0), , x(N-1) FFT (DFT) =>
X(0), , X(1), , X(N-1)
X(k): Line spectrum at k =

2kt 2k
=
T
N

(1 =

2
T

t =

T
)
N

## (Over T: x(0), , x(N-1) are sampled.)

Inverse DFT:
N 1

x(n) = X (k )e j 2nk / N
k =0

N0

x(n) = X (k )e j 2nk / N
k =0

## Frequencies with >

Example 10-10

2N 0
have been filtered!
N

Page 10-22

## EE 422G Notes: Chapter 10

x( n) = cos

n
4

1 =

Instructor: Zhang

n
2

+ cos

2 2
( )
8 N

2 =(

0n7

2
4
)2= =
N
8 2

X (0),

X (1),

X ( 2),

X (7 )

non zero

non zero

## How to filter frequency higher than

2. Spectrum Analyzers
Analog oscilloscopes => time-domain display
Spectrum Analyzers: Data Storage, FFT
3. Energy Spectral Density
x(0), , x(N-1): its energy definition
E=

N 1

| x(n) |2

n =0

Parsevals Theorem
E=

N 1

| x ( k ) |2
N
k =0

Page 10-23