naginterfaces.library.sum.fft_​realherm_​1d

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

fft_realherm_1d calculates the discrete Fourier transform of a sequence of real data values or of a Hermitian sequence of complex data values stored in compact form in a float array.

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

https://www.nag.com/numeric/nl/nagdoc_27.3/flhtml/c06/c06paf.html

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

xfloat, array-like, shape

If is declared with bounds in the function from which fft_realherm_1d is called:

if , must contain , for ;

if , and must contain the real and imaginary parts respectively of , for . (Note that for the sequence to be Hermitian, the imaginary part of , and of for even, must be zero.)

Returns
xfloat, ndarray, shape

If and is declared with bounds , and will contain the real and imaginary parts respectively of , for ;

if and is declared with bounds , will contain , for .

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

Notes

Given a sequence of real data values , for , fft_realherm_1d calculates their discrete Fourier transform (in the forward direction) defined by

The transformed values are complex, but they form a Hermitian sequence (i.e., is the complex conjugate of ), so they are completely determined by real numbers (since is real, as is for even).

Alternatively, given a Hermitian sequence of complex data values , this function calculates their inverse (backward) discrete Fourier transform defined by

The transformed values are real.

(Note the scale factor of in the above definitions.)

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

fft_realherm_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).

The same functionality is available using the forward and backward transform function pair: fft_real_2d() and fft_hermitian_2d() on setting . This pair use a different storage solution; real data is stored in a float array, while Hermitian data (the first unconjugated half) is stored in a complex array.

References

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