unit 7 fourier, dft, and fft 1. time and frequency representation the most common representation of...

28
AMI 4622 Digital Signal Processing Unit 7 Fourier, DFT, and FFT 1

Upload: alaina-paul

Post on 22-Dec-2015

228 views

Category:

Documents


0 download

TRANSCRIPT

1

AMI 4622 Digital Signal Processing

Unit 7 Fourier, DFT, and FFT

2

Time and Frequency RepresentationThe most common representation of signals and waveforms is in the

time domainMost signal analysis techniques only work in the frequency domainThis can be a difficult concept when first introduced to itThe frequency domain is just another way of representing a signalFirst consider a simple sinusoid

The time-amplitude axes on which the sinusoid is shown define

the time plane.

If an extra axis is added to represent frequency then the sinusoid would illustrated as ……

0 0.5 1 1.5 2 2.5

-1

-0.5

0

0.5

1

time

ampl

itude

3

The frequency-amplitude axes define the frequency plane in the same way as the time-amplitude axes defines the time plane

The frequency-plane is orthogonal to the time-plane and intersect with it a line on the amplitude axis.

The actual sinusoid can be considered to be existing some distance along the frequency domain

01

23

45

6

0

5

10

15

20-1

-0.5

0

0.5

1

timefrequency

am

plit

ude

4

Sampling and Aliasing Review• Before any DSP algorithm can be performed, the signal must be in

digital form. That is we need to first sample the signal.

• Sampling is the acquisition of a continuous (for example analogue) signal at discrete time intervals and is a fundamental concept in real time signal processing.

• The sampling process has its problems. One is called aliasing.

• Consider two signals one having a frequency of 2Hz and another at a frequency of 18Hz. Lets sample these signals at a rate of 16 samples per second. Aliasing.m

5

Fourier SeriesAny periodic function f(t), with period T, may be represented by an

infinite series of the form:

where the coefficients are calculated from:

6

Provides a means of expanding a function into its major sine / cosine or complex exponential components

These individual terms represent various frequency components which make up the original waveform

Example: Square wave

0 0.5 1 1.5 2 2.5 3 3.50

0.2

0.4

0.6

0.8

1

1.2

1.4

7

Complex Fourier SeriesUsing Eulers formula to derive the complex

expressions for , and substituting these into the Fourier series it can be shown that the complex form of the Fourier series is:

where

8

Fourier TransformThe Fourier Series has to be modified when the waveform is not

periodic

See notes: The Fourier Transform

DFTExpanded.m

DFT.m

9

The DFT is given by:

Example: Find the DFT of the sequence {1, 0, 0, 1}

Solution……..

Discrete Fourier Transform

10

Example: Find the DFT of the sequence {1, 0, 0, 1}

Solution: { 2, 1+j, 0, 1-j }

11

Computational Complexity of the DFTConsider an 8-point DFT

Letting

Each term consists of a multiplication of an exponential term by another term which is either real or complex.

Each of the product terms are added together. There are also eight harmonic components (k = 0, … ,7) Therefore for an 8-point DFT there are 82 = 64 multiplications and 8 x 7

additions . For an N-point DFT - N2 multiplications and N(N-1) additions

12

Computational Complexity of the DFTFor an N-point DFT - N2 multiplications and N(N-1)

additions

Therefore for a 1024-point DFT (N=1024)Multiplications: N2 = 1048576Additions: N(N-1) = 1047552

Clearly some means of reducing these numbers is desirable

13

Computational Complexity of the DFT

where

X(k) x(0) x(1) x(2) x(3) x(4) x(5) x(6) x(7)

0 0 0 0 0 0 0 0 0

1 0 π/4 π/2 3π/4 π 5π/4 3π/2 7π/4

2 0 π/2 π 3π/2 2π 5π/2 3π 7π/2

3 0 3π/4 3π/2 9π/4 3π 15π/4 9π/2 21π/4

4 0 π 2π 3π 4π 5π 6π 7π

5 0 5π/4 5π/2 15π/4 5π 25π/4 15π/2 35π/4

6 0 3π/2 3π 9π/2 6π 15π/2 9π 21π/2

7 0 7π/4 7π/2 21π/4 7π 35π/4 21π/2 49π/4

14

The Fast Fourier Transform - FFTFirstly lets make some notation changes:

Now lets examine some relationships involving

Proof

15

To exploit the computational

redundancy expressed by:

we will divide the data

sequence into two equal

sequences, one even and

one odd:

using

which we can represent as:

This process can be repeated for and so on……..

16

The decimation can continue…….

…….until the number of data elements in the DFT becomes two i.e.

17

Lets consider the structure of an 8-point FFT

Remember we break down each stage into even and odd data sequences

Stage 3 𝑋1ሺ𝑘ሻ= 𝑋11ሺ𝑘ሻ+ 𝑊8𝑘𝑋12ሺ𝑘ሻ 𝐷𝑎𝑡𝑎 𝑥0 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 𝑥7 Stage 2 𝑋11ሺ𝑘ሻ= 𝑋21ሺ𝑘ሻ+ 𝑊4𝑘𝑋22ሺ𝑘ሻ 𝐷𝑎𝑡𝑎 𝑥0 𝑥2 𝑥4 𝑥6

𝑋12ሺ𝑘ሻ= 𝑋23ሺ𝑘ሻ+ 𝑊4𝑘𝑋24ሺ𝑘ሻ 𝐷𝑎𝑡𝑎 𝑥1 𝑥3 𝑥5 𝑥7

Stage 1 𝑋21ሺ𝑘ሻ= 𝑥0 + 𝑊2𝑘𝑥4 𝐷𝑎𝑡𝑎 𝑥0 𝑥4 𝑋22ሺ𝑘ሻ= 𝑥2 + 𝑊2𝑘𝑥6 𝐷𝑎𝑡𝑎 𝑥2 𝑥6

𝑋23ሺ𝑘ሻ= 𝑥1 + 𝑊2𝑘𝑥3 𝐷𝑎𝑡𝑎 𝑥1 𝑥5 𝑋24ሺ𝑘ሻ= 𝑥5 + 𝑊2𝑘𝑥7 𝐷𝑎𝑡𝑎 𝑥3 𝑥7

18

Stage 1 – N/2 2-point DFTs

Butterfly

1 – multiplication

2 – additions

(pseudo code)

This process can be repeated for ………

19

Stage 1 – N/2 2-point DFTs Butterflies

20

Stage 2 – N/4 4-point DFTs

21

Stage 2 – N/4 4-point DFTs

22

Stage 3 – 1 off 8-point DFTs

23

Butterflies for an 8-point FFT

Example:

Evaluate the DFT of the sequence {1, 0, 0, 1} using the decimation in time FFT.

This is a four point DFT with:

and

The re-ordered sequence is

Utilising the top left hand corner of the earlier butterfly diagram:

24

Example:

Evaluate the DFT of the sequence {1, 0, 0, 1} using the decimation in time FFT.

The DFT of the sequence {1, 0, 0, 1} is {2, 1+j, 0, 1-j}

25

26

By inspecting the butterflies for the 8-point FFT it can be seen that to execute the FFT the program must re-order the input data to perform the butterfly computations

butterfly butterfly butterfly butterfly

Re-ordering the input dataAt first it may seem that there is no way to program the re-ordering of the input data

The trick is to think binary……..

FFT Algorithmic Development

index 0 1 2 3 4 5 6 7data 34 56 21 27 65 85 66 23

index 0 1 2 3 4 5 6 7old index 0 4 2 6 1 5 3 7

data 34 65 21 66 56 85 27 23

27

Sequence re-ordering by bit reversal

Some example bit-reversal algorithms…….BitReversalAlgorithms.c

Original data sequence x Binary addresses Bit reversed addresses Re-ordered data sequence x

0 000 000 0

1 001 100 4

2 010 010 2

3 011 110 6

4 100 001 1

5 101 101 5

6 110 011 3

7 111 111 7

28

Computational Savings

Multiplies Adds Multiplies Adds2 4 2 1 24 16 12 4 88 64 56 12 2416 256 240 32 6432 1024 992 80 16064 4096 4032 192 384

128 16384 16256 448 896256 65536 65280 1024 2048512 262144 261632 2304 46081024 1048576 1047552 5120 102402048 4194304 4192256 11264 225284096 16777216 16773120 24576 491528192 67108864 67100672 53248 106496

DFT FFTN