PHY 406 - Microprocessor Interfacing
Techniques
Module 7 - Fourier Transforms
In this module we will explore the issues of Fourier Transforms in the sampled domain using
some practical examples.
Preparation
You will need to read the lecture notes on Fourier transforms and associated subjects. You might
also like to find another book on the subject of Fourier transforms.
Equipment
You will need the signal generator for the last part of this module.
You will need various VIs from the Analysis section - but you should now be familiar enough
with LabVIEW to find them for yourselves.
First Thoughts
- Write a VI to generate an integer number of cycles of a sine wave in an array and then do a
Fourier transform of the series and graph it. A series length of exactly 2^n should be used and
512 is a good number (as are 256 and 1024). Satisfy yourself (and me!) of the relationship
between the index of the time array and the index of the FFT array. (ie the sampling time and
the frequency) Comment on the difference between the spectrum you might expect to see and
the spectrum you do see.
- Now try the same thing with a square wave and see if the FFT produces the correct harmonic
amplitudes as you would expect (the square wave should go between +-1 so that the average
value is 0.)
- Try it with a pulse function - which is the nearest thing you can get to a delta function and
satisfy yourself (and me!) that an array of delta functions does indeed transform into an array
of delta functions and that the spacings are right.
Hidden Assumptions
- Now transform an array which contains a non-integer number of sine cycles - e.g. 8.5. What
differences do you see between an integer number of cycles and a non-integer number?
- The FFT routine assumes that the infinite time series is constructed from the time series you
give it by repeating the series "ad nauseam" - can you qualitatively explain what you see on
that basis?
- Use a "windowing function" (if you have time you could try several) on your time series and
see what effect this has on the frequency spectrum.
- Interpret the effect of the windowing in terms of the above assumptions?
Real Signals
- Feed the input of the signal generator into the system with suitable frequency and sampling.
Use your FFT expertise to take the FFT of the input.
- Calibrate your system so that the vertical axis is in rms Volts and the horizontal in Hz (or
kHz).
- Try a number of waveforms and see if you get the expected answers
Advanced
This section is for the intelligent/bored or otherwise fascinated. There are no marks for this
section - only the satisfaction of solving a problem or two.
- Can you quantitatively explain the relationship between the rms value of a random number
sequence being transformed and the quantitative numbers you get out?
- Does the result depend upon the distribution (flat, Gaussian, Poisson)?
- If a random function is really flat in frequency and is then sampled the convolution in the
frequency domain involves the superposition of an infinite number of flat frequency spectra.
How can we avoid the infinite power that will (apparently) be generated?
Notes
- The FFT routine - a Fast Fourier Transform - is not quite the same as the true Fourier
transform, particularly in the assumptions that it makes about the relationship between the
finite time series given and the infinite series required.
- There is also a problem with the FFT if there is a large DC or average component to the time
series which ends up as the zeroth coefficient of the FFT. The system can simply run out of
numerical precision in the calculations. It is good practice to ensure that this isn't a problem
by subtracting the average value of the series before the FTT. (Of course, a well-designed FFT
routine might do this for you anyway!)
- "Windowing" (or apodisation) is a widely used technique - we met it in our filtering theory.
Here it is again used in a slightly different context - but for very much the same reasons.