C-PLOT

Scientific Graphics and Data Analysis

D.3. - Fourier transforms



The command file fft uses the user function calc.4 to generate two different data sets. The user function fft.4 is invoked to generate the Fourier transform of each of those sets. Note that the 1,024 data points generated for each curve go far past the 128 points plotted. The wide range in real space gives high resolution to the frequency-space Fourier transform.

The first data set generates data that is the sum of three cosine curves of differing amplitudes and frequencies within a Gaussian envelope:
y = [2cos(2x) + cos(x/2) + 3cos(x)]e-(x/64)2  .
The Fourier transform of this data shows three broadened peaks at the appropriate frequencies with amplitudes in the correct ratios.

The second data set is simply
y  =  sin(x)      /      x      .
Its Fourier transform is a boxcar function.

The range-options command for the x axis, ro x, is used four times within the command file to set the user-defined tick spacing option. Six lines of input follow each time, representing values for the minimum and the maximum, a choice not to autorange the y axis, a choice of exact ranges, a choice of user-defined tick spacing and values for the number of major tick intervals and intermediate tick marks.