Professional Documents
Culture Documents
Cross Spectra FFT
Cross Spectra FFT
In normal spectral analysis the spectrum shows how energy is distributed in frequency (or
wavenumber) space. This can be obtained either by taking the fourier transform of the
lagged autocorrelation. The lagged autocorrelation is infact the convolution of a time
series with itslef.
The autospectrum can be written as
FFT(u*u)
(1)
(2)
Thus the power spectra can be obtained in two waysthe Blackmun Turkey approach (1)
or the periodgram method (2).
The cross specturm is very similarexpect that instead of the using the auto-correlation
taken from a single time series. You would take cross correlation of two different time
series.
so (1) and (2) become
FFT(u*v)
and
FFT(u*u)= fft(u)*fft(v)
The Cross-correlation of two complex functions f,g is simply the convolution of those
records.
This can be conceptually understood by recalling the convolution is simply the sum of the
product of the two recordswith one record shifting down the time axis.
Recall then that the fourier Transfrom of g*h was G(f) H(f)
Therefore one could calculate the cross-correlation by taking the inverse fft of product of
the fft of G and H.
Likewise the fft of the autocorrelation of x (x*x) is equal to |X(f)|2.
n N K 1
1
t y n e i 2fn dt
( N K )t
n0
1
2
Y( f )
( N K )t
Gyy(0)=Sff(0)
Gyy(1,n-1)=2*Sff(1,n-2)
Gyy(n)=Sff(n)
One is the calculation of energy from the fft. We need to divide by T and multiply
Each spectral constituent by 2 except the first and the last.
Cross-Covariance Function
C 12 ( )
1
N m
N m
( n t ) x 2 ( n t )
m t
Cross-correlation Function
12 ( )
C 12 ( )
[C 11 (0)C 22 (0)]1 / 2
Wind_eta_Correlation.m
matlab script
After rotation you could find the lag that produces the maximum correlation between the
wind and sealevel records.
(U , W , )
1 N m
U (nt )W (nt )
N m 1
1
N
1
1 U * U N
N
lag_corr.m
1/ 2
W * W
matlab script
The first analysisfinding the wind direction that yields the best correlation could also
be done with a lagged correlation. This might yield slightly difference
To extend this into the frequency domainto characterize the cross-correlation as a
function of frequency we estimate the cross-spectra
Time series may be better correlated in some frequencies than in others.
Following Blackman the Tukey we could take the spectra of the cross-correlation
function to yield the cross spectra
Or we could take FFT of each record obtain Y1(f), Y2(f) and the cross spectra is
simply Cs=Y1* Y2
Note that since this is not the autospectra that Cs will be complex. This is important
because it give us phase information on the two seriesWho leads Who!
For example current velocity and temperature fluctuations can drive a net heat fluxif
they are in phase. This is often referred to as an eddy heat flux. The cross-spectrum of
temperature and velocity would give a frequency dependent measure of the eddy heat
flux.
q' C p u' ( t )T ' ( t )
Coherent fluctuations that are in phase produce heat flux. IF they are in quadriture (90
degrees out of phase) there is no heat flux in that frequency band.
Show example of how advection due to oscillatory tidal motion will yield no- heat flux
sin t cos tt 0
But
sin t sin tt 0
Cross Spectra
Ensure that the time series span the same time/space period with identical
resolution.
Remove the means the trends from both records
Determine how much block averaging you will need to do for statistical
reliability.
Window the data
Compute FFT of data
Adjust scale factor of spectra according to windowing
Compute raw one-sided cross spectral density
G12 ( f )
2
X *1 ( f ) X 2 ( f )
Nt
Since the cross-spectrum is the transform pair of the covariance function the
inverse Fourier transform of the cross-spectrum will recover the crosscovariance function. This is a more computationally efficient way to calculate the
cross-covariance due to the robust computational efficiency of the fft.
i.e.
inv(G12)= cross-covaraines
in matlab
two time series x1 & x2.
F=fft(x1)
G=fft(x2);
CC=ifft(conj(F) G)
Two ways to quantify the real and imaginary parts of the cross-spectrum.
S 12 ( f )
A1 A2 i1
e sin c( f f o )T e i1 sin c( f f o )T e i 21 sin c( f f o )T e i 2 sin c( f f o )T
4T
S 12 ( f )
A1 A2 i ( )
e
( f f o ) e i ( ) ( f f o )
2T
A1A 2 i{1(f ) 2 (f )}
e
T
or
S12 (f )
A12
T
i12 (f )
So A12 is frequency dependent amplitude of the cross spectrum and theta is the
frequency depended phase of the cross spectra. The phase only has meaning when the
amplitude is significantly different than zero.
Here we can Show MATLAB examples of cross-spectrum for
1) Single frequency with phase
2) Multiple Frequency
3) Sea-level and Wind at the Battery.
It can also be decomposed into a co-spectrum (in phase fluctuations) and quadspectrum (fluctuations that occur in quadrature). This is also related to the Rotary
spectra that can decompose the cross-spectra of a vector time series into clockwise and
counterclockwise rotating components.
Ellipse analysis, (tidal ellipse)
U=Acost+Bsint
V=Ccost+Dsint
(1)
Since we are dealing with vector that oscillates at a single frequency this can be
represented in terms of a clockwise rotating vector and a counter clockwise rotating
vector.
i.e.
R=R+eit+ R-e-it
Where R+ and R- are the radii of the clockwise and counter-clockwise rotating
constituents.
Recall
eit=cost+isint
so
R= R+( cost+isint) + R-( cost-isint)
R=( R++ R-) cost +i( R+- R-) sint
(2)
A D i (C B )
2
A D i (C B )
2
( A D)2 C B 2
1/ 2
( A D) 2 C B 2
1/ 2
Since these are rotating at the same frequency but in opposite directions there will be
times when they are additive (pointing in the same direction) and times when they are
pointing in opposite direction and tend to cancel each other out.
These two times define the Major Axis is ( R++ R- ) and the minor axis (R+- R-)
of an ellipse.
Back to the heat flux example if fluctuations occur in phase (large co-spectrum
amplitude) then there will be a large eddy heat flux.
In contrast if the co-spectrum is small but the quad-spectrum is large there will be little
eddy heat flux at that frequency.
10
This of course could be induced by the amplitude and phase spectrumsbut often this is
a convienent way to plot it.
Here the cross Spectrum, which has a real and complex part
S 12 ( f ) C 12 ( f ) iQ12 ( f )
where
C 12 ( f ) A12 ( f ) cos 12 ( f )
Q12 ( f ) A12 ( f ) sin 12 ( f )
11
12 2 (f )
| S12 (f ) | 2
S11 (f )S 22 (f )
12 2 (f )
| C 2 (f ) Q 2 (f ) |
S11 (f )S 22 (f )
0 | 212 | 1
and
12 (f ) | 12 2 (f ) |1 / 2 e i12 (f )
Confidence Intervals
1 2 1 1 /( EDOF 1)
EDOF is the independent cross-spectral realizations in each frequency band. Thomson
and Emery suggest that it is equal to the number of frequency bands that you average.
1 2 (f ) 1 1 /( EDOF 1)
12
2
95
0.95
A limit that is more likely to be exceeded to be found in a noisy geophysical data set!
13