PDA_R2NAG

Convert FFTPACK Hermitian Fourier transform array into equivalent NAG array

Description:

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

The real and imaginary coefficients produced by PDA_RFFTF are numerically larger than the corresponding C06FAF coefficients 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. PDA_RFFTF 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):
 
PDA_RFFTF : 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 coefficients are stored as follows:
 
PDA_RFFTF : 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 coefficients are stored as follows:
 
PDA_RFFTF : A0, A1, B1, A2, B2, A3, B3, A4, B4
C06FAF: A0, A1, A2, A3, A4, B4, B3, B2, B1

Invocation

CALL PDA_R2NAG( NP, R )

Arguments

NP = INTEGER (Given)
The size of the array.
R( NP ) = REAL (Given and Returned)
The array holding the Fourier coefficients. Supplied in FFTPACK format and returned in NAG format.

Implementation Status:

A double precision version PDA_DR2NAG of the routine exists.