C-PLOT

Scientific Graphics and Data Analysis

D.3.1. - fft



#  @(#)fft	4.2  03 May 1993 CSS
#  Certified Scientific Software's C-PLOT

# Erase, turn on quiet mode, reset filter,
# ...  keep in graphics mode.
zeq9999w

re
# Choose symbol
sy L
# Don't draw y-axis number or tick marks
ty 0 528 0

# Set Title
tx t Real Space

# Calculate some "real space" data that consists
# of three sinusoids broadened by a Gaussian.
fn calc.4 n=1024; x=i/4; \
 y=(2*cos(x*2)+cos(x/2)+3*cos(x))*exp(-x*x/(64*64))
# Set x-axis range and user-defined tick numbering
ro x
0
128
n
y
y
4 0
# Autorange y-axis
np y
# Set first window
wi 3 11 8 6
# Draw plot
zapt
# Set Title
tx t Fourier Transform
# Now do FFT
f2 fft.4 n=1024
# Set x-axis range and user-defined tick numbering
ro x
0
3
n
y
y
3 0
# Autorange y-axis
np y
# Set second window
wi 14 11 8 6
# Draw plot
zapt

# Calculate another set of "real space" data
fn . n=1024; x=i+.00001; y = sin(x)/(x)
ro x
0
128
n
y
y
4 0
np y
wi 3 3 8 6
zap
# Now do FFT
f2 . n=1024
ro x
0
3
n
y
y
3 0
np y
wi 14 3 8 6
zap
# Synchronized close
zs

Here are the real-space plots and their Fourier transforms.