KPG1_DR2NAG

Converts an FFTPACK Hermitian Fourier transform array into the equivalent NAG array

Description:

This subroutine re-orders and normalises the supplied array of Fourier co-efficients (as produced by FFTPACK subroutine KPG1_DRFFTF) so that the returned array looks like the equivalent array returned by NAG routine C06FAF.

This function is equivalent to PDA_DR2NAG except that it uses work space for greater speed.

The real and imaginary co-efficients produced by KPG1_DRFFTF are numerically larger than the corresponding C06FAF co-efficients by a factor of SQRT( NP ), and are ordered differently. Both routines return A0 (the zeroth real term, i.e. the DC level in the array) in element 1. KPG1_DRFFTF then has corresponding real and imaginary terms in adjacent elements, whereas C06FAF has all the real terms together, followed by all the imaginary terms (in reverse order):

KPG1_DRFFTF: A0, A1, B1, A2, B2, A3, B3, ... C06FAF: A0, A1, A2, A3, ..., ..., B3, B2, B1

The zeroth imaginary term (B0) always has the value zero and so is not stored in the array. Care has to be taken about the parity of the array size. If it is even, then there is one more real term than there is imaginary terms (excluding A0), i.e. if NP = 10, then the co-efficients are stored as follows:

KPG1_DRFFTF: A0, A1, B1, A2, B2, A3, B3, A4, B4, A5 C06FAF: A0, A1, A2, A3, A4, A5, B4, B3, B2, B1

If NP = 9, then the co-efficients are stored as follows:

KPG1_DRFFTF: A0, A1, B1, A2, B2, A3, B3, A4, B4 C06FAF: A0, A1, A2, A3, A4, B4, B3, B2, B1

Invocation

CALL KPG1_DR2NAG( NP, R )

Arguments

NP = INTEGER (Given)
The size of the array.
R( NP ) = DOUBLE PRECISION (Given and Returned)
The array holding the Fourier co-efficients. Supplied in FFTPACK format and returned in NAG format.
WORK( NP ) = DOUBLE PRECISION (Given and Returned)
Work space.