naginterfaces.library.sum.convcorr_​real

naginterfaces.library.sum.convcorr_real(job, x, y)[source]

convcorr_real calculates the circular convolution or correlation of two real vectors of period (using a work array for extra speed).

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

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/c06/c06fkf.html

Parameters
jobint

The computation to be performed.

(convolution);

(correlation).

xfloat, array-like, shape

The elements of one period of the vector . If is declared with bounds in the function from which convcorr_real is called, must contain , for .

yfloat, array-like, shape

The elements of one period of the vector . If is declared with bounds in the function from which convcorr_real is called, must contain , for .

Returns
xfloat, ndarray, shape

The corresponding elements of the discrete convolution or correlation.

yfloat, ndarray, shape

The discrete Fourier transform of the convolution or correlation returned in the array ; the transform is stored in Hermitian form; if the components of the transform are written as , then for , is contained in , and for , is contained in . (See also the C06 Introduction.)

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: or .

Notes

convcorr_real computes:

if , the discrete convolution of and , defined by

if , the discrete correlation of and defined by

Here and are real vectors, assumed to be periodic, with period , i.e., ; and are then also periodic with period .

Note: this usage of the terms ‘convolution’ and ‘correlation’ is taken from Brigham (1974). The term ‘convolution’ is sometimes used to denote both these computations.

If , , and are the discrete Fourier transforms of these sequences, i.e.,

then and (the bar denoting complex conjugate).

This function calls the same auxiliary functions as fft_realherm_1d() to compute discrete Fourier transforms.

References

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