How to extract the constant phase of a sine wave?
11 ビュー (過去 30 日間)
古いコメントを表示
Hello, I would extract the phase of a simple signal, for example a sine wave:
phase = pi/2;
x = sin(omega*t + phase);
I tried with
P = angle(x)
but in this case, if I plot (t,P) I obtain a variable phase. I want the exact phase equal to pi/2, so a constant curve. Do you know how to do it?
0 件のコメント
回答 (2 件)
Honglei Chen
2017 年 11 月 7 日
Do you know omega? If so, you can do something like this
fc = 10;
omega = 2*pi;
t = (0:9)/10;
p = pi/2;
x = sin(omega*t+p);
xc = hilbert(x);
xcref = hilbert(sin(omega*t));
P = mean(angle(xc.*conj(xcref)))
Here I'm using analytic signal to simplify the math a bit. you can also do it in real domain but then you need a low pass filter to remove the unwanted frequency after mixing.
HTH
0 件のコメント
David Sziroczak
2017 年 11 月 9 日
If it's such a simple function you are after, wouldn't it be possible just to simply extract value of the function at t=0 or pi or similar, and get the angle from asin?
Other idea, you could do a complex FFT and work it out from that?
Hope this helps,
David
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Transforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!