FFT Display

Version 1.0   14 May 2015

Summary

The FFT Display Widget provides a graphical display of the (Fast) Fourier Transform of time dependent expressions.

Instructions

When the FFT Display Widget is started it appears like this:

The Widget has a number of example formulae/expressions which can be accessed by using the Waveform popup menu.

The initial display is of the frequency modulated sine wave example from the Waveform popup menu. The formula for this is:
sin(2*pi*100*t + 2.41*cos(2*pi*2*t)).
This represents a carrier of frequency 100Hz with modulation of 2Hz. Variable t represents time.

The Fourier Transform of the formula is computed over a full cycle of 1024 samples. The upper display shows the modulus of the 512 points in the transformed data and the (lower) report window shows some data about the output.

Nyquist Criterion

For correct results, it is important to note that the highest frequency in the spectrum multiplied by the scale factor must be less than 512 times the multiplier. In the above case, the highest frequency in the spectrum is at about 112Hz (with a multiplier of 1.0) from which it follows that scale factors greater than 4.5 will produce incorrect results.

The Scale Factor popup menu can be used to change the scale of the display - the scale can be set to a number of values between 0.1 and 10 (but note the limitation expressed in the preceding paragraph). The Calculate button can be used to repeat the calculation of the currently selected example from the Waveform popup menu.

Command Line Operations

The function used for each FFT calculation is copied to the command line. This can be used to repeat the last calculation, or execute a modified version of it.

The command Line also provides access to some features of the JavaScript Engine.
JavaScript expressions entered into the command Line are evaluated when the RETURN or ENTER key is pressed. This can be used to evaluate simple arithmetic expressions or to access some internal features of the Widget.
In particular, it gives access to the FFT program by using the command:
makeFFT(formula, multiplier, scale, units, title);

The multiplier, scale, units and title parameters may be omitted (or set to undefined), in which case the widget uses the values defined in the popup menus.

For example:

makeFFT("sin(2*pi*100*t)*(1 - cos(2*pi*5*t))", 1, 1.0, "Hz", "amplitude modulated sine wave");
will reproduce the example discussed above.

Units

The unit used on the scale of the graph and in the report window can also be set - this has no effect on the calculation. The unit displayed is automatically set when using the standard examples.

License

FFT Display is Copyright © 2010,2015 by Harry Whitfield.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Widget Concept, Coding and Documentation

This program and associated documentation are Copyright 2010,2015 Harry Whitfield.
mailto:g6auc@arrl.net

Harry Whitfield (G6AUC)