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 nag_fft_real (c06eac) and nag_fft_hermitian (c06ebc) to compute discrete Fourier transforms, and there are some restrictions on the value of .
4 References
Brigham E O (1974) The Fast Fourier Transform Prentice–Hall
5 Arguments
1:
operation – Nag_VectorOpInput
On entry: the computation to be performed.
.
.
Constraint:
or .
2:
n – IntegerInput
On entry: , the number of values, in one period of the vectors x and y.
Constraint:
. The largest prime factor of n must not exceed 19, and the total number of prime factors of n, counting repetitions, must not exceed 20.
On entry: the elements of one period of the vector . must contain , for .
On exit: the discrete Fourier transform of the convolution or correlation returned in the array x; the transform is stored in Hermitian form, exactly as described in the document nag_fft_real (c06eac).
5:
fail – NagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).
6 Error Indicators and Warnings
NE_BAD_PARAM
On entry, argument operation had an illegal value.
NE_C06_FACTOR_GT
At least one of the prime factors of n is greater than 19.
The results should be accurate to within a small multiple of the machine precision.
8 Further Comments
The time taken is approximately proportional to , but also depends on the factorization of . nag_convolution_real (c06ekc) is somewhat faster than average if the only prime factors of are , or ; and fastest of all if is a power of .
On the other hand, nag_convolution_real (c06ekc) is particularly slow if has several unpaired prime factors, i.e., if the ‘square-free’ part of has several factors.
9 Example
This example reads in the elements of one period of two real vectors and and prints their discrete convolution and correlation (as computed by nag_convolution_real (c06ekc)). In realistic computations the number of data values would be much larger.