Admin Production ni-theme
Current Publication

ReFFT

LabWindows/CVI

ReFFT

Advanced Analysis Library Only

AnalysisLibErrType ReFFT (double arrayXReal[], double arrayXImaginary[], ssize_t numberOfElements);

Purpose

Note Note  This function has been superseded by FFTEx. FFTEx includes additional parameters, which makes it more versatile than ReFFT.

Calculates the fast Fourier transform (FFT) of a real input array.

ReFFT performs the operation in place and overwrites the input array. Performing an FFT on a real array yields a complex result. The imaginary component array must be at least as large as the real component array.

The following example illustrates the form of the output arrays, with numberOfElements being the output signal length.

If numberOfElements is even, arrayXReal and arrayXImg have the following form:

[ DC component, f[1], f[2], f[3], f[4].....f[nyquist-1], f[nyquist],-f[nyquist-1] ...-f[4], -f[3], -f[2], -f[1] ]

If numberOfElements is odd, arrayXReal and arrayXImg have the following form:

[ DC component, f[1], f[2], f[3], f[4].....f[(n-1)/2], -f[(n-1)/2] ...-f[4], -f[3], -f[2], -f[1] ]

Example Code

/* Generate an array with random numbers and calculate the fast Fourier transform. */
double x[256], y[256];
n;
n = 256;
Uniform (n, x);
ReFFT (x, y, n);

Parameters

Input
Name Type Description
numberOfElements ssize_t Number of elements in the input arrays.
Output
Name Type Description
arrayX_Real double [] On input, the real part of the array used to compute the FFT. arrayXReal must satisfy arrayXReal[i] = arrayXReal[numberOfElementsi], i = 1, 2, …, numberOfElements–1.

On output, the real part of the FFT.

This operation is performed in place, meaning the values in this array are overwritten.
arrayX_Imaginary double [] On input, the values are ignored.

On output, the imaginary part of the FFT.

This operation is performed in place, meaning the values in this array are overwritten.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 3.1 and later

Examples

Refer to the following examples that use the ReFFT function:

  • analysis\2dfft.cws

    Open example
  • analysis\convolve.cws

    Open example
  • analysis\iirfiltr.cws

    Open example
  • OpenMP\2dfft_omp.cws

    Open example