A TestPoint program has been assembled for
you which will allow you to collect and analyze data for experiment
#6 as described in the instruction sheets. However, you are asked
here to perform a number of additional experiments with the data
to explore the properties of time series and Fourier transforms.
We provide you with some instruction in the use of TestPoint to
allow you to carry out the experiments that are described in section
III. In order to perform them you will need to make variations
of the program. Section II provides you with a description of
the function of the items in the program so that you can learn
how to change them. You should explore them and make changes to
help you understand how it works. When you are finished, close
the program without saving it so as to leave the original one
for use by other students.
TESTPOINT WINDOW STRUCTURE
If the program is not already loaded, open TestPoint and then under the "File" menu select " Open". Then double click on the file "noise.tst". The TestPoint Window will then present four panels, two of which overlap. On the upper left is the STOCK panel which contains icons for all of the available actions or functions of TestPoint. These include actions such as writing to disk, retrieving an A/D value, graphing of data series, storage of data to disk files, or computations. In order to activate them, the user drags the desired Icon into the OBJECT panel below the STOCK panel or directly into the user display panel, labeled Panel #1, which occupies the upper right portion of the screen. In the latter case, the Icon will also automatically appear in the OBJECT panel. The "run" button and the two graphs are placed in Panel #1 by dragging the corresponding icons from the OBJECT panel. After they are placed in the panel they can be positioned and sized as desired by appropriate action with the mouse.
In the lower right portion of the screen, partly covered by the display panel, is the "ACTION LIST" panel for the "run" button. This panel lists the actions which will occur when you click on the run button in Panel #1. The "action list" panel can brought to the foreground by clicking on any portion of it that is visible. If it is not visible at all, it can be activated by first toggling the MODE item in the main menu bar to MODE=EDIT. Then click on the run button in either the OBJECT panel or the Panel#1. Finally, in the main menu bar select "view" and then "action window."
The "run" button action list will appear as follows:
1)Set no of samples to 4096
2)Acquire A/D A/D1 #samples=no of sample, rate= 1000Hz, Chanel(s)= 0
3)Draw graph input with A/D1,
4)Store in time series from A/D1,
5)Calculate fft with samps= no of samples, wave= A/D1,
6)Calculate Math2 with input= fft
7)Draw graph Graph fft with Math2,
Each of these lines is created by dragging an Icon either from the OBJECT panel or directly from the STOCK panel. The underlined items are those which can be set by the programmer (you). The rest of the line can not be typed directly by the user but is entered automatically upon dragging the icons into the action list.
Set
The first line was created by dragging a MATH
icon (
) into the action list and selecting
"set" from the choices, "set" and "calculate",
after the mouse button is released. The name, "no of samples"
was created by us for this object by double clicking on it in
the OBJECT panel and typing in the name in the appropriate place.
You can do this to inspect what we have done without changing
it by selecting "Cancel" on any window in order to close
it. We are using this line so that the number of data points
need be entered in only one place in the program rather than in
each of the lines that uses it. The number, 4096, after the "to"
can be changed by you to any desired number. However, the Fast
Fourier Transform that we use below uses only data series of lengths
that are powers of 2 (128, 256, 512, etc.).
Acquire A/D
The second line was created by dragging the A/D icon into the action window and dropping it beneath the first line. The highlighted item after "#Samples = " was inserted by dragging the "no of samples" label from the first line into this position. In this way, the output from one action is made the input to another. The rate can be typed in by hand and you may change it as part of you experiment. The "Channel(s)" item has been typed in by hand as channel 0 but if you wish to connect your signal to a different channel you may change it.
Draw Graph
The third line was created by dragging a graphics icon to the next position in the action list. After line 3 was written to the action list, the name of the data to be plotted was provided by dragging it from the name of the output of the previous line, "A/D1".
Store In
This line was created by dragging a "container" icon (a picture of a box labeled, x, with lid partly open) to the next position in the action list. It was named "time series" by us by double clicking on its icon in the OBJECT panel and filling in the appropriate line. The source of the data was specified by dragging the name of the output of the "Acquire A/D" line, "A/D1", to this position.
Calculate
In this line we specified that the computation should be a fast Fourier transform (fft) of data sampled by the A/D. In this case, if you double click on the icon in the OBJECT panel, you will see that we typed in the name of a procedure by hand, "fft(samps,wave)." For this we needed to look in the TestPoint manual to determine what functions are available, how they should be called, what parameters are needed, and what form the output assumes. The output of the fft is in the form of three data series; frequency, amplitude and phase.
Calculate
The second "calculation" line selects only the amplitude of the Fourier transform.
Draw graph
Finally the amplitude of the fft is plotted in a second window.
For closer inspection of the graphs, click on the "inspect" button of the appropriate graph (this works only with MODE=Run). Then select zoom and use the scroll bars on the right side and along the bottom to move to the desired portion of the plot.
Any item in the action list can be deleted
by selecting it and then pressing the delete key on the keyboard.
This will not remove it from the OBJECT panel so that it may
be placed in any action list at a later time.
EXPERIMENTS WITH FOURIER TRANSFORMS
Adjust the amplitude of the sinewave (100 to 160 Hz) you have used in experiment #5 so that the signal to noise ratio is approximately 10/1. Then record the Fourier transform for each of the cases stated below. Write a brief, quantitative description of the transform and a brief explanation of it in terms of the Fourier transform theorems of chapter 12. Notice that the units of the frequency axis on the graph of the Fourier transform are not Hz. The smallest frequency and the smallest frequency increment that can be computed with a discrete Fourier transform is 1/record length. Since you have recorded 4096 points at a rate of 1000 /second, your total record length was 4.096 seconds and the frequency increments are 1/4.096 = 0.244 Hz. Thus, for example, the point at 1200 frequency units on your fft corresponds to 292.9 Hz.The highest frequency that can be processed without aliasing at this sampling rate is 500 Hz.
Decrease the no. of samples to 128 and compare to the transform of the 4096 point record. Compare the apparent width and shape of the spectral peak with that of the longer record.
Change the signal to a triangle function and then to a square wave. Notice, that new frequency components appear in the transform at subharmonics as well as harmonics. Are these frequencies really present in the time series? If not why do they appear in the transform?
Increase the frequency of the sine wave to about 3/4 of the sampling frequency so as to display aliasing.
Modulate the frequency and the amplitude of your original sine wave and inspect the fft. Connect the output of the signal generator to the VCF (voltage controlled frequency) input of the function generator. Set the frequency of the signal generator to about 20 Hz and monitor the output of the function generator on the scope so that you can see the frequency modulation. Vary the amplitude of the modulation as well as the frequency and examine the amplitude and spacing of the "side bands."
*Multiply a sine wave time series at your original
frequency by a Hamming window. The Hamming window is already
set up in the OBJECT panel as "hamming flt." Drag it
into the action list to a position between line "4)Store"
and line "5)Calculate fft". Drag the name "time
series" from line 4) into the "x= " position of
the Hamming flt line. Drag the name "hamming flt" into
the "wave= " position of the calculate fft line. Describe
and explain the difference between the fft of the windowed data
relative to the unwindowed data. Plot the data after it has passed
through the Hamming window.
* May not be implemented