Geoscience Reference
In-Depth Information
a
b
Fig. 5.8
Cross-spectrum of two sine waves with identical periodicities of ˄=5 (equivalent to
f
=0.2) and amplitudes of 2. h e sine waves show a relative phase shit of
t
=1. In the argument
of the second sine wave this corresponds to 2ˀ/5, which is one i t h of the full wavelength of
˄=5.
a
h e magnitude shows the expected peak at
f
=0.2.
b
h e corresponding phase dif erence
in radians at this frequency is 1.2566, which equals (1.2566.5)/(2.ˀ) = 1.0000, which is the
phase shit of 1 that we introduced initially.
coherence of the two signals is one for all frequencies, since we are working
with noise-free data.
[Cxy,f] = mscohere(x,y,[],0,1024,1);
plot(f,Cxy), grid
xlabel('Frequency')
ylabel('Coherence')
title('Coherence')
We use the function
mscohere(x,y,window,noverlap,nfft,fs)
which specii es
the number of FFT points
nfft
=1024, the default rectangular window
(
window
=
[]
), and no overlapping data points (
noverlap
=0). h e complex part
of
Pxy
is required for computing the phase shit between the two signals
using the function
angle
.
phase = angle(Pxy);
plot(f,phase), grid
xlabel('Frequency')
ylabel('Phase Angle')
title('Phase Spectrum')
h e phase shit at a frequency of
f
=0.2 (period ˄=5) can be interpolated from
the phase spectrum
interp1(f,phase,0.2)