NAG Toolbox: nag_sum_fft_complex_3d_sep (c06fx)

Purpose

nag_sum_fft_complex_3d_sep (c06fx) computes the three-dimensional discrete Fourier transform of a trivariate sequence of complex data values. This function is designed to be particularly efficient on vector processors.

(Note the scale factor of 1/(sqrt(
n1n2n3
))1n1n2n3 in this definition.)

To compute the inverse discrete Fourier transform, defined with exp( + 2πi( … ))exp(+2πi(…)) in the above formula instead of exp( − 2πi( … ))exp(-2πi(…)), this function should be preceded and followed by forming the complex conjugates of the data values and the transform.

This function performs, for each dimension, multiple one-dimensional discrete Fourier transforms by the fast Fourier transform (FFT) algorithm (see Brigham (1974)). It is designed to be particularly efficient on vector processors.

The real and imaginary parts of the complex data values must be stored in arrays x and y respectively. If x and y are regarded as three-dimensional arrays of dimension (0 : n1 − 1,0 : n2 − 1,0 : n3 − 1)(0:n1-1,0:n2-1,0:n3-1), then x(j1,j2,j3)x(j1,j2,j3) and y(j1,j2,j3)y(j1,j2,j3) must contain the real and imaginary parts of zj1j2j3zj1j2j3.

The required trigonometric coefficients are assumed to have been calculated and stored in the arrays trign1, trign2 and trign3 in a prior call to nag_sum_fft_complex_3d_sep (c06fx). The function performs a simple check that the current values of n1n1, n2n2 and n3n3 are consistent with the corresponding values stored in trign1, trign2 and trign3.

If init = 'S'init='S' or 'R''R', trign1, trign2 and trign3 must contain the required coefficients calculated in a previous call of the function. Otherwise trign1, trign2 and trign3 need not be set. If n1 = n2n1=n2, the same array may be supplied for trign1 and trign2. Similar considerations apply if n2 = n3n2=n3 or n1 = n3n1=n3.

An unexpected error has occurred in an internal call. Check all function calls and array dimensions. Seek expert help.

Accuracy

Some indication of accuracy can be obtained by performing a subsequent inverse transform and comparing the results with the original sequence (in exact arithmetic they would be identical).

Further Comments

The time taken is approximately proportional to n1n2n3 × log(n1n2n3)n1n2n3×log(n1n2n3), but also depends on the factorization of the individual dimensions n1n1, n2n2 and n3n3. nag_sum_fft_complex_3d_sep (c06fx) is faster if the only prime factors are 22, 33 or 55; and fastest of all if they are powers of 22.