On entry: the order of the fast Fourier transform (FFT) used to calculate the spectral estimates. kc should be a product of small primes such as where is the smallest integer such that , provided .
kc must be a multiple of l. The largest prime factor of kc must not exceed , and the total number of prime factors of kc, counting repetitions, must not exceed . These two restrictions are imposed by the internal FFT algorithm used.
On exit: the complex vector which contains the ng cross spectral estimates in elements to . The series leads the series.
The memory for this vector is allocated internally. If no memory is allocated to g (e.g., when an input error is detected) then g will be NULL on return. If repeated calls to this function are required then NAG_FREE should be used to free the memory in between calls.
12: – Integer *Output
On exit: the number of spectral estimates, , whose separate parts are held in g.
13: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
On entry, while . These arguments must satisfy kc% when .
On entry, while . These arguments must satisfy *nxy when .
On entry, while . These arguments must satisfy when .
The FFT is a numerically stable process, and any errors introduced during the computation will normally be insignificant compared with uncertainty in the data.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g13cdc is not threaded in any implementation.
g13cdc carries out an FFT of length kc to calculate the sample cross spectrum. The time taken by the function for this is approximately proportional to (but see function document c06pac for further details).
The example program reads 2 time series of length . It selects mean correction and a 10% tapering proportion. It selects a frequency width of smoothing window, a window shape argument of and an alignment shift of . It then calls g13cdc to calculate the smoothed sample cross spectrum and prints the results.