g13cd calculates the smoothed sample cross spectrum of a bivariate time series using spectral smoothing by the trapezium frequency (Daniell) window.
- Type: System..::..Int32On entry: , the length of the time series and .Constraint: .
- Type: System..::..Int32On entry: whether the data is to be initially mean or trend corrected.
- For no correction.
- For mean correction.
- For trend correction.
- Type: System..::..DoubleOn entry: the proportion of the data (totalled over both ends) to be initially tapered by the split cosine bell taper.A value of implies no tapering.Constraint: .
- Type: System..::..Int32On entry: , the frequency width of the smoothing window as .A value of implies that no smoothing is to be carried out.Constraint: .
- Type: System..::..Int32On entry: , the alignment shift between the and series. If leads , the shift is positive.Constraint: .
- Type: System..::..DoubleOn entry: , the shape parameter of the trapezium frequency window.A value of gives a triangular window, and a value of a rectangular window.If (i.e., no smoothing is carried out) then pw is not used.Constraint: if , .
- Type: System..::..Int32On entry: , the frequency division of smoothed cross spectral estimates as .
- Type: System..::..Int32On 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 .
- Type: array<System..::..Double>()An array of size [kc]On entry: the nxy data points of the series.On exit: the real parts of the ng cross spectral estimates in elements to , and to contain . The series leads the series.
- Type: array<System..::..Double>()An array of size [kc]On entry: the nxy data points of the series.On exit: the imaginary parts of the ng cross spectral estimates in elements to , and to contain . The series leads the series.
- Type: System..::..Int32%
The supplied time series may be mean and trend corrected and tapered as in the description of g13cb before calculation of the unsmoothed sample cross-spectrum
for frequency values , .
A correction is made for bias due to any tapering.
As in the description of g13cb for univariate frequency window smoothing, the smoothed spectrum is returned as a subset of these frequencies,
where [ ] denotes the integer part.
Its real part or co-spectrum , and imaginary part or quadrature spectrum are defined by
where the weights are similar to the weights defined for g13cb, but allow for an implicit alignment shift between the series:
It is recommended that is chosen as the lag at which the cross-covariances peak, so as to minimize bias.
If no smoothing is required, the integer , which determines the frequency window width , should be set to .
The bandwidth of the estimates will normally have been calculated in a previous call of g13cb for estimating the univariate spectra of and .
Bloomfield P (1976) Fourier Analysis of Time Series: An Introduction Wiley
Jenkins G M and Watts D G (1968) Spectral Analysis and its Applications Holden–Day
Errors or warnings detected by the method:
On entry, , or , or , or , or , or , or , or and , or and , or , or . On entry, , or kc is not a multiple of l, or kc has a prime factor exceeding , or kc has more than prime factors, counting repetitions.
- This indicates that a serious error has occurred. Check all array subscripts in calls to g13cd. Seek expert help.
The FFT is a numerically stable process, and any errors introduced during the computation will normally be insignificant compared with uncertainty in the data.
This example reads two time series of length . It selects mean correction and a 10% tapering proportion. It selects a frequency width of smoothing window, a window shape parameter of and an alignment shift of . It then calls g13cd to calculate the smoothed sample cross spectrum and prints the results.