Professional Documents
Culture Documents
Students:
S
Khoa Xuan Ng
guyen - 142256211
Group:
G Tuesday ((10:00am)
Laborator
L ry: FFT analysis
Professor:
P Professorr Kah-Sen
ng Chung
Lab
L Superrvisor: Olusegun
n Aboaba
Date
D perfoormed: 9th April 2010,
2 16th April 20100, 23rd Aprril 2010
Date
D subm
mitted: 14th Aprill 2010
I hereby deeclare thatt calculatioons, experiimental andd/ or theorretical resuults, discusssion
and
a concluusions subm mitted in thhis report are entirelly my own work and d have not been
copied
c from any othher studennt or past student. If I wrote any resullts or metthods
already
a published elssewhere, alll references will be well
w cited and in thiss report.
nature:
Sign
Experiment Report 1: FFT analysis April 2010
Table of Contents
1. Abstract ...................................................................................................................... 3
2. Introduction ................................................................................................................. 3
4. Theoretical Analysis.................................................................................................... 4
Part 1 ..................................................................................................................... 11
Part 2 ..................................................................................................................... 20
Part 3 ..................................................................................................................... 23
Part 4 ..................................................................................................................... 28
Part 5 ..................................................................................................................... 34
6. Conclusion ................................................................................................................. 42
7. References ................................................................................................................. 42
Page 2
Experiment Report 1: FFT analysis April 2010
FFT ANALYSIS
1. Abstract
The main idea of this laboratory is to illustrate the relationship between frequency
resolution, effective signal sampling rate, spectral leakage, windowing and aliasing.
The method for frequency domain analyzing is Fast Fourier Transform (FFT) which is
implemented on HP 54600A device. Many experimental works have been conducted
to see the differences between theory and experimental works. Finally, conclusions are
given at the end of the report.
2. Introduction
In a communication system, it is necessary to analysis the signal in both time domain
and frequency domain. Fourier Transform or Discrete Fourier Transform is very useful
mathematical tool which links the time-domain and frequency-domain descriptions of
a signal. However, in real time applications where processing speed becomes crucial,
Fourier Transform and Discrete Fourier Transform become slow and in-efficient. To
overcome this limitation, FFT is used to obtain the same result in an acceptable range
in a smaller amount of time. And it is used in a wide variety of applications, from
digital signal processing and solving partial differential equations to algorithms for
quick multiplication of large integers.
3. Mathematical background
FFT
An FFT computes the DFT and produces exactly the same result as evaluating the
DFT definition directly. The only difference is that an FFT is much faster.
Let x0, ...., xN-1 be complex numbers. The DFT is defined by the formula
Page 3
Experiment Report 1: FFT analysis April 2010
fs
Frequency resolution for N-point DFT is: ( f s is sampling frequency)
N
Spectral leakage depends on relative amplitude of main lobe and side lobe of the
window. When two frequency approach each other in frequency spectrum, side lobe’s
amplitude of first one will affect to main lobe of the other and vice versa.
Windows’ main lobe’s width will affect spectral resolution. The spectral resolution
decreases if the width of main lobe decreases and vice versa.
Sampling
To avoid aliasing, the sampling frequency has to large or at least the Nyquist
frequency:
4. Theoretical Analysis
Part 1: Sampling rate, frequency resolution and spectral leakage
Assume that we have the sinusoidal signal with the frequency of 1kHz
The signal is sampled at the frequency 3kHz. Frequency spectrum of signal can be
shown in Figure 1. The spectrum contain one component at f = 1000 Hz and another
one at f=4000 Hz and so on. The spectrum has perfect frequency resolution so it
appears exactly one pulse at desired frequency. In fact, when we analysis signal in
frequency domain using FFT we must use specific window to truncate the signal
before FFT takes place. So these windows will affect frequency resolution and spectral
leakage:
The spectral leakage depends on the relative amplitude of main lobe and side
lobes of the window.
The spectral resolution depends on the width of the window.
Page 4
Experiment Report 1: FFT analysis April 2010
Base on these two observations and from the data shown in Figure 2 and Figure 3,
rectangular window will result better spectral resolution while hanning window
will produce smaller leakage.
Page 5
Experiment Report 1: FFT analysis April 2010
Part 2. Aliasing
Page 6
Experiment Report 1: FFT analysis April 2010
FFT of square or triangle wave contains a set of components besides the fundamental
frequency. These harmonics will extend to infinitive so we will need infinitive
sampling frequency to sample this signal. However, we can neglect all of the spectral
components after a specific harmonic which have the amplitudes relatively small.
Figure 4 and Figure 5 show FFT of square and triangle signal using Hanning window.
By continue considering this, we can assume that we can neglect all of the spectral
components after 9th harmonic for square wave or 5th harmonic for triangle wave
(acceptable neglecting level is: - 30 dB)
Page 7
Experiment Report 1: FFT analysis April 2010
Figure 6 shows the time domain and frequency domain analysis of the sum of 2
sinusoids which have one frequency is 1kHz and another one is 2kHz. Figure 6. b and
c show the effect of different effective sampling rate. It’s difficult to distinguished two
components as the sampling rate is increased.
Page 8
Experiment Report 1: FFT analysis April 2010
Theoretically, we can rank three windows: Rectangular, Hanning and Flattop windows
by spectral resolution and spectral amplitude measurement as following:
Spectral resolution: Rectangular window has narrowest main lobe width then
Hanning window and final is Flattop window so rectangular window can give
us the best spectral resolution, then Hanning window and the last one is Flattop
window.
Spectral amplitude measurement: difference between the relative amplitude of
main lobe and side lobe is smallest in case of rectangular window and largest in
case of Flattop window, so Flattop window can give us best spectral amplitude
measurement then Hanning window, and last is rectangular window.
Figure 7 show the comparison between Hanning window and Flattop window on
Page 9
Experiment Report 1: FFT analysis April 2010
Figure 7. Comparison FFT result of signal using Hanning window and Flattop
window
Page 10
Experiment Report 1: FFT analysis April 2010
5. Experimental results
Part 1. Sampling rate, frequency resolution and spectral leakage
With Find peaks facility on HP54600B oscilloscope, we can easily find the
fundamental frequency of the sinusoid:
So, we can notice that rectangular window has the main lobe width smaller than
Hanning window as it is in theoretical analysis. This can result rectangular window
has better spectral resolution
Discussion:
1) If the sampling frequency is f s 100 kHz then the frequency resolution for a
Page 11
Experiment Report 1: FFT analysis April 2010
f s 100 k
fixed N = 1024 points FFT is: 97.65 Hz
N 1024
2) Base on the formula for frequency resolution, to increase the frequency
resolution, we have to decrease the sampling signal. However, to avoid
aliasing, the sampling frequency must be larger than the Nyquist frequency.
3) The spectral resolution depends on the width of window so there is no
limitation on a fixed 1024 point FFT. We can increase or decrease spectral
resolution by changing the window.
4) By analyzing in part 1 – Theoretical analysis, hanning window produces less
leakage than rectangular window
Page 12
Experiment Report 1: FFT analysis April 2010
Figure 8. FFT of signal using Hanning window at 500kSa/s effective sampling rate –
fundamental frequency
Figure 9. FFT of signal using Hanning window at 500kSa/s effective sampling rate –
main lobe width
Page 13
Experiment Report 1: FFT analysis April 2010
Figure 10. FFT of signal using Rectangular window at 500kSa/s effective sampling
rate – fundamental frequency
Figure 11. FFT of signal using Rectangular window at 500kSa/s effective sampling
rate – main lobe width
Page 14
Experiment Report 1: FFT analysis April 2010
Figure 12. FFT of signal using Hanning window at 50kSa/s effective sampling rate –
fundamental frequency
Figure 13. FFT of signal using Hanning window at 50kSa/s effective sampling rate –
main lobe width
Page 15
Experiment Report 1: FFT analysis April 2010
Figure 14. FFT of signal using Rectangular window at 50kSa/s effective sampling rate
– fundamental frequency
Figure 15. FFT of signal using Rectangular window at 50kSa/s effective sampling rate
– main lobe width
Page 16
Experiment Report 1: FFT analysis April 2010
Figure 16. FFT of signal using Hanning window at 10kSa/s effective sampling rate –
fundamental frequency
Figure 17. FFT of signal using Hanning window at 10kSa/s effective sampling rate –
main lobe width
Page 17
Experiment Report 1: FFT analysis April 2010
Figure 18. FFT of signal using Rectangular window at 10kSa/s effective sampling rate
– fundamental frequency
Figure 19. FFT of signal using Rectangular window at 10kSa/s effective sampling rate
– main lobe width
Page 18
Experiment Report 1: FFT analysis April 2010
Part 2. Aliasing
Compute FFT of sinusoidal signal with frequency of 10kHz at sampling rate 50kHz
which produce a spectrum with one component at 10kHz as shown in Figure 20.
Increasing signal’s frequency until it passes over half of Nyquist frequency, aliasing
will happen. Following diagram for case the signal frequency is 40kHz:
Figure 21 shows that from 0-24.41kHz, there’s only one component which is aliasing
component of original signal at f = 10kHz.
If we keep the frequency 40kHz and change the sampling rate to 100kSa/s that means
the sampling rate larger than Nyquist rate so we can obtain the component at 40kHz in
spectrum (no aliasing) as shown in Figure 22.
Discussion:
2. Aliasing appears when the sampling rate is less than Nyquist rate so it doesn’t
depend on the choice of window. Figure 23 shows that there is still aliasing
when using rectangular window.
Page 19
Experiment Report 1: FFT analysis April 2010
9.98 kHz
2.44kHz
Figure 20. FFT of sinusoidal signal with frequency of 10 kHz – sampling rate 50kSa/s
Figure 21. FFT of sinusoidal signal when increase its frequency to 40kHz
Page 20
Experiment Report 1: FFT analysis April 2010
Figure 22. FFT of sinusoidal signal with frequency of 40 kHz – sampling rate
100kSa/s
Figure 23. FFT of sinusoidal signal with frequency of 40kHz – sampling rate 50kSa/s
– using rectangular window
Page 21
Experiment Report 1: FFT analysis April 2010
Page 22
Experiment Report 1: FFT analysis April 2010
Figure 24. FFT of square wave, difference between first and second harmonics
Figure 25. FFT of square wave, difference between second and third harmonics
Page 23
Experiment Report 1: FFT analysis April 2010
Figure 28. FFT of triangle wave, difference between first and second harmonics
Figure 29. FFT of triangle wave, difference between second and third harmonics
Page 25
Experiment Report 1: FFT analysis April 2010
Page 26
Experiment Report 1: FFT analysis April 2010
Two sinusoidal signals respectively have frequency of 1kHz and 2kHz (Figure 32) are
added together to result and sum signal. The sum signal has unstable time domain
display, use Run and Stop facilities we can catch snapshot of this signal. Figure 33 to
Figure 36 show 4 snapshots of this signal at 4 different time.
With unstable time domain display, we can not analyze this sum signal to determine its
components. By using FFT, we can do that in frequency domain. In frequency domain,
this sum signal contains two components at 1kHz and 2kHz as shown in Figure 37.
When we increase the effective sampling rate to 20kSa/s, 50kSa/s and 100kSa/s as
respectively shown in Figure 38, 39 and 40, we are still enable to recognize those two
components, but it’s harder to distinguished them. The reason for this is that spectral
resolution decrease when increase sampling rate, so it’s harder to distinguished two
sinusoids which have their fundamental frequency close to each other.
In case that one signal has frequency of 1kHz and the other one has frequency of
50kHz, so those two components in sum signal’s spectrum can be easily distinguished
as shown in Figure 41.
Discussion:
Page 27
Experiment Report 1: FFT analysis April 2010
Figure 32. Two sinusoidal signal with frequency of 1kHz and 2kHz
Page 28
Experiment Report 1: FFT analysis April 2010
Page 29
Experiment Report 1: FFT analysis April 2010
Page 30
Experiment Report 1: FFT analysis April 2010
Figure 41. FFT of sum of sinusoids: 1kHz and 50kHz (sampling rate: 200kSa/s)
Page 32
Experiment Report 1: FFT analysis April 2010
Page 33
Experiment Report 1: FFT analysis April 2010
Page 34
Experiment Report 1: FFT analysis April 2010
Page 35
Experiment Report 1: FFT analysis April 2010
Page 38
Experiment Report 1: FFT analysis April 2010
Page 40
Experiment Report 1: FFT analysis April 2010
Page 41
Experiment Report 1: FFT analysis April 2010
6. Conclusion
This experiment is one of chances to keep practicing some laboratory skills:
7. References
[1] Benvenuto & Nevio, “Communication systems: fundamentals and design
methods”, John Wiley, 2007.
[2] http://bauhaus.ece.curtin.edu.au/~ce303/.
Page 42