5. fourier transform and spectrum analysisenpklun/eie327/dft.pdf · 3 signal processing...

30
1 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis 5. Fourier Transform and Spectrum 5. Fourier Transform and Spectrum Analysis Analysis

Upload: letruc

Post on 17-Jul-2018

222 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

1

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

5. Fourier Transform and Spectrum 5. Fourier Transform and Spectrum AnalysisAnalysis

Page 2: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

2

Spectrum of Non-periodic Signals

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• Fourier series help us to find the spectrum of periodic signals

• Most signals are not periodic• Speech, audio, etc.

• Need another tool to find the spectrum of non-periodic (aperiodic) signals⇒ Fourier Transform

Page 3: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

3

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

Fourier Transform of Discrete-time Signals• Let x(t) be an aperiodic continuous-time signal, x[n]

is the samples of x(t) such that:

x[n] = x(nTs)

• The spectrum of x[n] is given by:

( ) ∑∞

−∞=

−=n

nTjp

senxX ωω ][ ( ) ∑∞

−∞=

−=n

njp enxX ωω ˆ][ˆor

Radian frequency

sTωω =ˆ

Page 4: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

4

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• It is interesting to note that Xp(ω) is periodic since

Aperiodic Signals have Periodic Spectrum

( )

)ˆ(][

][2ˆ

)2ˆ(

ω

πω

πω

πω

pn

nkjnj

n

nkjp

Xeenx

enxkX

==

=+

∑∞

−∞=

−−

−∞=

+−

1

Page 5: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

5

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

0 sTωω =ˆ2π-2π

)ˆ(ωpX

Page 6: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

6

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• If x(t) has a spectrum of X(ω) and x[n] = x(nTs) has a spectrum of Xp(ω), it can be shown that

∑∞

−∞=∞≤≤∞−+=

ksp kX

TX ωπωω )2ˆ(1)ˆ(

K

K

+++

+

−+=

)2ˆ(1

)ˆ(1

)2ˆ(1

πω

ω

πω

XT

XT

XT

s

s

s

Page 7: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

7

Ideal low pass filter

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

x(t) X(ω)

t0 -B 0 B ω

1

x[n]=x(nTs)

n0 | |←Ts -2π 0 2π

Time Domain Frequency Domain

sTωω =ˆ

)ˆ(ωpX

Page 8: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

8

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

n

n

Time Domain Frequency Domain

1

t0 -B 0 B ω

0 | |←Ts

0 | |←Ts

-2π 0 2π

-2π 0 2π

x(t) X(ω)

x[n] )ˆ(ωpX

x[n] )ˆ(ωpXsTωω =ˆ

sTωω =ˆ

Page 9: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

9

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

Time Domain Frequency Domain

1

t0 -B 0 B ω

n0 | |←Ts

x’(t) X’(ω)

t0 -B 0 B ω

x(t) X(ω)

x[n] )ˆ(ωpX

sTωω =ˆ

Page 10: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

10

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• If the signal has frequency components beyond |π|,after sampling, these frequency components will affect the other replicas in the spectrum

• Even with an ideal low pass filter, the original signal cannot be reconstructed. This is the so-called alias effect

• Restate the Shannon Sampling Theorem for general aperiodic signals

maxmax

max

22

fforff

Tf

ss

s

≥≤⇒

≤⇒≤

ππ

πππω

Page 11: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

11

Shannon Sampling Theorem

A continuous-time aperiodic signal x(t) with frequencies no higher than fmax can be reconstructed exactly from its samples x[n] = x(nTs) if the samples are taken at a rate fs = 1/Ts that is greater than 2fmax

Nyquist FrequencyNyquist Frequency

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

Page 12: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

12

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

Real ExamplesTime Domain Frequency Domain

Ideal low pass filter

Resulted signal

Page 13: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

13

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

Time Domain Frequency Domain

Ideal low pass filter

Resulted signal

Page 14: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

14

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

Time Domain Frequency Domain

Ideal low pass filter

Resulted signal

Page 15: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

15

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

How to Solve Aliasing Problems?1. Increase the sampling rate such that fs ≥ 2fmax

2. Use anti-aliasing filter first

Pre-filter the input signal such that it will never has frequency components beyond |π|Pre-filter the input signal such that it will never has frequency components beyond |π|

Pre-filter

A/D Digital Signal Processor

D/A Post-filter

Page 16: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

16

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

n

Time Domain Frequency Domain

1

t0 -B 0 B ω

0 | |←Ts -2π 0 2π

x(t) X(ω)

x[n] )ˆ(ωpX

sTωω =ˆ

Anti-aliasing filter

1

ω

X(ω)

Page 17: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

17

Ideal low pass filter

Ideal low pass filter

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

)ˆ(ωpX

sTωω =ˆ

)ˆ(ωpX

sTωω =ˆ

With anti-aliasing filter Without anti-aliasing filter

ω

X’(ω) X’(ω)

ω

Look better

Page 18: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

18

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

Original 44.1kHz sampling

8kHz sampling

with aliasing

8kHz samplingwith anti-

aliasing filter

Hear the effect!

Page 19: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

19

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

Discrete Fourier Transform• Spectrum of aperiodic discrete-time signals is

periodic and continuous• Difficult to be handled by computer• Since the spectrum is periodic, there’s no point to

keep all periods – one period is enough• Computer cannot handle continuous data, we can

only keep some samples of the spectrum• Interesting enough, such requirements lead to a

very simple way to find the spectrum of signals⇒ Discrete Fourier Transform

Page 20: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

20

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• Recall the Fourier transform of an aperiodicdiscrete sequence

nj

np enxX ωω ˆ][)ˆ( −

−∞=∑=

• Assume x[n] is an aperiodic sequence with N values, i.e. {x[n] : n = 0, 1, ..., N-1}

njN

np enxX ωω ˆ

1

0][)ˆ( −

=∑=

Page 21: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

21

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• If we are now interested only in N equally spaced frequencies of 1 period of the Fourier spectrum, i.e.

1,1,02.][ −=

= Nk

NkXkX p K

π

0 sTωω =ˆ2π-2π

)ˆ(ωpX If N = 13If N = 13

2π/N

k = 0 k = 4

Page 22: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

22

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

∑∑

∑−

=

=

=

==

=

1

0

1

0

/2.

1

0

2.

][][

][][

N

n

nkN

N

n

Nnjk

N

n

nTNT

kj

Wnxenx

enxkXs

s

π

πNnkjnk

N eW /2π−=

Discrete Fourier Transform

• Now if we want to compute the value of these N frequencies,

for k = 0,1,…, N-1

Page 23: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

23

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• Discrete Fourier Transform (DFT) is exactly the output of the Fourier Transform of an aperiodicsequence at some particular frequencies

][][

][][

][][

2/21

0

/)(21

0

/21

0

kXeenx

enxNkX

enxkX

njNnkjN

n

NNknjN

n

NnkjN

n

==

=+

=

−−−

=

+−−

=

−−

=

ππ

π

π• Inherently periodic since X[k+N] = X[k],although we always only consider one period of X[k]

1

Page 24: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

24

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• If we know X[k], we can reconstruct back the signal x[n] via the inverse discrete Fourier transform

nkN

N

n

NnkjN

n

WkXN

ekXN

nx

−−

=

=

=

=

1

0

/21

0

][1

][1][ π

for n = 0,1,…, N-1

Inverse Discrete Fourier Transform

Page 25: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

25

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• It can be proven as follows:

1,...,1,0][

][1

][1

][1][1

1

0

/)(2.1

0

1

0

/)(2.1

0

1

0

/2/21

0

1

0

/2

−==

=

=

=

∑∑

∑∑

∑∑∑

=

−−

=

=

−−

=

=

−−

=

=

Nnfornx

emxN

emxN

eemxN

ekXN

N

k

NmnjkN

m

N

m

NmnjkN

k

N

m

NnjkNmjkN

k

N

k

Nnjk

π

π

πππ

otherwiseNmnif0

Page 26: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

26

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• Although DFT gives exact frequency response of a signal, sometimes it may not give the desired spectrum

• Example

0n

9

N = 10N = 10

x[n])ˆ(ωpX

One period of

k

10 X[k] if N = 10So different from

)ˆ(ωpX

FourierTransform

DFT

Page 27: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

27

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

• Need improved resolution

• Achieve by padding zero to the end of x[n] to make N bigger

0n

50

x[n]

9

x[n] = {1 1 1 1 1 1 1 1 1 1 0 0 0 0 … 0}

40 zeros

Pad 40 zerosPad 40 zeros

Page 28: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

28

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

N = 50N = 50

Page 29: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

29

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

N = 100N = 100

Page 30: 5. Fourier Transform and Spectrum Analysisenpklun/EIE327/DFT.pdf · 3 Signal Processing Fundamentals – Part I Spectrum Analysis and Filtering 5. Fourier Transform and Spectrum Analysis

30

Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering

5. Fourier Transform and Spectrum Analysis

0n

3

x[n]

Exercise

12 2

1

Given that x[n] is defined in the following figure, determine its spectrum using DFT with N = 4