Geoscience Reference
In-Depth Information
which produces the output
ans =
-1.2566
h e phase spectrum is normalized to one full period ˄=2ˀ and the phase
shit of -1.2566 therefore equals (-1.2566.5)/(2.ˀ)=-1.0000, which is the
phase shit of one that we introduced initially.
We now use two sine waves with dif erent periodicities to illustrate cross-
spectral analysis. Both signals, x and y , have a periodicity of 5 but a phase
shit of 1.
clear
t = 1 : 1000;
x = sin(2*pi*t/15) + 0.5*sin(2*pi*t/5);
y = 2*sin(2*pi*t/50) + 0.5*sin(2*pi*t/5+2*pi/5);
plot(t,x,'b-',t,y,'r-')
axis([0 100 -3 3]), grid
We can now compute the cross-spectrum Pxy , which clearly shows the
common period of ˄=5 (or frequency of f =0.2).
[Pxy,f] = cpsd(x,y,[],0,1024,1);
plot(f, abs(Pxy)), grid
xlabel('Frequency')
ylabel('Power')
title('Cross-Spectrum')
h e coherence shows a high value that is close to one at f =0.2.
[Cxy,f] = mscohere(x,y,[],0,1024,1);
plot(f,Cxy), grid
xlabel('Frequency')
ylabel('Coherence')
title('Coherence')
h e complex part of the cross-spectrum Pxy is required for calculating the
phase shit between the two sine waves.
[Pxy,f] = cpsd(x,y,[],0,1024,1);
phase = angle(Pxy);
plot(f,phase), grid
h e phase shit at a frequency of f =0.2 (period ˄=5) is
interp1(f,phase,0.2)
Search WWH ::




Custom Search