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
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
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
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ωω =ˆ
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ˆ
)2ˆ(
ω
πω
πω
πω
pn
nkjnj
n
nkjp
Xeenx
enxkX
==
=+
∑
∑∞
−∞=
−−
∞
−∞=
+−
1
5
Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis
0 sTωω =ˆ2π-2π
)ˆ(ωpX
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
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
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ωω =ˆ
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ωω =ˆ
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
2ˆ
fforff
Tf
ss
s
≥≤⇒
≤⇒≤
ππ
πππω
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
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
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
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
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
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(ω)
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
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!
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
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][)ˆ( −
−
=∑=
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
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
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
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
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
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
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
28
Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis
N = 50N = 50
29
Signal Processing Fundamentals – Part ISpectrum Analysis and Filtering
5. Fourier Transform and Spectrum Analysis
N = 100N = 100
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