You are on page 1of 42

Coommu

unication Engineerr 303

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

3. Mathematical background ........................................................................................... 3

4. Theoretical Analysis.................................................................................................... 4

5. Experimental results .................................................................................................. 11

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:

f s  2B B: bandwidth of the signal

4. Theoretical Analysis
Part 1: Sampling rate, frequency resolution and spectral leakage

Assume that we have the sinusoidal signal with the frequency of 1kHz

x  A cos2ft    where f  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.

Figure 1. spectrum of 1KHz signal sampled at 5KHz

Figure 2. Rectangular window

 
Page 5
 
Experiment Report 1: FFT analysis April 2010

Figure 3. Hanning window

Part 2. Aliasing

Original band limited signal

Sampled signal with f s  2 B

By feeding the sampled signal to a


low pass filter, we can recover the
original signal

 
Page 6
 
Experiment Report 1: FFT analysis April 2010

But in case that f s  2 B there will


be overlap called aliasing which
cause difficult to recover the
original signal or distortion.

Part 3. Frequency analysis of periodic signals

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. FFT for square wave

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 5. FFT for triangle wave

Part 4. A sum of sinusoids

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

b. sampling rate 10kSa/s

c. sampling rate 50kSa/s

Figure 6. FFT of a sum of two sinusoids

Part 5. Comparison of FFT window functions

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

theirs main lobe width.

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:

 FFT using Hanning window: in case


o Sampling rate is 500kSa/s: 854.5 Hz (Figure 8)
o Sampling rate is 50kSa/s: 976.6 Hz (Figure 12)
o Sampling rate is 10kSa/s: 993.7 Hz (Figure 16)
 FFT using rectangular window: in case
o Sampling rate is 500kSa/s: 915.5 Hz (Figure 10)
o Sampling rate is 50kSa/s: 964.4 Hz (Figure 14)
o Sampling rate is 10kSa/s: 991.2 Hz (Figure 18)

Consider the width of main lobe:

 Main lobe of Hanning window: in case


o Sampling rate is 500kSa/s: 1,953 Hz (Figure 9)
o Sampling rate is 50kSa/s: 231.9 Hz (Figure 13)
o Sampling rate is 10kSa/s: 43.95 Hz (Figure 17)
 Main lobe of rectangular window: in case
o Sampling rate is 500kSa/s: 976.6 Hz (Figure 11)
o Sampling rate is 50kSa/s: 170.9 Hz (Figure 15)
o Sampling rate is 10kSa/s: 31.74 Hz (Figure 19)

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:

1. Signal frequency: 120kHz, sampling rate 50kSa/s, frequency span: 0-50kHz

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

Part 3. Frequency analysis of periodic signals


Figure 24 and Figure 25 show FFT of 500kHz square wave using Flattop window. Use
the Cursor and Find Peaks facilities on HP56400B, we can measure the difference
between first, second and third harmonic. (sampling rate: 100MSa/s)
 Difference between first and second harmonics:
V  9.563 dB (Figure 24)
 Difference between second and third harmonics:
V  4.5 dB (Figure 25)
If the input signal is triangle wave:
 Difference between first and second harmonics:
V  20.66 dB (Figure 28)
 Difference between second and third harmonics:
V  4.844 dB (Figure 29)
If we reduce the sampling rate to 5MSa/s, aliasing will happen and it will cause the
higher harmonic appear at lower frequency in FFT spectrum.
 Square wave: Figure 26 and Figure 27
 Triangle wave: Figure 30 and Figure 31
5th harmonic appears at 1MHz frequency before 3rd harmonic at 1.5MHz (shown
on Figures)
Discussion:
1. There’s no need to have a stable time-domain display to analyze the frequency
component of a signal. Frequency spectrum depends and the signal only, not its
display.
2. If there’s no prior knowledge about the input signal, we can follow these steps
to have a reasonable FFT display:
a. Using auto-scale facility on HP56400B to estimate the fundamental
frequency of the input signal.
b. Changing the effective sampling rate to obtain the whole picture of FFT
spectrum. From this, we can observe aliasing effect to determine suitable
effective sampling rate.
c. Change the center frequency, frequency span and reference level to obtain
good FFT display
3. If we have prior knowledge about signal’s bandwidth we can then get useful
information from FFT display when components are aliased.

 
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

5th harmonic at 1MHz

Figure 26. Aliasing when sampling rate is 5MSa/s – frequency measurement

5th harmonic at 1MHz

Figure 27. Aliasing when sampling rate is 5MSa/s – amplitude measurement


 
Page 24
 
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

5th harmonic at 1MHz

Figure 30. Aliasing when sampling rate is 5MSa/s – frequency measurement

5th harmonic at 1MHz

Figure 31. Aliasing when sampling rate is 5MSa/s – amplitude measurement

 
Page 26
 
Experiment Report 1: FFT analysis April 2010

Part 4. A sum of sinusoids

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:

1. When we analyze signal which contains high frequency components, to avoid


aliasing, we must set sampling rate to at least double the highest frequency of
that signal. That means the spectral resolution of the FFT will decrease so it is
hard to analyze the narrowband components if the value of spectral resolution is
large enough.
2. To analyze AM signal using FFT, we must set the sampling rate at least double
of the carrier frequency to avoid aliasing. And carrier’s frequency usually very
high compare to very low message signal. For example the carrier’s frequency
is 1MHz and the message’s frequency is 100Hz, we need the sampling rate to be
at least 2MHz. By using 1024 point FFT, the frequency resolution will be nearly
2kHz. So, we can’t determine the message’s frequency component which is
100Hz < 2kHz.

 
Page 27
 
Experiment Report 1: FFT analysis April 2010

Figure 32. Two sinusoidal signal with frequency of 1kHz and 2kHz

Figure 33. Sum signal trace 1

 
Page 28
 
Experiment Report 1: FFT analysis April 2010

Figure 34. Sum signal trace 2

Figure 35. Sum signal trace 3

 
Page 29
 
Experiment Report 1: FFT analysis April 2010

Figure 36. Sum signal trace 4

Figure 37. FFT of sum signal with sampling rate of 10kSa/s

 
Page 30
 
Experiment Report 1: FFT analysis April 2010

2 Components move to each other

Figure 38. FFT of sum signal with sampling rate of 20kSa/s

Figure 39. FFT of sum signal with sampling rate of 50kSa/s


 
Page 31
 
Experiment Report 1: FFT analysis April 2010

Figure 40. FFT of sum signal with sampling rate of 100kSa/s

Figure 41. FFT of sum of sinusoids: 1kHz and 50kHz (sampling rate: 200kSa/s)

 
Page 32
 
Experiment Report 1: FFT analysis April 2010

Part 5. Comparison of FFT window functions

Rectangular window: Figure 45


Peak amplitude: -468.6 mdBV
Hanning window: Figure 44
Peak amplitude: -343.6 mdBV
Flattop window: Figure 43
Peak amplitude: -312.5 mdBV
So, Flattop window will produce the amplitude nearest to 0dBV.
Two sinusoids have the frequency respectively 1kHz and 1.2kHz are added
together. FFT of sum signal using hanning, rectangular and flattop windows
are shown in Figure 47, 48 and 51 respectively. Theoretically, rectangular
window can result in better spectral resolution but spectral leakage by using
rectangular window is more than hanning window. That means it’s easier to
distinguished two components by using hanning window than using
rectangular window.
By using auto store facility, we use the averaging method to remove noise
to obtain a better FFT display. Figure 52 to Figure 57 show the result of this
auto store process.
Discussion:
1. Base on the analysis and lab result, we can rank three windows in
term of effectiveness of measuring spectral amplitude: Flattop >
Hanning > Rectangular
2. In term of spectral resolution: Hanning > Rectangular > Flattop.

 
Page 33
 
Experiment Report 1: FFT analysis April 2010

Figure 42. the sinusoid with fundamental frequency of 1kHz

Figure 43. FFT using Flattop window

 
Page 34
 
Experiment Report 1: FFT analysis April 2010

Figure 44. FFT using Hanning window

Figure 45. FFT of rectangular window

 
Page 35
 
Experiment Report 1: FFT analysis April 2010

Figure 46. FFT of sum signal using Hanning window – amplitude


measurement

Figure 47. FFT of sum signal using Hanning window – frequency


measurement
 
Page 36
 
Experiment Report 1: FFT analysis April 2010

Figure 48. FFT of sum signal using rectangular window – frequency


measurement

Figure 49. FFT of sum signal using rectangular window – amplitude


measurement
 
Page 37
 
Experiment Report 1: FFT analysis April 2010

Figure 50. FFT of sum signal using Flattop window – amplitude


measurement

Figure 51. FFT of sum signal using Flattop window – frequency


measurement

 
Page 38
 
Experiment Report 1: FFT analysis April 2010

Figure 52. FFT of sum signal using Flattop window – frequency


measurement

Figure 53. FFT of sum signal using rectangular window – amplitude


measurement – auto store
 
Page 39
 
Experiment Report 1: FFT analysis April 2010

Figure 54. FFT of sum signal using Hanning window – frequency


measurement – auto store

Figure 55. FFT of sum signal using Hanning window – amplitude


measurement – auto store

 
Page 40
 
Experiment Report 1: FFT analysis April 2010

Figure 56. FFT of sum signal using Flattop window – frequency


measurement – auto store

Figure 57. FFT of sum signal using Flattop window – amplitude


measurement – auto store

 
Page 41
 
Experiment Report 1: FFT analysis April 2010

6. Conclusion
This experiment is one of chances to keep practicing some laboratory skills:

 Using devices and their facilities to obtain desired result.


 Estimating base on theoretical knowledge to make experiments easier and
faster.
 Troubleshooting base on basic knowledge about device and experiment’s topic

Main outcome of this experiment:

 Basic knowledge on sampling, aliasing and windowing


 Relationship between effective sampling rate, signal’s bandwidth, spectral
leakage, frequency resolution and spectral resolution.
 Frequency analysis of periodic signal using different window base on purpose
of analyzing

7. References
[1] Benvenuto & Nevio, “Communication systems: fundamentals and design
methods”, John Wiley, 2007.
[2] http://bauhaus.ece.curtin.edu.au/~ce303/.

 
Page 42
 

You might also like