These subroutines compute the two-dimensional discrete Fourier transform of
complex conjugate even data in a two-dimensional array.
X | Y, scale | Subroutine |
Short-precision complex | Short-precision real | SCRFT2 |
Long-precision complex | Long-precision real | DCRFT2 |
Fortran | CALL SCRFT2 (init, x, inc2x, y,
inc2y, n1, n2, isign, scale,
aux1, naux1, aux2, naux2, aux3,
naux3)
CALL DCRFT2 (init, x, inc2x, y, inc2y, n1, n2, isign, scale, aux1, naux1, aux2, naux2) |
C and C++ | scrft2 (init, x, inc2x, y,
inc2y, n1, n2, isign, scale,
aux1, naux1, aux2, naux2, aux3,
naux3);
dcrft2 (init, x, inc2x, y, inc2y, n1, n2, isign, scale, aux1, naux1, aux2, naux2); |
PL/I | CALL SCRFT2 (init, x, inc2x, y,
inc2y, n1, n2, isign, scale,
aux1, naux1, aux2, naux2, aux3,
naux3);
CALL DCRFT2 (init, x, inc2x, y, inc2y, n1, n2, isign, scale, aux1, naux1, aux2, naux2); |
If init <> 0, trigonometric functions and other parameters, depending on arguments other than x, are computed and saved in aux1. The contents of x and y are not used or changed.
If init = 0, the discrete Fourier transform of the given array is computed. The only arguments that may change after initialization are x, y, and aux2. All scalar arguments must be the same as when the subroutine was called for initialization with init <> 0.
Specified as: a fullword integer. It can have any value.
Specified as: an inc2x by (at least) n2 array, containing numbers of the data type indicated in Table 138. This array must be aligned on a doubleword boundary.
If isign = positive value, Isign = + (transforming time to frequency).
If isign = negative value, Isign = - (transforming frequency to time).
Specified as: a fullword integer; isign > 0 or isign < 0.
If init <> 0, the working storage is computed.
If init = 0, the working storage is used in the computation of the Fourier transforms.
Specified as: an area of storage, containing naux1 long-precision real numbers.
If naux2 = 0 and error 2015 is unrecoverable, aux2 is ignored.
Otherwise, it is the working storage used by this subroutine, which is available for use by the calling program between calls to this subroutine.
Specified as: an area of storage, containing naux2 long-precision real numbers. On output, the contents are overwritten.
If naux2 = 0 and error 2015 is unrecoverable, SCRFT2 and DCRFT2 dynamically allocate the work area used by the subroutine. The work area is deallocated before control is returned to the calling program.
Otherwise, naux2 >= (minimum value required for successful processing). To determine a sufficient value, use the processor-independent formulas. For all other values specified less than the minimum value, you have the option of having the minimum value returned in this argument. For details, see Using Auxiliary Storage in ESSL.
Specified as: an area of storage, containing naux3 long-precision real numbers.
Specified as: a fullword integer.
If init <> 0, this argument is not used, and its contents remain unchanged.
If init = 0, this is the array Y, containing n1 rows and n2 columns of results of the real discrete Fourier transform of X. The data in each column of Y is stored with stride 1.
Returned as: an inc2y by (at least) n2 array, containing numbers of the data type indicated in Table 138. See Notes for more details.
If init <> 0, it contains information ready to be passed in a subsequent invocation of this subroutine.
If init = 0, its contents are unchanged.
Returned as: the contents are not relevant.
The required values of naux1 and naux2 depend on n1 and n2.
The required values of naux1 and naux2 depend on n1 and n2.
The two-dimensional discrete Fourier transform of complex conjugate even data in array X, with results going into array Y, is expressed as follows:
for:
where:
and where:
Because of the complex conjugate symmetry, the output in array Y is real. For scale = 1.0 and isign being positive, you obtain the discrete Fourier transform, a function of frequency. The inverse Fourier transform is obtained with scale = 1.0/((n1)(n2)) and isign being negative. See references [1], [4], and [20].
Two invocations of this subroutine are necessary:
Error 2015 is unrecoverable, naux2 = 0, and unable to allocate work area.
None
This example shows how to compute a two-dimensional transform. The arrays are declared as follows:
REAL*4 Y(0:13,0:7) COMPLEX*8 X(0:6,0:7) REAL*8 AUX1(1000), AUX2(1000), AUX3(1)
First, initialize AUX1 using the calling sequence shown below with INIT <> 0. Then use the same calling sequence with INIT = 0 to do the calculation.
INIT X INC2X Y INC2Y N1 N2 ISIGN SCALE AUX1 NAUX1 AUX2 NAUX2 AUX3 NAUX3 | | | | | | | | | | | | | | | CALL SCRFT2(INIT, X , 7 , Y , 14 , 12 , 8 , -1 , SCALE , AUX1 , 1000 , AUX2 , 1000 , AUX3 , 0 )
* * | 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | Y = | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | . . . . . . . . | | . . . . . . . . | * *
This example shows another transform computation with different data using the same initialized array AUX1 in Example 1.
INIT X INC2X Y INC2Y N1 N2 ISIGN SCALE AUX1 NAUX1 AUX2 NAUX2 AUX3 NAUX3 | | | | | | | | | | | | | | | CALL SCRFT2( 0 , X , 7 , Y , 14 , 12 , 8 , -1 , SCALE , AUX1 , 1000 , AUX2 , 1000 , AUX3 , 0 )
SCALE = 1.0/96.0
X is an array with 7 rows and 8 columns having (96.0, 0.0) in location X(0,0) and (0.0, 0.0) in all others.
* * | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | Y = | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 | | . . . . . . . . | | . . . . . . . . | * *
This example shows the same array being used for input and output. The arrays are declared as follows:
REAL*8 Y(0:17,0:7) COMPLEX*16 X(0:8,0:7) REAL*8 AUX1(1000), AUX2(1000), AUX3(1)
Arrays X and Y are made equivalent by the following statement, making them occupy the same storage.
EQUIVALENCE (X,Y)
This requires inc2y = 2(inc2x). First, initialize AUX1 using the calling sequence shown below with INIT <> 0. Then use the same calling sequence with INIT = 0 to do the calculation.
INIT X INC2X Y INC2Y N1 N2 ISIGN SCALE AUX1 NAUX1 AUX2 NAUX2 AUX3 NAUX3 | | | | | | | | | | | | | | | CALL DCRFT2(INIT, X , 9 , Y , 18 , 16 , 8 , 1 , SCALE , AUX1 , 1000 , AUX2 , 1000 , AUX3 , 0 )
X is an array with 9 rows and 8 columns having (1.0, 1.0) in location X(4,2) and (0.0, 0.0) in all others.
* * | 2.0 2.0 -2.0 -2.0 2.0 2.0 -2.0 -2.0 | | 2.0 -2.0 -2.0 2.0 2.0 -2.0 -2.0 2.0 | | -2.0 -2.0 2.0 2.0 -2.0 -2.0 2.0 2.0 | | -2.0 2.0 2.0 -2.0 -2.0 2.0 2.0 -2.0 | | 2.0 2.0 -2.0 -2.0 2.0 2.0 -2.0 -2.0 | | 2.0 -2.0 -2.0 2.0 2.0 -2.0 -2.0 2.0 | | -2.0 -2.0 2.0 2.0 -2.0 -2.0 2.0 2.0 | | -2.0 2.0 2.0 -2.0 -2.0 2.0 2.0 -2.0 | Y = | 2.0 2.0 -2.0 -2.0 2.0 2.0 -2.0 -2.0 | | 2.0 -2.0 -2.0 2.0 2.0 -2.0 -2.0 2.0 | | -2.0 -2.0 2.0 2.0 -2.0 -2.0 2.0 2.0 | | -2.0 2.0 2.0 -2.0 -2.0 2.0 2.0 -2.0 | | 2.0 2.0 -2.0 -2.0 2.0 2.0 -2.0 -2.0 | | 2.0 -2.0 -2.0 2.0 2.0 -2.0 -2.0 2.0 | | -2.0 -2.0 2.0 2.0 -2.0 -2.0 2.0 2.0 | | -2.0 2.0 2.0 -2.0 -2.0 2.0 2.0 -2.0 | | . . . . . . . . | | . . . . . . . . | * *