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

fft_complex_1d calculates the discrete Fourier transform of a sequence of complex data values (using complex data type).

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

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’.

xcomplex, array-like, shape

If is declared with bounds in the function from which fft_complex_1d is called, must contain , for .

xcomplex, ndarray, shape

The components of the discrete Fourier transform. If is declared with bounds in the function from which fft_complex_1d is called, is contained in , for .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: or .

(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.


Given a sequence of complex data values , for , fft_complex_1d calculates their (forward or backward) discrete Fourier transform (DFT) defined by

(Note the scale factor of in this definition.) The minus sign is taken in the argument of the exponential within the summation when the forward transform is required, and the plus sign is taken when the backward transform is required.

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

fft_complex_1d 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). If is a large prime number or if contains large prime factors, then the Fourier transform is performed using Bluestein’s algorithm (see Bluestein (1968)), which expresses the DFT as a convolution that in turn can be efficiently computed using FFTs of highly composite sizes.


Bluestein, L I, 1968, A linear filtering approach to the computation of the discrete Fourier transform, Northeast Electronics Research and Engineering Meeting Record 10, 218–219

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