g13cdf
g13cdf
© Numerical Algorithms Group, 2002.
Purpose
G13CDF Multivariate time series, smoothed sample cross spectrum using
spectral smoothing by the trapezium frequency (Daniell) window
Synopsis
[xg,yg,ng,ifail] = g13cdf(nxy,is,l,xg,yg<,pxy,mw,mtxy,pw,ifail>)
Description
The supplied time series may be mean and trend corrected and
tapered as in the description of G13CBF before calculation of the
unsmoothed sample cross-spectrum
{ n } { n }
* 1 { -- } { -- }
f ((omega))= ------{ > y exp(i(omega)t)}*{ > x exp(-i(omega)t)}
xy 2(pi)n{ -- t } { -- t }
{ t=1 } { t=1 }
2(pi)j
for frequency values (omega) = ------, 0<=(omega) <=(pi).
j K j
A correction is made for bias due to any tapering.
As in the description of G13CBF for univariate frequency window
smoothing, the smoothed spectrum is returned at a subset of these
frequencies,
2(pi)l
(nu) = ------ , l=0,1,...,[L/2]
l L
where [ ] denotes the integer part.
Its real part or co-spectrum cf((nu) ), and imaginary part or
l
quadrature spectrum qf((nu) ) are defined by
l
f ((nu) )=cf((nu) )+iqf((nu) )
xy l l l
-- ~ *
= > w f ((nu) +(omega) )
-- k xy l k
(pi)
|(omega) |< ----
k M
~
where the weights w are similar to the weights w defined for
k k
G13CBF, but allow for an implicit alignment shift S between the
series:
~
w =w exp(-2(pi)iSk/L).
k k
It is recommended that S is chosen as the lag k at which the
cross covariances c (k) peak, so as to minimize bias.
xy
If no smoothing is required, the integer M which determines the
2(pi)
frequency window width -----, should be set to n.
M
The bandwidth of the estimates will normally have been calculated
in a previous call of G13CBF for estimating the univariate
spectra of y and x .
t t
Parameters
g13cdf
Required Input Arguments:
nxy integer
is integer
l integer
xg (:) real
yg (:) real
Optional Input Arguments: <Default>
pxy real 0.0
mw integer nxy
mtxy integer 0
pw real 0
ifail integer -1
Output Arguments:
xg (:) real
yg (:) real
ng integer
ifail integer