Retrieve phase from a time-varying cosine signal

19 ビュー (過去 30 日間)
Jingtao
Jingtao 2023 年 5 月 27 日
コメント済み: Jingtao 2023 年 5 月 28 日
I got two experimental time-domain signals (sampling length of N=13001, sampling frequency of Fs=4000 Hz). By curve fitting, I found one (red) is a cosine signal with a single frequency, so the phase shift is linear with respect to time. However, the other (blue) is a time-varying cosine singal whose phase shift is nonliear with respect to time. How can I get the phase difference between the red signal and the blue one? Please find attached "data.txt".

採用された回答

Hiro Yoshino
Hiro Yoshino 2023 年 5 月 27 日
I would suggest that you should try hilbert transform as follows:
load("data.txt")
plot(data(:,1))
hold on
plot(data(:,2));
hold off;
Hilbert transform and phase analysis
y1 = hilbert(data(:,1));
y2 = hilbert(data(:,2));
phase1 = atan2(imag(y1),real(y1));
phase2 = atan2(imag(y2),real(y2));
plot(unwrap(phase1)); % unwrap phases
hold on;
plot(unwrap(phase2));
hold off;
plot(unwrap(phase1) - unwrap(phase2));
title("Phase difference");
  1 件のコメント
Jingtao
Jingtao 2023 年 5 月 28 日
Hi Hiro, Thanks a lot. Nice!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHilbert and Walsh-Hadamard Transforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by