naginterfaces.library.sum.fft_complex_multid(direct, nd, x)[source]

fft_complex_multid computes the multidimensional discrete Fourier transform of a multivariate sequence of complex data values.

For full information please refer to the NAG Library document for c06pj

directstr, length 1

If the forward transform as defined in Notes is to be computed, must be set equal to ‘F’.

If the backward transform is to be computed, must be set equal to ‘B’.

ndint, array-like, shape

The elements of must contain the dimensions of the variables; that is, must contain the dimension of the th variable.

xcomplex, array-like, shape

The complex data values. Data values are stored in using column-major ordering for storing multidimensional arrays; that is, is stored in .

xcomplex, ndarray, shape

The corresponding elements of the computed transform.

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: or .

(errno )

On entry, .

Constraint: , for all .

(errno )

On entry, , product of elements is .

Constraint: must equal the product of the dimensions held in array .

(errno )

An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.


fft_complex_multid computes the multidimensional discrete Fourier transform of a multidimensional sequence of complex data values , where , and so on. Thus the individual dimensions are , and the total number of data values is .

The discrete Fourier transform is here defined (e.g., for ) by:

where and . The plus or minus sign in the argument of the exponential terms in the above definition determine the direction of the transform: a minus sign defines the forward direction and a plus sign defines the backward direction.

The extension to higher dimensions is obvious. (Note the scale factor of in this definition.)

A call of fft_complex_multid with followed by a call with will restore the original data.

The data values must be supplied in a one-dimensional array using column-major storage ordering of multidimensional data (i.e., with the first subscript varying most rapidly).

This function uses a variant of the fast Fourier transform (FFT) algorithm (see Brigham (1974)) known as the Stockham self-sorting algorithm, which is described in Temperton (1983).


Brigham, E O, 1974, The Fast Fourier Transform, Prentice–Hall

Temperton, C, 1983, Self-sorting mixed-radix fast Fourier transforms, J. Comput. Phys. (52), 1–23