You are on page 1of 30

Signal Processing Fundamentals – Part I

Spectrum Analysis and Filtering


5. Fourier Transform and Spectrum Analysis

5. Fourier Transform and Spectrum


Analysis

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

Spectrum of Non-periodic
Signals
• 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
2
Signal Processing Fundamentals – Part I
Spectrum 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) Radian frequency

• The spectrum of x[n] is given by: ωˆ = ωTs


∞ ∞
X p (ω ) = ∑ x[n]e − jωnTs
or X p (ωˆ ) = ∑ x[n]e − jωˆ n
n= −∞ n= −∞
3
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

Aperiodic Signals have Periodic


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


X p (ωˆ + 2πk ) = ∑ x[ n ]e − j (ωˆ + 2πk ) n

n= −∞ 1

= ∑ x[n]e − jωˆ n − j 2πnk
e = X p (ωˆ )
n= −∞
4
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

X p (ωˆ )

-2π 0 2π
ωˆ = ωTs

5
Signal Processing Fundamentals – Part I
Spectrum 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

1
X p (ωˆ ) =
Ts
∑ X (ωˆ + 2πk ) −∞ ≤ω ≤ ∞
k = −∞
1
= K+ X (ωˆ − 2π )
Ts
1
+ X (ωˆ )
Ts
1
+ X (ωˆ + 2π )+ K
Ts
6
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

Time Domain Frequency Domain

x(t) X(ω)
1

0 t -B 0 B ω
Ideal low
X p (ωˆ ) pass filter
x[n]=x(nTs)

ωˆ = ωTs
0 | |←Ts n -2π 0 2π

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

Time Domain Frequency Domain


x(t) X(ω)
1

0 t -B 0 B ω

x[n] X p (ωˆ )

n
0 | |←Ts -2π 0 2π ωˆ = ωTs
x[n] X p (ωˆ )

0 | |←Ts n
-2π 0 2π
8 ωˆ = ωTs
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

Time Domain Frequency Domain


x(t) X(ω)
1

0 t -B 0 B ω

x[n] X p (ωˆ )

0 | |←Ts n
ωˆ = ωTs
x’(t) X’(ω)

0 t -B 0 B ω
9
Signal Processing Fundamentals – Part I
Spectrum 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
ωˆ ≤ π ⇒ 2πf maxTs ≤ π
⇒ 2πf max ≤ πf s or f s ≥ 2 f max
10
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

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
NyquistFrequency
Frequency
11
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

Real Examples
Time Domain Frequency Domain
Resulted signal

Ideal low pass filter


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

Time Domain Frequency Domain

Resulted signal

Ideal low pass filter

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

Time Domain Frequency Domain

Resulted signal

Ideal low pass filter

14
Signal Processing Fundamentals – Part I
Spectrum 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
Pre-filterthe
theinput
inputsignal
signalsuch
suchthat
thatititwill
willnever
never
has
hasfrequency
frequencycomponents
componentsbeyond
beyond|π|
|π|

Pre- A/D Digital Signal D/A Post-


filter Processor filter
15
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

Time Domain Frequency Domain


x(t) X(ω)
1

0 t -B 0 B ω
X(ω)
Anti-aliasing 1
filter
ω
x[n] X p (ωˆ )

n
0 | |←Ts -2π 0 2π ωˆ = ωTs
16
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

With anti-aliasing filter Without anti-aliasing filter


X p (ωˆ ) X p (ωˆ )

ωˆ = ωTs ωˆ = ωTs
Ideal low Ideal low
pass filter pass filter
X’(ω) X’(ω)

ω ω
Look better
17
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

Hear the effect!

Original 8kHz 8kHz


44.1kHz sampling sampling
sampling with with anti-
aliasing aliasing filter

18
Signal Processing Fundamentals – Part I
Spectrum 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
19
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

• Recall the Fourier transform of an aperiodic


discrete sequence

X p (ωˆ ) = ∑ x[ n ]e − jωˆ n

n= −∞

• Assume x[n] is an aperiodic sequence with N values,


i.e. {x[n] : n = 0, 1, ..., N-1}

N −1
X p (ωˆ ) = ∑ x[ n ]e − jωˆ n

n=0

20
Signal Processing Fundamentals – Part I
Spectrum 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.

 k .2π 
X [k ] = X p   k = 0,1, K N − 1
 N 
X p (ωˆ ) IfIfNN==13
13

k=0 k=4

2π/N ωˆ = ω T s
-2π 0 2π
21
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

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


frequencies,
 k .2π 
N −1 − j   nTs
X [k ] = ∑ x[n]e  Ts N  W Nnk = e − j 2πnk / N
n=0
N −1 N −1
= ∑ x[ n ]e − jk .2πn / N
= ∑ x[ n ]W nk
N
n=0 n=0
for k = 0,1,…, N-1

Discrete Fourier Transform


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

• Discrete Fourier Transform (DFT) is exactly the


output of the Fourier Transform of an aperiodic
sequence at some particular frequencies
N −1
• Inherently
periodic since
X [k ] = ∑ x[ n ]e − j 2πnk / N

n=0
X[k+N] = X[k], N −1
although we X [k + N ] = ∑ x[ n ]e − j 2πn( k + N ) / N

always only n=0


1
consider one N −1
period of X[k] = ∑ x[ n ]e − j 2πnk / N − j 2πn
e = X [k ]
n=0
23
Signal Processing Fundamentals – Part I
Spectrum 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
N −1
1
x[n] =
N
∑ X [ k ]e j 2πnk / N

n=0
N −1
1
=
N
∑ X [ k ]
W − nk
N for n = 0,1,…, N-1
n=0

Inverse Discrete Fourier Transform


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

• It can be proven as follows:

N −1 N −1 N −1
1 1
N
∑ X [ k ]e jk 2πn / N
=
N
∑ ∑ x[ m ]e − jk 2πm / N jk 2πn / N
e
k =0 k =0 m =0
N −1 N −1
1
=
N
∑ ∑ x[ m ]e jk .2π ( n − m ) / N

k =0 m =0
N −1 N −1 jk .2π ( n− m ) / N 
1
0

if n ≠ m =
N
∑ x[m ] ∑ e 

N otherwise m =0  k =0
= x[n] for n = 0,1,..., N − 1

25
Signal Processing Fundamentals – Part I
Spectrum 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
Fourier
• Example One period of
Transform
X p (ωˆ )
x[n]

n 10
X[k] if N = 10
0 9 So different from
NN==10
10 X p (ωˆ )
k
DFT
26
Signal Processing Fundamentals – Part I
Spectrum 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

x[n]
Pad
Pad40
40zeros
zeros
n
0 9 50

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

40 zeros
27
Signal Processing Fundamentals – Part I
Spectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis

N
N == 50
50

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

N
N == 100
100

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

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

x[n]
2 2
1 1
n
0 3

30

You might also like