C06FBF is the NAG routine for finding the FFT of a one-dimensional Hermitian sequence such as created by C06FAF. The routine performs a forward transform, but it is usually used to perform an inverse transform by preceeding it with a call to C06GBF to form the complex conjugates of the input (frequency domain) data.
The following steps are involved in replacing C06FBF calls with equivalent FFTPACK calls:
Compared to the Hermitian sequences created by NAG, those created by FFTPACK are stored in a different order and are normalised differently. You can either modify your application to use the FFTPACK format throughout, or call the PDA_DNAG2R routine to convert the supplied NAG format data into the equivalent FFTPACK format data:
DOUBLE PRECISION X(N)
CALL PDA_DNAG2R( N, X )
where X is the supplied NAG-style data. On return, X holds the FFTPACK-style data, ready for use by PDA_DRFFTB. If this call is made, the values returned by PDA_DRFFTB will have the same normalisation as the original data supplied to PDA_DRFFTF.
The work array passed to the FFT routine needs to be increased in size from N elements (for NAG) to 2*N+15 (for FFTPACK).
Replace the two calls:
DOUBLE PRECISION X(N), WORK(N)
CALL C06GBF( X, N, IFAIL )
CALL C06FBF( X, N, WORK, IFAIL )
where X is in NAG format, with
DOUBLE PRECISION X(N), WORK(2*N+15)
CALL PDA_DRFFTB( N, X, WORK )
where X is in FFTPACK format.
The work array supplied to PDA_DRFFTB needs initialising before calling PDA_DRFFTB. This is done by calling PDA_DRFFTI:
DOUBLE PRECISION WORK(2*N+15)
CALL PDA_DRFFTI( N, WORK )
There is no need to re-initialise WORK if the value of N has not changed since the previous call to PDA_DRFFTI (and if the contents of the work array have not been altered).
PDA [1ex