Sie sind auf Seite 1von 120

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
x(t )
k

ak e

jk

0t

; ak

1 x(t )e TT

jk

0t

dt;

2 T

Continuous and periodic in time domain

Discrete and aperiodic in frequency domain

FT of CT aperiodic signals

Continuous and aperiodic in time domain

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

Fourier Series expansion


CT periodic signals with period T:

x(t )
k

ak e

jk

0t

; ak

1 x(t )e TT

jk

0t

dt

2 T

DT periodic signals with period N:

x[n]
k N

ak e

jk

0n

; ak

1 N

x[n]e
n N

jk

0n

2 N

Note: finite sums over an interval length of one periodic N

jk

0n

jk

2 n N

j( k N )

2 n N

j( k N )

0n

Example of Fourier Series expansion


Given a DT periodic signals with period N: p[n]
k

[n kN ]

. . . -2N

-N

N
N 1

2N . . . . .

p[n]
k 0

ak e

jk

2 n N

ak

1N1 p[n ]e Nn 0

jk 2 n / N

1 N

Lecture #19 DTFT of periodic signals

1. Review of Fourier Transforms (FT)


2. Fourier Series expansions 3. DTFT of periodic signals

DTFT of periodic signals

CT periodic signals with period T:

x(t)
k

a ke

jk

0t

X( ) 2
k

ak (

DT periodic signals with period N:


F

x[n ]

X( ) 2
k

ak (

Example of calculating DTFT of periodic signals


Height = 1
Spacing = N

. . . -2N

-N

2N . . . . . . . .

P( ) 2
k

ak
2/N

k
2/N

2 N

2 k N
Height = 2/N
Spacing = 2/N

2/N

2/N

2/N

. . . -4/N

-2/N

2/N

4/N . . . .

Another approach to get DTFT of periodic signals


x(n) is periodic signal; x0(n) is a part of x(n) that is repeated

N-1

x0 [n]

x[n] 0

0 n

N 1

otherwise

Another approach (cont)


x[n] 0 0 n N 1

x0 [n]

otherwise

x[n]
k

x0 [n kN ]
k

x0 [n]

[n kN ] x0 [n]
k

[n kN ]

p(n) in previous example


F

x[n] x0 [n] p[n]

X 0 ( ) P( )

X( )

Another approach (cont)


F

x[n] x0 [n] p[n]

X 0 ( ) P( )

X( )

X( )

2 X0( ) N 2 N

(
k

2 k ) N 2 k ) N

2 X 0 (k ) ( N

It has N distinct values at k = 0, 1, , N-1

Inverse DTFT
DFT 1 2 1 N
1

X( ) 2 N

x[n ]

1 2

X ( )e j n d
0

2 X 0 (k ) ( N
2

2 k ) e j nd N 1 N
N 1 j 2 X 0 (k )e N 0 k2 n N

2 X 0 (k ) ( N 0

2 k )e j n d N

This is obtained from this property of the impulse:


b

f (t ) (t t0 )dt
a

f (t0 ) a 0

t0

elsewhere

Summary

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: Obtain the DTFT of x(n): X ( )

2 N

2 X 0 (k ) ( N

2 k ) N

Example of calculating DTFT of periodic signals

0
3

2
j n

X0( )
n 0

x0 (n)e

1 e

2e

j3

k = 0 X0(0) = 4;
k = 2 X0(2) = -2;

k = 1 X0(1) = 1+j
k = 3 X0(3) = 1-j

Example (cont)

Example (cont)

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 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 examples


a) Draw the magnitude plot of the FT of a CT sinusoid x(t), that has a frequency of 24 Hz

The FT of a sinusoidal has nonzero values only at certain points

-24 -48 [rad/s]

24 48

f [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

Sampled signal FT magnitude = copies of unsampled signal FT magnitude; each copy is centered at k40(Hz) or k80(rad/s) fs = 40Hz
fs = 40Hz

8Hz

-64 -56

-24 -16

16 24

40

56 64

f[Hz]

-128 [rad/s]

-48 -32

32 48

80

112

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?

The unit circle represents the scale of frequency range for a signal sampled at 40Hz the reconstructed signal looks like 16Hz.

16 20 24 0 16 24 40 56 64

8Hz

f[Hz]

32 48

80

112

[rad/s]

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? The unsampled signal: x(t) = cos(2.24t)
The sampled signal:

x[n] = cos(2.24.(1/40)t) = cos(6/5)n = cos (4/5)n


The sampled signal is periodic with N = 5

DTFT and DFS examples


e) Specify the DTFT of the DT signal x(n).

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!


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 cant calculate an infinite continuum of frequencies using a computer Most real-world data is not in the form like 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) sample

Window x(n) is like multiplying the signal by the finite length 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

X0( )
n

x0 [n]e

j n n 0

x0 [n]e

j n

Discrete time signal x0(n) Finite length

DTFT

Building the DFT formula (cont)


Continuous time signal x(t) sample Discrete Fourier Transform DFT X(k) Discrete + periodic with period N Sample at N values around the unit circle

Discrete time signal x(n)


window

Discrete time signal x0(n) Finite length

DTFT

X0() Continuous + periodic with period 2

Notation conventions

Notation conventions (cont)

DFT and inverse DFT formulas


Notation

WN

2 N

You only have to store N points

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


N 1

X [k ]
n 0

kn x[n ]WN

0,1,..., N 1

Let ' s define : x[0] xN x[1] x[ N 1] 1 1 WN


1 1 WN

X [ 0] XN X [1] X [ N 1] 1
2 WN

The N-point DFT may be expressed in matrix form as:

XN = WNxN

1
( WN N 1)

1 WNN
1 2 WN ( N 1) ( WN N 1)( N 1)

IDFT in matrix forms


1 N1 x[n ] X [k ]WN kn Nk 0 Let ' s define : x[0] xN x[1] x[ N 1] 1 1 WN 1 W 1 WNN
1 2 ( WN ( N 1) WN N 1)( N 1) 1 N

0,1,..., N 1
The N-point DFT may be expressed in matrix form as:
xN WN X N
* WNWN 1

X [ 0] XN X [1] X [ N 1] 1 W
2 N

1 * WN X N N

1 W
( N 1) N

NI N

I N : identity matrix

Example of calculation of DFT in matrix form


Let ' s define : 0

Find DFT of the signal

x[n] =
[n-1] + 2[n-2] + 3[n-3]

x4

1 2 3 1 1 1 1 1 1 1 1 1 j j 1 1 1 1 1 1 j 1 j 1 W41 W42 W43 1 W42 W44 W46 1 W43 W46 W49 6 2 2j 2 2 2j

W4

Then X 4

W4 . x 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

Frequency resolution of the DFT


Discrete frequency spectrum computed from DFT has the spacing between frequency samples of:

fs N

2 N

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

Examples of N = 5 and N = 15

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

N periodic extension truncate

xp(n)
Periodic

DTFT DTFT-1

Xp()
Periodic

X(k)
Finite length

DFT-1

DFT

N periodic extension truncate

Xp(k)
Periodic

DFT properties
x(n)
Finite length

N periodic extension truncate

xp(n)
Periodic

DTFT DTFT-1

Xp()
Periodic

X(k)
Finite length

DFT-1

DFT

N periodic extension truncate

Xp(k)
Periodic

Periodicity

If x[n] and X[k] are an N-point DFT pair, then

x[n+N] = x[n] for all n

X[k+N] = X[k] for all k

Linearity
DFT

a1 x1[n] a2 x2 [n]

a1 X 1[k ] a2 X 2 [k ]

Note: The length of x1[n] is same with the length of x2[n]

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


DFT

x[n m]
Proof:

W X[k]

km

Infer from the relation between DFT and DTFT


DTFT

x[n m] 2 k : N e
j m

j m

X( )

X( )

jk

2 m N

X [k ] W km X [k ]

x(n)

Circular
xp(n)

time
shift
xp(n+2)

x(n+2)

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

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

x[n]W
Proof:

ln

DFT

X [k l ]

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


DFT N 1

X 1[k ]. X 2 [k ]

x1[n]

x2 [n]
p 0

x1[ p]x2 [n

p]

The non-zero length of x1(n) and x2(n) can be no longer than N


The shift operation is circular shift The flip operation is circular flip

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: x1(n) = [ 1 2 3 4 ]; x2(n) = [ 0 1 2 3 ]
1 1

0 2

1 3

y(0) = 16

y(1) = 18

Example (cont)
Evaluate the circular convolution, y(n) of 2 signals: x1(n) = [ 1 2 3 4 ]; x2(n) = [ 0 1 2 3 ]
1 1

2 0

3 1

y(2) = 16

y(3) = 10

Another method to calculate circular convolution

x1(n)
x2(n)

DFT DFT

X1(k)
IDFT X2(k) y(n)

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 ]

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
DFT

x1[n]. x2 [n]

1 X 1[ k ] N

X 2 [k ]

1 N

N 1

X 1 [l ] X 2 [ k l ]
l 0

The non-zero length of X1(k) and X2(k) can be no longer than N


The shift operation is circular shift The flip operation is circular flip

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:
N 1

x[n] y * [n]
n 0

1 N

N 1

X [k ]Y * [k ]
k 0

Special case:
N 1

| x[n] |
n 0

1 N

N 1

| X [k ] |
k 0

Parsevals theorem example


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

N 1

| x[n ] |2
n 0

12
2

22 1 2 (7 4

32 12 2
2

15 1
2

1 N

N 1

| X [k ] |
k 0

1)

60 15 4

Multiple choice questions


Ex1: It is desired to build a sampling system which takes a recorded orchestra music signal s(t) and converts it to a discretely-sampled form. In order to experimentally determine the bandwidth (in frequency) of this signal the best transform would be a. The Fourier transform of a continuous function or a discrete sequence

b. The Z-transform
c. The Fourier series d. The discrete Fourier transform

Multiple choice questions


Ex2: A mathematical model of human speech puts out a perfectly periodic signal for steady vowel sounds. In order to accurately determine the harmonics of the fundamental frequency for this mathematical model, the best transform should be

a. The Fourier transform of a continuous function or a discrete sequence


b. The Z-transform c. The Fourier series

d. The discrete Fourier transform

Multiple choice questions


Ex3: A student wishes to convolve the continuous-time mathematical functions g(t) and h(t). She/he uniformly samples these functions, and uses a computer to get, at best, an approximate result. Another student claims to be able to get an exact result via a transform. She/he must be thinking of which transform a. The Fourier transform of a continuous function or a discrete sequence

b. The Z-transform
c. The Fourier series d. The discrete Fourier transform

Multiple choice questions


Ex4: A student wishes to convolve the discrete-time mathematical functions g(n) and h(n). She/he claims to be able to get an exact result via one of the transforms below. She/he must be thinking of which transforms

a. The Fourier transform of a continuous function or a discrete sequence


b. The Z-transform c. The Fourier series

d. The discrete Fourier transform

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)

Recall DFT and IDFT definition


N 1

X[k ]
n 0

x[n ]W

nk N

0 k

N 1 N 1

Nth complex root of unity:

x[n ]

1N1 X[k ]WN nk Nn 0

0 n

WN

2 N

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

Fast Fourier Transform (FFT)


What does it take to compute DFT or IDFT?

N2 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):
2

N log 2 N complex multiplications 2

FFT (cont)

Some properties of

W
*

nk N

can be exploited

W W

k ( N n) N kn N

W
N

kn N

kn , complex conjugate symmetry WN

k (n N )

(k N )n N

, periodicit y in n and k

Other useful properties:


(k N 2 kn N N )n 2

W W

W W
N kn N 2

kn

nN 2 N

W e
N

kn

jn

W , W
N

kn

if n even , if n odd

kn N

Comparison of DFT and FFT efficiency

Complex multiplication numbers

FFT
N

Comparison of DFT and FFT efficiency


Number of Complex multiplications Complex multiplications Speed improvement

points N
4 8 16 32 64

in direct DFT
16

in FFT
4

factor
4.0

64
256 1,024

12
32 80

5.3
8.0 12.8

4,096
16,384 65,536 262,144 1,048,576

192
448 1,024 2,304 5,120

21.3
36.6 64.0 113.8 204.8

128
256 512

1024

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)

DIT-FFT with N as a 2-radix number

We divide X(k) into 2 parts:

X [k ]
neven

x[n]W kn
nodd
k N

x[n]W kn
0,1,..., N 1

X(k) G(k)

H(k), k

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).

DIT-FFT (cont)
N 2

N 2

X [k ]
m 0
N 2

x[2m]W 2 mk
m 0
1

x[2m 1]W k (2 m
N 2

1)

=
m 0

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

x[2m 1](W 2 ) mk

Note:
N 2

2 N

e
mk N /2

j2 / N 2

e
1

j 2 /( N / 2 )

WN / 2
G(k )

X (k )
m 0

g[m]W

k N

N 2

h[m]W
m 0

mk N /2

k N

H (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)

DIT-FFT of length N = 8

X[k]8
0 8

G[k]4

W H[k]4
X[4] G[0] W H[0] X[5] G[1] W H[1] X[6] G[2] W H[2] X[7] G[3] W87 H[3]
6 8 5 8 4 8

k 8

X[0] G[0] W H[0] X[1] G[1] W H[1] X[2] G[2] W H[2] X[3] G[3] W83H[3]
2 8 1 8

Signal flow graph for 8-point FFT

DFT N=4

DFT N=4

# complex multiplications are reduced: 82 = 64 2x(4)2 + 8 = 40

DIT-FFT of length N = 4

X [k ]4
x[0]
X [0] G[0] W40 H [0]

G[k ]2 W H [k ]2
W0

k 4

X [0] G[0] W40 H [0]

x[2]

DFT X [2] G[0] W H [0] N[3= G[1] W H [1] X ] 2


X [1] G[1] W41H [1]
2 4 3 4

X [1] G[1] W41H [1]


W1

x[1]

x[3]

DFT N=2

W2

X [2] G[0] W42 H [0]

W3

X [3] G[1] W43H [1]

# multiplications are reduced: 42 = 16 2x(2)2 + 4 = 12

DIT-FFT of length N = 2
1

X [k ]
n 0

x[n ]W nk , 0 k 1, W x[0]W 0.0 x[0]W 0.1 x[1]W 1.0 x[1]W 1.1

2 2

X [0] X [1]

x[0] x[1] x[0] x[1]

Butterfly diagram
# multiplications are reduced: 22 = 4 0; just 2 additions!!!

x[0]

X[0]

x[1]

-1

X[1]

Example of
8-point FFT
DFT N=4
DFT N=4

First step: split 8-point DFT into two 4-point DFTs

G[0]

Example

DFT N = 2

W0 W2

G[1]
G[2] G[3] H[0]
W
0

of
DFT N = 2

W4
W6

8-point
FFT (cont)
W0

DFT N = 2

W0 W2

H[1] H[2]
W4

DFT N = 2

H[3]
W6

Second step: split each of 4-point DFT into two 2-point DFTs

Example

W0 W2

W0 W1

of 8-point
FFT (cont)
W0

W4
W6

W2 W3
W0

W0 W2
W4 W6

W4 W5

W6
W7

Third step: combine all signal flow graphs of step 1 and step 2 There are 3 = log28 stages; 4 butterfly diagrams in each stage

Butterfly diagram

Wr

-1 Wr+N/2

Wr+N/2 = -Wr

The overall signal flow graph for 8-point DIT-FFT


Now the overall computation is reduced to:

N log 2 N complex multiplications 2

In-place computation
a A

Wr

-1

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)

DIF-FFT with N as a 2-radix number

We divide X(k) in half first half and second half


( N / 2) 1 N 1

X (k )
n 0

x(n)W

kn N

kn x(n)WN , k n ( N / 2)

0,1,..., N 1

Rewrite the second half:


N 1 ( N / 2) 1

x(n)W
n ( N / 2)

kn N n 0

x n
kN 2 N
( N / 2) 1

N k n WN 2

N 2

k N

N 2

( N / 2) 1

x n
n 0

N kn WN 2

Since:

j ( k 2 / N )( N / 2 )

( 1)

then

X (k )
n 0

kn x(n) ( 1)k x(n N / 2) WN , k

0,1,..., N 1

DIF-FFT (cont)

Decompose X(k) into two frequency sequences, even and odd:


( N / 2) 1

X ( 2k )
n 0

x ( n ) x ( n N / 2) W
( N / 2) 1

2 kn N

,k

N 0,1,..., 2 ,k

1 1

X (2k 1)
n 0

x ( n ) x ( n N / 2) W
2 N

( 2 k 1) n N

N 0,1,..., 2

Since: then,

2 N /2

( N / 2) 1

X ( 2k )
n 0

x ( n ) x ( n N / 2) W
( N / 2) 1

kn N /2

,k
n N

N 0,1,..., 2
kn N /2

1 1

X (2k 1)
n 0

x ( n ) x ( n N / 2) W W

,k

N 0,1,..., 2

DIF-FFT butterfly

x[n]

x[n] + x[n+N/2]

x[n+N/2] -1 WNn

(x[n] - x[n+N/2])WNn

DIF-FFT of length N = 4
x[0] x[0] + x[2]
X[0]

x[1]

x[1] + x[3] (x[0] - x[2])W40 W4 0

X[2]
-1

x[2]

-1

X[1]

-1
x[3] W41 X[3]

(x[1] - x[3])W41

-1

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 = 2n)

Step 2. Determine the sampling frequency required to sample the analog signal so as to avoid aliasing s 2M
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

Example
1

f(t) = rect[(t-1)/2]

f[n]

F() = 2sinc()e-j
0.5

Ts = 1s
0 0.5 1 1.5 n 2 2.5 3

%Error of sample 1 = 50%

magnitude

2 1 0

2 omega

Example
1

f(t) = rect[(t-1)/2]

f[n]

F() = 2sinc()e-j
0.5

Ts = 0.2s
0 5 n 10 15

%Error of sample 1 = 10%

magnitude

2 1 0

10

15 omega

20

25

30

Example
1

f(t) = rect[(t-1)/2]

F() = 2sinc()e-j
f[n]
0.5

Ts = 0.1s
0 5 10 15 n 20 25 30 35

magnitude

%Error of sample 1 = 5%
2 1 0

10

20

30 40 omega

50

60

70

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

y[n]

x1[n] * x2 [n]
p

x1[ p]x2 [n

p]

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

Recall circular convolution


N 1

y[n]

x1[n]

x2 [n]
p 0

x1[ p]x2 [n

p]

The non-zero length of x1(n) and x2(n) can be no longer than N


The shift operation is circular shift The flip operation is circular flip

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.

x1(n)
N1 samples

Zero padding
(N2-1) zeros

x1(n) DFT IDFT x2(n) DFT


x1(n)*x2(n)

x2(n)
N2 samples

Zero padding
(N1-1) zeros

Example of calculation of the linear convolution


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

x1(n) = [ 1 2 3 4 0 0 0 ]; x2(n) = [ 0 1 2 3 0 0 0 ] X1(k) = [ 10, -2.0245-j6.2240, 0.3460+j2.4791, 0.1784j2.4220, 0.1784+j2.4220, 0.3460-j2.4791, -2.0245-j6.2240 ];
X2(k) = [ 6, -2.5245-j4.0333, -0.1540+j2.2383, -0.3216j1.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.8342j0.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

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

Overlap-add technique in block filtering

Divide long input signal, x(n) into non-overlapped blocks, xb(n) of appropriate length for FFT calculation.
Convolve each block xb(n) and h(n) to get the output,

yb(n)

Overlap-add outputs, yb(n) together to form the output signal, y(n)

Example of overlap-add technique

h(n)

x(n)

Example of overlap-add technique


x0(n)

x1(n)

x2(n)

Example (cont)
y0(n)

y1(n)

y2(n)

HW
Prob.1 12.10 Prob. 2 12.11 Prob. 3 12.12 Prob. 4 12.15 Prob. 5 12.18 Prob. 6 12.22 Prob. 7 12.24 Prob. 8 12.30

HW
Prob.9

Given signals below and their DFT-5

(a ) x1[n ] ( b) x 2 [ n ] (c) s[n ]

[n 1] 2 [n 2] 3 [n 3] 4 [n 4] [n 1] [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.10

Prove the Parsevals theorem


N 1

x[n] y * [n]
n 0

1 N

N 1

X [k ]Y * [k ]
k 0

Lecture #20 DFT applications


1. Approximation of the Fourier Transform of analog signals

2. Convolution
3. Filtering 4. Correlation 5. ESD estimation

Windowing
1

f[n]

0.5

10

20

30 n

40

50

60

70

magnitude

2 1 0

10

15 20 omega

25

30

35

Das könnte Ihnen auch gefallen