These subroutines compute a set of m complex discrete
n-point Fourier transforms of real data.
X, scale | Y | Subroutine |
Short-precision real | Short-precision complex | SRCFT |
Long-precision real | Long-precision complex | DRCFT |
Fortran | CALL SRCFT (init, x, inc2x, y,
inc2y, n, m, isign, scale,
aux1, naux1, aux2, naux2, aux3,
naux3)
CALL DRCFT (init, x, inc2x, y, inc2y, n, m, isign, scale, aux1, naux1, aux2, naux2) |
C and C++ | srcft (init, x, inc2x, y,
inc2y, n, m, isign, scale,
aux1, naux1, aux2, naux2, aux3,
naux3);
drcft (init, x, inc2x, y, inc2y, n, m, isign, scale, aux1, naux1, aux2, naux2); |
PL/I | CALL SRCFT (init, x, inc2x, y,
inc2y, n, m, isign, scale,
aux1, naux1, aux2, naux2, aux3,
naux3);
CALL DRCFT (init, x, inc2x, y, inc2y, n, m, 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 transforms of the given sequences are 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.
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, SRCFT and DRCFT 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 array Y, consisting of the results of the m complex discrete Fourier transforms, each of length n. The sequences are stored with the stride 1. Due to complex conjugate symmetry, only the first (n/2) + 1 elements of each sequence are given in the output--that is, yki, k = 0, 1, ..., n/2, i = 1, 2, ..., m.
Returned as: an array of (at least) length n/2+1+(m-1)inc2y, containing numbers of the data type indicated in Table 132. This array must be aligned on a doubleword boundary. (It can be declared as Y(inc2y,m).)
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.
If you specify the same array for X and Y, then inc2x must equal 2(inc2y). In this case, output overwrites input. If m = 1, the inc2x and inc2y values are not used by the subroutine. If you specify different arrays for X and Y, they must have no common elements; otherwise, results are unpredictable. See Concepts.
The set of m complex conjugate even discrete n-point Fourier transforms of real data in array X, with results going into array Y, is expressed as follows:
for:
where:
and where:
The output in array Y is complex. 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/n and isign being negative. See references [1], [4], [19], 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 an input array X with a set of m cosine sequences cos(2pijk/n), j = 0, 1, ..., 15 with the single frequencies k = 0, 1, 2, 3. The Fourier transform of the cosine sequence with frequency k = 0 or n/2 has 1.0 in the 0 or n/2 position, respectively, and zeros elsewhere. For all other k, the Fourier transform has 0.5 in the k position and zeros elsewhere. The arrays are declared as follows:
REAL*4 X(0:65535) COMPLEX*8 Y(0:32768) REAL*8 AUX1(41928), AUX2(35344), 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 N M ISIGN SCALE AUX1 NAUX1 AUX2 NAUX2 AUX3 NAUX3 | | | | | | | | | | | | | | | CALL SRCFT(INIT, X , 16 , Y , 9 , 16 , 4 , 1 , SCALE, AUX1 , 41928 , AUX2 , 35344 , AUX3 , 0 )
X contains the following four sequences:
1.0000 1.0000 1.0000 1.0000 1.0000 0.9239 0.7071 0.3827 1.0000 0.7071 0.0000 -0.7071 1.0000 0.3827 -0.7071 -0.9239 1.0000 0.0000 -1.0000 0.0000 1.0000 -0.3827 -0.7071 0.9239 1.0000 -0.7071 0.0000 0.7071 1.0000 -0.9239 0.7071 -0.3827 1.0000 -1.0000 1.0000 -1.0000 1.0000 -0.9239 0.7071 -0.3827 1.0000 -0.7071 0.0000 0.7071 1.0000 -0.3827 -0.7071 0.9239 1.0000 0.0000 -1.0000 0.0000 1.0000 0.3827 -0.7071 -0.9239 1.0000 0.7071 0.0000 -0.7071 1.0000 0.9239 0.7071 0.3827
Y contains the following four sequences:
(1.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.5000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.5000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.5000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000)
This example shows another transform computation with different data using the same initialized array AUX1 as in Example 1. The input is also a set of four cosine sequences cos(2pijk/n), j = 0, 1, ..., 15 with the single frequencies k = 8, 9, 10, 11, thus including the middle frequency k = 8. The middle frequency has the value 1.0. For other frequencies, the transform has zeros, except for frequencies k and n-k. Only the values for j = n-k are given in the output.
INIT X INC2X Y INC2Y N M ISIGN SCALE AUX1 NAUX1 AUX2 NAUX2 AUX3 NAUX3 | | | | | | | | | | | | | | CALL SRCFT( 0 , X , 16 , Y , 9 , 16 , 4 , 1 , SCALE, AUX1 , 41928 , AUX2 , 35344 , AUX3 , 0 )
SCALE = 1.0/16
X contains the following four sequences:
1.0000 1.0000 1.0000 1.0000 -1.0000 -0.9239 -0.7071 -0.3827 1.0000 0.7071 0.0000 -0.7071 -1.0000 -0.3827 0.7071 0.9239 1.0000 0.0000 -1.0000 0.0000 -1.0000 0.3827 0.7071 -0.9239 1.0000 -0.7071 0.0000 0.7071 -1.0000 0.9239 -0.7071 0.3827 1.0000 -1.0000 1.0000 -1.0000 -1.0000 0.9239 -0.7071 0.3827 1.0000 -0.7071 0.0000 0.7071 -1.0000 0.3827 0.7071 -0.9239 1.0000 0.0000 -1.0000 0.0000 -1.0000 -0.3827 0.7071 0.9239 1.0000 0.7071 0.0000 -0.7071 -1.0000 -0.9239 -0.7071 -0.3827
Y contains the following four sequences:
(0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.5000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.5000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.5000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (1.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000) (0.0000, 0.0000)
This example uses the mixed-radix capability. The arrays are declared as follows:
REAL*8 X(0:11) COMPLEX*16 Y(0:6) REAL*8 AUX1(50),AUX2(50)
Arrays X and Y are made equivalent by the following statement, making them occupy the same storage:
EQUIVALENCE (X,Y)
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 N M ISIGN SCALE AUX1 NAUX1 AUX2 NAUX2 | | | | | | | | | | | | | CALL DRCFT(INIT, X , 0 , Y , 0 , 12 , 1 , 1 , SCALE , AUX1 , 50 , AUX2 , 50)
Y contains the following sequence:
(12.0000 , 0.0000) (0.0000 , 0.0000) (0.0000 , 0.0000) (0.0000 , 0.0000) (0.0000 , 0.0000) (0.0000 , 0.0000) (0.0000 , 0.0000)