# naginterfaces.library.sum.fft_​real_​qtrcosine_​simple¶

naginterfaces.library.sum.fft_real_qtrcosine_simple(direct, m, n, x)[source]

fft_real_qtrcosine_simple computes the discrete quarter-wave Fourier cosine transforms of sequences of real data values.

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

https://www.nag.com/numeric/nl/nagdoc_27.3/flhtml/c06/c06rdf.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’.

mint

, the number of sequences to be transformed.

nint

, the number of real values in each sequence.

xfloat, array-like, shape

The data must be stored in as if in a two-dimensional array of dimension ; each of the sequences is stored in a row of the array. In other words, if the data values of the th sequence to be transformed are denoted by , for , for , the first elements of the array must contain the values

The th and th elements of each row , for , are required as workspace. These elements may contain arbitrary values as they are set to zero by the function.

Returns
xfloat, ndarray, shape

The quarter-wave cosine transforms stored as if in a two-dimensional array of dimension . Each of the transforms is stored in a row of the array, overwriting the corresponding original sequence. If the components of the th quarter-wave cosine transform are denoted by , for , for , the elements of the array contain the values

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(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

No equivalent traditional C interface for this routine exists in the NAG Library.

Given sequences of real data values , for , for , fft_real_qtrcosine_simple simultaneously calculates the quarter-wave Fourier cosine transforms of all the sequences defined by

or its inverse

where and .

(Note the scale factor in this definition.)

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

The transform calculated by this function can be used to solve Poisson’s equation when the derivative of the solution is specified at the left boundary, and the solution is specified at the right boundary (see Swarztrauber (1977)).

The function uses a variant of the fast Fourier transform (FFT) algorithm (see Brigham (1974)) known as the Stockham self-sorting algorithm, described in Temperton (1983), together with pre - and post-processing stages described in Swarztrauber (1982). Special coding is provided for the factors , , and .

References

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

Swarztrauber, P N, 1977, The methods of cyclic reduction, Fourier analysis and the FACR algorithm for the discrete solution of Poisson’s equation on a rectangle, SIAM Rev. (19(3)), 490–501

Swarztrauber, P N, 1982, Vectorizing the FFT’s, Parallel Computation, (ed G Rodrique), 51–83, Academic Press

Temperton, C, 1983, Fast mixed-radix real Fourier transforms, J. Comput. Phys. (52), 340–350