TThoye
TThoye

Reputation: 15

Phase shift estimation using cross wavelet

I'm in need of some help if you please. In the attached text file, I have 3 columns, Column 1 is the altitude from 20 to 110 km with an interval of 0.1km. The other two columns are signals. Please calculate the phase shift between the signals in columns 2 and 3 as a function of altitude, ranging from 0 to pi. Here is the data below: Any solution is welcome. data_link

Upvotes: -1

Views: 37

Answers (1)

John Bofarull Guix
John Bofarull Guix

Reputation: 820

1.- Get the data in MATLAB workspace

fileID=fopen('data_in.txt','r');

A=textscan(fileID,'%f %f %f')

h=A{:,1};    % altitude
y1=A{:,2};   % 2nd column
y2=A{:,3};   % 3rd column

2.- 2nd and 3rd columns

figure;
plot(h,y1)
grid on
title('row data')
xlabel('h');

hold on
plot(h,y2)
legend({'y1','y2'},'Location','northeastoutside')

enter image description here

3.- Or perhaps by phase the following should be understood

figure;
plot(h([1:end-1]),diff(y1))
grid on
title('dy1/dt   dy2/dt')
xlabel('h');

hold on
plot(h([1:end-1]),diff(y2))
legend({'y1^{\prime}','y2^{\prime}'},'Location','northeastoutside')

enter image description here

Perhaps y1 y2 are already in degree. Please let us know, thanks.

Upvotes: 0

Related Questions