CXML
sfft_apply, dfft_apply, cfft_apply, zfft_apply
Application step for fast
fourier transform in one dimension
FORMAT
Real transform: status = {S,D}FFT_APPLY
(input_format, output_format, direction, in, out, fft_struct, stride)
Complex transform in complex data format: status = {C,Z}FFT_APPLY
(input_format, output_format, direction, in, out, fft_struct, stride)
Complex transform in real data format: status = {C,Z}FFT_APPLY
(input_format, output_format, direction, in_real, in_imag, out_real,
out_imag,
fft_struct, stride)
Arguments
input_format, output_format
character*(*)
Identifies the data type of the input and the format to
be used to store the data, regardless of the data type.
For example, a complex sequence can be stored in real
format.
The character 'R' specifies the format as real; the
character 'C' specifies the format as complex. As
convenient, use either upper- or lowercase characters,
and either spell out or abbreviate the word.
The following table shows the valid values:
Subprogram Input Format Output Format Direction
{S,D} 'R' 'C' 'F'
'C' 'R' 'B'
'R' 'R' 'F' or 'B'
{C,Z} 'R' 'R' 'F' or 'B'
'C' 'C' 'F' or 'B'
For complex transforms, the type of data determines what other
arguments are needed. When both the input and output data are real,
the complex functions store the data as separate arrays for imaginary
and real data so additional arguments are needed. See the CXML
Reference Manual's chapter on "Using the Signal Processing
Subprograms" for an explanation of real and complex data format.
direction character*(*)
Specifies the operation as either the forward or
inverse transform. Use 'F' or 'f' to specify the
forward transform. Use 'B' or 'b' to specify the
inverse transform.
in, out real*4 | real*8 | complex*8 | complex*16
Both the arguments are one-dimensional arrays. The
input and output arrays can be the same array. The IN
array contains the data to be transformed. The OUT
array contains the transformed data. The size of the
output array is determined by the value of n provided
to the _INIT function.
Subprogram Input Format Output Format Minimum Size
{S,D} 'R' 'C' n+2 (n must be even)
'C' 'R' n+2 (n must be even)
'R' 'R' n (n must be even)
{C,Z} 'R' 'R' n
'C' 'C' n
in_real, out_real, in_imag, out_imag
real*4 | real*8
Use these arguments to perform a complex transform on
real data format and storing the result in a real data
format.
fft_struct record /dxml_s_fft_structure/ for single-precision real
operations
record /dxml_d_fft_structure/ for double-precision real
operations
record /dxml_c_fft_structure/ for single-precision
complex operations
record /dxml_z_fft_structure/ for double-precision
complex operations
The argument refers to the structure created by the
_INIT routine.
stride integer*4
Specifies the distance between consecutive elements in
the input and output arrays, depending on the value of
stride_1_flag provided in the _INIT function.
Description
The _FFT_APPLY routines perform the fast Fourier transform of one-
dimensional data, in either the forward or backward direction. These
routines are the second step of a three-step procedure. The _FFT_APPLY
routine computes the fast forward or inverse Fourier transform, using the
internal data structures created by the _FFT_INIT subroutine.
Use the _APPLY routines with their corresponding _INIT and _EXIT routines.
For example, use SFFT_APPLY after the SFFT_INIT and end with the SFFT_EXIT
routine.
The SFFT_APPLY and DFFT_APPLY functions perform the Fourier transform of a
real sequence (forward) or a complex sequence (inverse) into real sequence.
The CFFT_APPLY and ZFFT_APPLY functions perform Fourier transforms of a
complex sequence into a complex sequence, storing the output in either real
or complex data format. However, the argument list depends on the data
format of the output. See the CXML Reference Guide for an explanation of
real and complex data format.
Return Values
0 DXML_SUCCESS()
12 DXML_INS_RES()
13 DXML_BAD_STRIDE()
15 DXML_BAD_DIRECTION_STRING()
16 DXML_BAD_FORMAT_STRING()
18 (real transform only)
DXML_BAD_FORMAT_FOR_DIRECTION()
Examples
INCLUDE 'CXMLDEF.FOR'
INTEGER*4 N, STATUS
REAL*8 A(1026), B(1026)
RECORD /CXML_D_FFT_STRUCTURE/ FFT_STRUCT
N = 1024
STATUS = DFFT_INIT(N,FFT_STRUCT,.TRUE.)
STATUS = DFFT_APPLY('R','C','F',A,B,FFT_STRUCT,1)
STATUS = DFFT_EXIT(FFT_STRUCT)
This FORTRAN code computes the forward, real FFT of a vector, a, with
length of 1024. The result of the transform is stored in b in complex form.
Note that the length of b is 1026 to hold 513 complex values.
INCLUDE 'CXMLDEF.FOR'
INTEGER*4 N, STATUS
COMPLEX*8 A(1024), B(1024)
RECORD /CXML_C_FFT_STRUCTURE/ FFT_STRUCT
N = 1024
STATUS = CFFT_INIT(N,FFT_STRUCT,.TRUE.)
STATUS = CFFT_APPLY('C','C','F',A,B,FFT_STRUCT,1)
STATUS = CFFT_EXIT(FFT_STRUCT)
This FORTRAN code computes the forward, complex FFT of a vector a, with
length of 1024. The result of the transform is stored in b in complex form.
CXML Home Page Index of CXML Routines