CXML
sfft_apply_2d, dfft_apply_2d, cfft_apply_2d, zfft_apply_2d
Application
step for fast fourier transform in two dimensions
FORMAT
Real transform: status = {S,D}FFT_APPLY_2D
(input_format, output_format, direction, in, out, lda, fft_struct,
ni_stride, nj_stride)
Complex transform in complex data format: status = {C,Z}FFT_APPLY_2D
(input_format, output_format, direction, in, out, lda, fft_struct,
ni_stride, nj_stride)
Complex transform in real data format: status = {C,Z}FFT_APPLY_2D
(input_format, output_format, direction, in_real, in_imag, out_real,
out_imag,
lda, fft_struct, ni_stride, nj_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 data, the type of data determines what other arguments are
needed. When both the input and output data are real, the complex
routines store the data as separate arrays for imaginary and real data
so additional arguments are needed.
direction character*(*)
Specifies the operation as either the forward or
inverse transform. Use 'F' or 'f' to specify the
forward transform. Use 'B' of 'b' to specify the
inverse transform.
in, out real*4 | real*8 | complex*8 | complex*16
Both the arguments are two-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.
in_real, out_real, in_imag, out_imag
real*4 | real*8
Use these arguments when performing a complex transform
on real data format and storing the result in a real
data format.
lda integer*4
Specifies the number of rows in the IN and OUT arrays;
lda >= ni. For {S,D} routines, lda >= ni+2 when the
input format is 'R' and the output format is 'C' or the
input format is 'C' and the output format is 'R'.
fft_struct record /dxml_s_fft_structure_2d/ for single-precision
real operations
record /dxml_d_fft_structure_2d/ for double-precision
real operations
record /dxml_c_fft_structure_2d/ for single-precision
complex operations
record /dxml_z_fft_structure_2d/ for double-precision
complex operations
The argument refers to the structure created by the
_2D_INIT routine.
ni_stride, nj_stride
integer*4
Specifies the distance between consecutive elements in
a column and row in the IN and OUT arrays; the valid
stride depends on the _INIT routine; ni_stride >= 1,
nj_stride >= 1.
Description
The _FFT_APPLY_2D routines compute the fast Fourier transform of two-
dimensional data in either the forward or backward direction. These
routines are the second step of the three-step procedure. They compute the
fast forward or inverse Fourier transform, using the internal data
structures created by the _FFT_2D_INIT subroutine.
Use the _APPLY_2D routines with their corresponding _INIT_2D and _EXIT_2D
routines. For example, use SFFT_APPLY after the SFFT_INIT and end with the
SFFT_EXIT routine. See the CXML Reference Manual's chapter on "Using the
Signal Processing Subprograms" for an explanation of real and complex data
format.
Return Values
0 DXML_SUCCESS()
11 DXML_ILL_LDA()
12 DXML_INS_RES()
13 DXML_BAD_STRIDE()
15 DXML_BAD_DIRECTION_STRING()
16 DXML_BAD_FORMAT_STRING()
18 (for real transform only)
DXML_BAD_FORMAT_FOR_DIRECTION()
Examples
INCLUDE 'CXMLDEF.FOR'
INTEGER*4 N_I, N_J, STATUS, LDA
REAL*8 A(1026,512), B(1026,513)
RECORD /CXML_D_FFT_STRUCTURE_2D/ FFT_STRUCT
N_I = 1024
N_J = 512
LDA = 1024
STATUS = DFFT_INIT_2D(N_I,N_J,FFT_STRUCT,.TRUE.)
STATUS = DFFT_APPLY_2D('R','C','F',A,B,LDA,FFT_STRUCT,1,1)
STATUS = DFFT_EXIT_2D(FFT_STRUCT)
This FORTRAN code computes the forward, two-dimensional, real FFT of a
1024x512 matrix A. The result of the transform is stored in B in complex
form. Note that the leading dimension of B is 1026 in order to hold the
extra complex values (see section on data storage). Note also that the
input matrix A also requires a leading dimension of at least 1026.
INCLUDE 'CXMLDEF.FOR'
INTEGER*4 N_I, N_J, STATUS, LDA
COMPLEX*16 A(1024,512), B(1024,512)
RECORD /CXML_Z_FFT_STRUCTURE_2D/ FFT_STRUCT
N_I = 1024
N_J = 512
LDA = 1024
STATUS = ZFFT_INIT_2D(N_I,N_J,FFT_STRUCT,.TRUE.)
STATUS = ZFFT_APPLY_2D('C','C','F',A,B,LDA,FFT_STRUCT,1,1)
STATUS = ZFFT_EXIT_2D(FFT_STRUCT)
This FORTRAN code computes the forward, two-dimensional, complex FFT of a
matrix A, of dimension 1024 by 512. The result of the transform is stored
in B in complex form.
CXML Home Page Index of CXML Routines