Sie sind auf Seite 1von 22

Module 2

Discrete Fourier Transform

Digital Signal Processing. Slide 2.1

Contents

Review of Fourier analysis


Fourier series Fourier transform

Discrete-time Fourier transform Discrete Fourier transform


Analysis, properties and applications Short-time Fourier transform Windowing Decimation-in-time FFT
Digital Signal Processing. Slide 2.2

Spectral estimation

Fast computation of DFT


Review of Fourier Analysis


Analysis of signals in terms of their components at different frequencies


What are signals?


Information bearing functions of time usually observed using transducers (microphone, antenna) often represented by analogue voltages or sampled data streams

What are frequency components?


Fourier analysis considers signals to be constructed from a sum of complex exponentials with appropriate frequencies, amplitudes and phase frequency components are the complex exponentials (sines and cosines) which, when added together, make up the signal

Digital Signal Processing. Slide 2.3

Fourier Series

For a periodic continuous-time signal x(t) with period T


x(t ) = A0 + Ak cos k 0t + Bk sin k 0t
k =1 k =1

This can be written in exponential form x(t ) = The ak are found from ak =
1 x(t )e jk 0t dt TT

k =

a e
k

jk 0t

x(t) is made from a d.c. term plus a weighted sum of sinusoids at integer multiples of the fundamental frequency
0 = 2 T
Digital Signal Processing. Slide 2.4

Fourier Transform

For an aperiodic signal, we can say that it is equivalent to a periodic signal with infinite period

hence the Fourier Series becomes the Fourier Transform

1 x(t ) = 2 X () =

X ( )e
jt

jt

x(t )e

dt

Digital Signal Processing. Slide 2.5

Existence of Fourier Transform


A (Dirichlet Conditions)

x(t) is absolutely integrable x(t) has a finite number of maxima and minima in any finite interval x(t) has a finite number of discontinuities within any finite interval and all discontinuities are finite

x(t ) dt <

B

If

1. X() is finite

x(t ) dt < then

2.

e(t )

dt = 0

(t ) x(t ) for e(t ) = x (t ) = IFT {X ( )} where x


Digital Signal Processing. Slide 2.6

Discrete-Time Signals and the Fourier Transform


So far, so good - mostly review Now consider a discrete-time signal x(n) and its ztransform X(z)

x(n) is just a sequence of numbers what does it mean for a sequence of numbers to have a spectrum?

How can the spectrum of a discrete-time signal (sequence) be found using the Fourier transform when the Fourier transform is defined for continuous-time signals?

Digital Signal Processing. Slide 2.7

Discrete-Time Fourier Transform


Consider a discrete-time signal x(n) and a continuous-time signal x'(t) given by *


x' (t ) =

Now
X ' (e ) = = =
j

n =

x(n) (t nT )
j t

x' (t )e

dt
j t

n =

x ( n) e

(t nT )dt

n =

x ( n )e

jnT

Digital Signal Processing. Slide 2.8

Hence

If x(n) is an infinite sequence, we can compute the discrete-time Fourier transform (DTFT) a sequence of numbers having a spectrum is OK if we use the trick of * the DTFT is a continuous function of frequency

Digital Signal Processing. Slide 2.9

Inverse DTFT

There exists and inverse DTFT


x ( n) = T 2
2 T

X ' (e

)e jnT d

where

2 T

means integrate over any 2 range of

Digital Signal Processing. Slide 2.10

Discrete Fourier Transform


The DTFT is defined using an infinite sum over a discretetime signal and yields a continuous function

not very useful since we dont often have real signals of infinite length

Now introduce the DFT which is defined using a sum over only N (finite) samples of a discrete-time signal The DFT yields a discrete function of frequency with points uniformly spaced around the unit circle in z

The DFT yields a sampled version of the DTFT

Digital Signal Processing. Slide 2.11

Im
X(2) X(3) X(1)

X ( k ) = X ( e j )

Re Unit Circle

= 2k N

X(4)

X(0)

X(5) X(6)

X(7)

DTFT yields a continuous function


X() is defined at all values of z around the unit circle X() is defined only at certain points around the unit circle

DFT yields sampled version


Digital Signal Processing. Slide 2.12

Applications of the DFT


Spectrum analysis of periodic discrete-time signals Short-time spectral estimation of aperiodic signals

normally in conjunction with a window

Fast implementation of convolution (filtering) via fast algorithm for DFT (FFT).

Digital Signal Processing. Slide 2.13

Derivation of DFT from DTFT


DTFT: X (e ) =

n =

x ( n )e

jnT

Consider only N samples of x(n), n=0, 1, N-1 and compute only N samples of X (e j ) using

= k 0

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

0 = 2 NT
Sampling frequency divided by N

giving

X (e

jk 0

) = x(n)e jkn 0T
n =0 N 1 n =0

N 1

which can be written

X (k ) = x(n)W kn

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

W = e j 2

Digital Signal Processing. Slide 2.14

Inverse DFT

There exists an inverse relationship


x ( n) = 1 N

X (k )W
k =0

N 1

kn

n = 0 ,1,...,N-1

Digital Signal Processing. Slide 2.15

Notes and Summary


Notes

X(k) is the DFT of x(n) X(k) is an N-point sequence computed from x(n), another N-point sequence k and n are dimensionless variables k is the frequency index, n is the time index

Summary
X (k ) = x(n)e j 2kn N
n =0 N 1

k = 0 ,1,...,N 1 n = 0,1,..., N 1
Digital Signal Processing. Slide 2.16

1 x ( n) = N

X ( k )e
k =0

N 1

j 2kn N

Properties of the DFT


Linearity:

Ax1 (n) + Bx2 (n) AX 1 (k ) + BX 2 (k )

A, B, arbitrary constants

Delay:

x(n m) mod N X (k )W km
i integer

where x(q ) mod N = x(q iN )

Modulation:

W nl x(n) X (k l ) mod N

Modulation in one domain implies circular shift in the other

Digital Signal Processing. Slide 2.17

Convolution:

m =0

x ( m) x ( n m)
1 2

N 1

mod N

X 1 (k ) X 2 (k )

circular convolution of two sequences in the product of their DFTs

Multiplication:

1 x1 (n) x2 (n) N

X (l ) X
l =0 1

N 1

(k l ) mod N

multiplication in one domain implies circular convolution in the other

Conjugation:

x* (n) X * ( k ) mod N

Digital Signal Processing. Slide 2.18

Spectral Estimation using DFT


Consider a speech signal s(t):


14000 12000 10000 8000 6000 4000 2000 0 -2000 -4000 -6000 0

My name is Michael Cane

amplitude spectrum is controlled by the voice source (vocal cords) and the articulators (lips, tongue etc) s[n] is a sampled version of s(t) at sampling frequency fs Hz, find the amplitude and phase spectra at time t1. Assume the spectrum of s(t) is constant near t1.

Suppose that:

Question:

0.5

1.5

2.5 x 10
4

Digital Signal Processing. Slide 2.19

1. Windowing

we must select N samples near t1. use a windowing function w(n)


eg: rectangular, hanning, hamming etc N is the size of the window position the window in the region of t1 and multiply the signal by the window. The result is a new data record s1(n) of length N. N is chosen to be an integer power of 2 so that the DFT can be implemented using a fast algorithm (FFT).

create a new data record s1 (n) = s (m).w(n)


n = 0, 1, , N 1 m = m1 N , , m1 + N 1 2 2

Digital Signal Processing. Slide 2.20

from the properties of the DFT



2 1.5 1 0.5 amplitude 0 -0.5 -1 -1.5 -2

multiplying the signal by a window is equivalent to convolving their Fourier transforms using a rectangular window causes convolution with a sin( x ) x the errors caused by the convolution are called leakage
Signal

Spectrum of Signal 100 50 0 -50 -100 -150 -200 -250 -300

amplitude dB

500 sample index Window

1000

1500

0.1

0.2

0.3

2 1.5 1 0.5

0.4 0.5 0.6 normalised frequency Spectrum of Window

0.7

0.8

0.9

1 Spectrum after windowing 50 40 30 20 amplitude dB 10 0 -10 -20 -30 -40

50 40 30 20 amplitude dB

amplitude

10 0 -10 -20 -30

0 -0.5 -1 -1.5

-40
-2 0 500 sample index 1000 1500

-50

0.1

0.2

0.3

0.4 0.5 0.6 normalised frequency

0.7

0.8

0.9

-50

0.1

0.2

0.3

0.4 0.5 0.6 normalised frequency

0.7

0.8

0.9

Digital Signal Processing. Slide 2.21

the rectangular window produces relatively narrow main lobes with high amplitude side-lobes (~ -13dB) the rectangular window introduces no leakage in the special case where x(n) is periodic with period N other windows produce broader main lobes with lower amplitude side-lobes, eg:

Hamming Hanning

2 n w(n) = 0.54 0.46 cos N 1 2 n w(n) = 0.50 0.50 cos N 1

0 n N 1

Digital Signal Processing. Slide 2.22

2. Discete Fourier Transform


Given compute

x1(n) = x(m) . w(n)


X 1 (k ) =
N 1 n =0

x1(n) e j 2kn / N

Digital Signal Processing. Slide 2.23

3. Interpret the result


what is X1(k) ? X1(k) is a sampled version of the discrete-time Fourier transform of x1(n) the samples in the frequency domain are spaced by f
s 1 = 1 f = N = NT Total time of sampling

X1(0) is the d.c. component X1(N/2) is the component at the Nyquist frequency X1(N-1) is the component at f s f
Digital Signal Processing. Slide 2.24

4. Present the result


normally we graph the result of a spectrum estimate several options:


power spectrum (spectrogram) S(k)


tells you how much power there is in the signal at each discrete frequency 1 X ( k ) 2 = 1 X * ( k ). X ( k ) S (k ) = N k = 0, 1, ..., N 1 N

Amplitude and phase spectrum


define the amplitude and phase spectra to be

X (k ) =

(Re{X (k )})2 + (Im{X (k )})2

X (k ) = tan 1 Re{X ( k )}

Im{X ( k )}

Digital Signal Processing. Slide 2.25

Computation for FFT


Computation for the DFT of a sequence requires N 2complex multiples

X [n] = x[n]e 2 nk / N , k = 0,1,...N 1


n =0

N 1

N complex multiples for each value of k Cooley and Tukey (1965) showed that the DFT could be computed using only N 2 log 2 N complex multiples when N is a power of 2 Their algorithm is called the radix-2 decimation-in-time Fast Fourier Transform

Digital Signal Processing. Slide 2.26

Number of complex multiples N 2 4 8 16 32 1024


N 1 n=0

DFT 4 16 64 256 1024 1048576

FFT 1 4 12 32 80 5120
Digital Signal Processing. Slide 2.27

2 point DFT

DFT :

X (k ) = x(n) WNnk

k = 0,1, , N 1

WN = e j 2 / N

For 2 points, N = 2, k = 0,1.

X (k ) = x(0) W20 + x(1) W2k


n=0 n=1

W2 = e j = 1

W20 = 1, W2k = (1) k


Digital Signal Processing. Slide 2.28

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

Digital Signal Processing. Slide 2.29

4 point DFT
X (k ) = x(n) W4nk
n =0 3

k = 0,1,2,3

= x(0)W40 + x(1)W4k + x(2)W42 k + x(3)W43k


Note that also

W40 k = e j 2 .0.k / 4 = e j 2 .0.k / 2 = W20 k

W42 k = e j 2 .2.k / 4 = e j 2 .1.k / 2 = W21k

Digital Signal Processing. Slide 2.30

Now consider only the even-indexed samples x(0) and x(2)


Call this even sequence

xe (0), xe (1)

x(0)W40 k + x(2)W42 k = xe (0)W20 k + xe (1)W21k


Thus the 1st and 3rd terms of X(k) are the 2 point DFT of the even samples

Digital Signal Processing. Slide 2.31

The 2nd and 4th terms can be written

x(1)W4k + x(3)W43k = W4k ( x(1)W40 k + x(3)W42 k ) = W4k ( x0 (0)W20 k + x0 (1)W2k )


since W42 k = W2k and where x0 (n) are the odd samples

Thus the 2nd and the 4th terms of X(k) are the 2point DFT of the odd samples Finally X (k ) = X e (k ) + W4k X 0 (k )
x(n) 2point DFT of
even samples

k = 0, 1, 2, 3

4 point DFT of

W4k 2point DFT of


odd samples
Digital Signal Processing. Slide 2.32

Recombination Equations
X (0) = X e (0) + W40 X 0 (0) = X e (0) + X 0 (0) X (1) = X e (1) + W41 X 0 (1) X (2) = X e (2) + W42 X 0 (2) = X e (2) X 0 (2) = X e (0) X 0 (0) X [3] = X e (3) + W43 X 0 (3) = X e (3) + W41W42 X 0 (3) X e (3) + W41 X 0 (3) X e (1) + W41 X 0 (1) because of periodicity of the DFT
Digital Signal Processing. Slide 2.33

since W4 0 = e j 2 0 k / 4 = 1

since W4 2 = e j 2 2 k / 4 = 1 because of periodicity of the DFT

Periodicity of the DFT


Complex exponentials are periodic functions and hence

X e (2m) = X e (0) m integer X e (2m + 1) = X e (1) m integer


Similarly for X o

Digital Signal Processing. Slide 2.34

Signal flow graph: 4point DFT


Step 1 : Split x(n) into an even sequence and an odd sequence Step 2 : perform 2 2point DFTs Step 3 : recombine

Digital Signal Processing. Slide 2.35

From the 2-point and 4-point FFT implementations, we can generalise the procedure : 1. Decompose the N-point DFT into two N/2-point DFTs and determine the recombination equations 2. Decompose each N/2-point DFT into two N/4-point DFTs and determine the recombination equations 3. Repeat the decomposition until only 2-point DFTs remain The computational saving comes from the fact that each butterfly requires only 1 complex multiplication (plus one addition and one subtraction) the number of butterflies is N 2 log 2 N , N a power of 2

Digital Signal Processing. Slide 2.36

Implementing an FFT on a computer


Consider the 4 point example

note that the output sequence is correctly ordered the input sequence is not correctly ordered
Digital Signal Processing. Slide 2.37

Data input x[0] X[2] X[1] X[3]

Binary index 00 10 01 11

this turns out to be a standard binary count but with the order of the bits reversed

Digital Signal Processing. Slide 2.38

Consider an 8 point case

data point x[0] x[4] x[2] x[6] x[1] x[5] x[3] x[7]

binary index 000 100 010 110 001 101 011 111

Hence the array of input data must be read in bitreversed order. If the input data is the correct order (sequential), then the output of the FFT will appear in bitreversed order
Digital Signal Processing. Slide 2.39

Decimation in Frequency FFT


X (k ) = x(n)WNkn
n =0 N 1

= = =

N /2 - 1

n =0

x(n)W +
kn N kn N

n= N / 2

N 1

x(n)WNkn
N /2 1

N /2 - 1

n =0 n =0

x(n)W + W

Nk / 2 N

n =0

x(n +

N kn )WN 2

N /2 - 1

N kn k x(n) + (1) x(n + ) WN 2

The decimation comes from dividing X(k) into even and odd terms
Digital Signal Processing. Slide 2.40

giving
N kn x(n) + x(n + ) WN / 2 k = 0,1,..., N / 2 - 1 2 n=0 N /2 - 1 N X (2k + 1) = x(n) x(n + ) WNn WNkn k = 0,1,..., N / 2 - 1 /2 2 n =0 X (2k ) =
N /2 - 1

Which can be written X (2k ) =


N /2 - 1

n=0

g1 (n)WNkn /2 g 2 (n)WNkn /2
Digital Signal Processing. Slide 2.41

X (2k + 1) =

N /2 - 1

n =0

4 point decimation-in-frequency

Digital Signal Processing. Slide 2.42

Summary

So far, we have seen radix-2 algorithms


signal is divided into elementary groups of 2 no. of points integer power of 2 no. of points integer power of 4 extra efficiency compared to radix-2 uses both radix-2 and radix-4 decomposition highly efficient but loses regular processing structure
important for VLSI

Radix-4 algorithms

Split Radix algorithms


Digital Signal Processing. Slide 2.43

Das könnte Ihnen auch gefallen