# wn_data_fft_c

status.i4.v = wn_data_fft_c(return_type.i4.v, out_real.r4p.r,
out_imaginary.r4p.r, num_fft.i4.r
[out_amp.r4p.r])
This routine computes the Fast Fourier Transformation (FFT) for the
the saved data set for the active graphic window. The calling
program is responsible for freeing the out_real, out_imaginary, and
out_amp buffers. (Note: The returned data arrays have the zero
frequency component in the first entry. This is followed by the
smallest nonzero positive frequency component. Positive frequencies
increasing in magnitude are stored in the following locations up
to entry num_fft/2. After this are stored the negative frequencies
with the most negative frequency component in the last entry.)
return_type returned data type requested
(WN_FFT -> return discrete Fourier transform,
WN_FFT_NORMALIZED -> return normalized discrete
Fourier transform,
WN_INVERSE_FFT -> return (exponent power of 2)
times the inverse discrete
Fourier transform)
out_real returned array of real FFT coefficients
out_imaginary returned array of imaginary FFT coefficients
num_fft returned length of FFT arrays
out_amp returned array of FFT amplitude values
This function returns ACNET status values as follows:
OK success
CBS_INVARG invalid isign value
CBS_NOSETUP an active window has not been established
or no data is saved
CBS_MEMFAIL failed in allocating dynamic memory
CBS_NODAT no valid data points for this request
This function requires the following include files:
cbslib_h, acnet_errors_h
Related functions:
wn_data_save(_c), wn_data_set_cut_c, wn_data_mean, wn_data_extrema,
wn_data_recall, wn_data_query, wn_data_polyfit_c, intro_graphics_windows
C/C++ usage:
int status;
int return_type = WN_FFT;
int num_fft;
float *out_real;
float *out_imaginary;
float *out_amp;
status = wn_data_fft_c(return_type,&out_real,&out_imaginary,
&num_fft,&out_amp);