How to determine instantaneous phase using complex wavelets ?

8 views (last 30 days)
I am trying to obtain the phase difference between two non-stationary signals. I have tried using both Hilbert transform and Complex Wavelet Transform. Sample codes for 2 signals x & y and corresponding output are given below:
% Using Hilbert Transform
t = linspace(0,1,2048);
x = sin(16*pi*t);
y = sin(16*pi*t+pi/6);
xh = hilbert(x);
yh = hilbert(y);
xphase = (unwrap(angle(xh)))';
yphase = (unwrap(angle(yh)))';
plot(t,rad2deg(xphase-yphase))
%Using Complex Guassian Wavelet
t = linspace(0,10,2048);
x = sin(16*pi*t);
y = sin(16*pi*t+pi/3);
xc=cwt(x,1:140,'cgau5');
yc=cwt(y,1:140,'cgau5');
lev=30;
xp=rad2deg(unwrap(angle(xc(lev,:))));
yp=rad2deg(unwrap(angle(yc(lev,:))));
figure(1)
plot(t,(xp-yp));
The phase difference using Hilbert transform is correct while Complex WT gives unusual results. How can phase between x and y be sinusoidal? I wonder if there is any mistake in the code?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!