Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
PHYS3152
Experimental Physics
Lecture Note E5
Frequency Analysis of Electronic Signals
2Purpose: understand the basic principles of frequency domain analysis of
electronic signals and study the Fast Fourier Transform (FFT).
Exercise 1: investigate the relationship between the effective sampling
rate and the resulting frequency resolution for the spectral
analysis using the FFT, and the spectral leakage properties
of the rectangular and Hanning windows.
Exercise 2: study aliasing effect
Exercise 3: using the FFT to analyze a square wave and a triangle wave.
Exercise 4: using the FFT to analyze a signal consisting of a sum of two
sinusoids.
Frequency Analysis of Electronic Signals
3How to Study These Signals?
Random signals: Not so random signal:
frequency
dB
(p
ow
er
)
Solution: frequency analysis
frequency
frequency
dB
(V
)
time time
4Take off your glass or watch at
distance: Monroe
Wear glass and watch closely: Einstein
Monroe’s photo: low frequency pass
Einstein’s photo: high spatial frequency
pass
Superposition these two photos.
Albert Einstein or Marilyn Monroe?
5Time Domain and Frequency Domain
The time-domain representation gives the amplitudes of the signal at
the instants of time during which it was sampled.
However, in many cases you need to know the frequency content of a
signal rather than the amplitudes of the individual samples.
The frequency domain graph shows how much of the signal lies within
each given frequency band over a range of frequencies. It can also
include information on the phase shift that must be applied to each
frequency component to recover the original time signal.
(t) V(f)
How to calculate these?
6Integral transform
problem in
transform space
solution in
transform space
solution of
original problem
Original
problem
b
a
dttKtfg ),()()(
Typical kernels: eit (Fourier) , e-t (Laplace), t-1 (Mellin), ……
Mapping a function f(t) in t-space into another function g() in space
e.g. t-space: time domain space: frequency domain
real space Fourier space (e.g. by X-ray scattering)
Some properties of f(t) may be hardly seen in t space, but easily seen in space
Motivation:
difficult solution
transform reverse transform
easy solution
g() is the integral transform of f(t) by the Kernel K(,t)
7Fourier Transform
Fourier transform
provides the link between
the time-domain and
frequency domain
descriptions of a signal.
dfefVtv
dtetvfV
tfi
tfi
2
2
)()(
)()(
Reverse transform:
8Fourier’s theorem states that any waveform in the
time domain can be represented by the weighted sum
of sines and cosines. The same waveform appears in
the frequency domain as a pair of amplitude and phase
values at each component frequency.
Fourier Series
9One Example
A square wave contains many high-frequency components
10
white noise P(f) = const.
e.g. thermal noise in a circuit…
pink noise P 1/f
earthquake, financial market,
DNA sequence, traffic flow…
Any universal mechanism???
Brown noise P 1/f 2,
Displacement of random walk
(Brownian motion)…
Power Spectrum
V(t) V(f) Power spectrum(a real function)
21( ) ( )lim T
T
P f V f
T
One signal contains many frequency components.
Which components dominate (contribute more energies)?
Fourier
Examples:
11
1 sec continuous wave 1 sec discrete wave
Sampling: the process of converting a signal (for example, a
function of continuous time or space) into a numeric sequence (a
function of discrete time or space).
Sampling of Signal
sampling rate = 256 samples/sec
(i.e. 256 Sa/s, 256 dots per sec)
12
Discrete Fourier Transform (DFT)
t0 : the starting time
: the smallest sampling time
fs=1/ : sampling rate
T=Nt : sampling duration
1
0
2
0 )()(
N
j
fji
k
kejtvfV
The time duration for a signal is finite!
Assumed periodicity of T=Nt
The output spectrum takes discrete values: )(
1 ......, ,2 ,1 sk fNN
f
s
Any difference between FT and DFT?
t0 t0+N
DFT: Fourier transform of discrete functions
13
Fast Fourier Transform (FFT)
DFT can be defined as where k = 1, 2, …. N
Since both j and k have N values, we need N2 calculations.
The Fast Fourier Transform (FFT) is simply a fast
(computationally efficient) way to calculate the Discrete Fourier
Transform (DFT). The speed NlogN.
In 1969, the 2048 point DFT analysis took 13 ½ hours. Using the
FFT, the same task on the same machine took 2.4 seconds!
kj
N
iN
j
jk efV
21
0
)(
14
=
Example: FFT of a cosine with 3, 6 or 9 periods
FFT
FFT
FFT
• Broader peaks & Artifacts (finite time effect) • Two peaks (alias)
FFT produces a frequency domain from 0 to fs/2 (from fs/2 to fs is redundant)
15
Nyquist Theorem and Aliasing
Nyquist Theorem: In order to represent the signal unambiguously, it is
necessary to sample at least twice the maximum frequency of the
signal.
Reversely speaking, if the sampling rate fs is fixed, the highest f can be
correctly sampled is the Nyquist frequency.
Any analog frequency greater than fs/2 will, after sampling, appear as a
frequency between 0 and fs/2. Such a frequency is known as an “alias”
frequency. So, the frequency fs/2 is called the folding frequency.
2/sNyquist ff
16
Aliasing
http://www.dsptutor.freeuk.com/aliasing/AliasingDemo.html
The applet is based on a fixed
sampling rate of 8000 samples
per second. The folding
frequency is thus half of
8000 Hz or 4000 Hz.
Case 1) Input frequency fin < fs/2 no aliasing, fout = fin.
Case 2) Input frequency fs/2 < fin < fs aliasing, with an aliasing
frequency fa = fs – fin..
Case 3) Input frequency f > fs aliasing, keep subtracting fs from fin
until the result is below fs. Then apply either of the previous
two rules, depending on whether the resulting frequency value
is below or above ½fs.
The following applet demonstrates graphically how an under-sampled
sinusoidal signal appears as though it has a lower "alias" frequency.
e.g. Fix input f, change sampling fs
True f = 8 Hz
Sampling fs = 8 Hz measured f = 0Hz
Sampling fs = 7 Hz f = 1Hz,
Sampling fs = 9 Hz f = 1Hz
fs =10Hz f = 2Hz,
fs =11Hz f = 3Hz,
…
fs = 16Hz f = 8Hz
fs = 17 Hz f = 8Hz
…
Correct only when fs >2 f
18
Frequency Folding
Folding frequency = fs/2 = 8. k =15, 17, 31, 33, … will fold to k =1
Theoretical understanding of the frequency folding
Recall DFT: and
1
0
2
0 )()(
N
j
jfi
k
kejtvfV )(1 ......, ,2 ,1 sk fNNf
)()( * kkN fVfV / 2 / 2 2
2 NkiNkiiN
kNi
eeee
Fixed fs = 16
(in units of 1/N)
so only frequencies from 0 to fs / 2 are needed.
output f
19
Example: Alias of a Triangular Wave
1MSa/s
500kSa/s
250kSa/s
f =25KHz
20
Ways to Avoid Aliasing
Ensure that the sampling rate is larger than twice the highest
frequency component present in the signal, if known.
Ensure that the signal is composed of frequency components
less than fs/2 by using a low-pass filter;
You lose the high frequency components
but ensure that the low frequency
components are properly represented.
21
Finite Time Effect
If not repeat:
*=
FFT
Bad
In practice, we only have finite time records. Such termination leads to the
distortion of the spectrum.
Short signals have broad frequency spectra
Long signals have narrow frequency spectra
duplicate the finite time record over all
time
FFT Good… …
22
Leakage Broadens Spectrum
original signal is the sum of two different sine waves
limitation of measuring time can create broadening of the spectrum
(leakage of frequency!)
23
Leakage
The leakage effect may also lead to aliasing. Since leakage results in a
spreading of the spectrum, the upper frequency may move beyond the
Nyquist frequency, and aliasing may then result.
FFT in the oscilloscope replicates the finite time record over all time
leakage
time
FFT
frequency
24
10 cycles FFT sharp
good
10.5 cycles leakage in FFT
bad
An Example of Leakage
25
Using Windows to Avoid Leakage
signal Hanning
window
=
no leakage, more accurate frequency measurement,
but amplitude accuracy is sacrificed.
Windowed signal,
both ends are 0
…
replicating
26
Other Common “Windows”
or Hanning
Rectangle (when the signal has no leakage)
27
Comparison between Rectangular and Hanning Windows
Fourier Transform of a 1KHz sinusoid.
The 1024 point DFT using the rectangular
window. The large spectral leakage
associated with the rectangular window
makes it a less desirable choice.
The 1024 point DFT using the Hanning
window. By avoiding an abrupt truncation
of the time-domain signal, the spectral
leakage properties are improved. The
main lobe width of the Hanning-windowed
spectrum is wider than that of the
rectangular-windowed spectrum and thus
the spectral resolution of the former is
reduced. The Hanning window is popular
because it achieves a good balance
between spectral leakage and resolution.
(a)
(b)
(c)
dBV=20log(V(f)/1Volt RMS)
28
Effects of Windowing
k = 7, 18
k = 18 not visible
(sampling stops at n = 16)
k = 18 becomes visible
after applying the
Hanning window
Windowing
• Makes spectrum visible
• Broadens the spectrum
• Modifies the amplitudes of frequency components