MATLAB Answers

initial phase angle calculation

31 views (last 30 days)
mouh nyquist
mouh nyquist on 16 Jan 2015
Commented: mouh nyquist on 27 Jan 2015
I have this signal
clear all;clc;
tt=t(1:100000);%take 100 000 samples
a=30*pi/180; %phase (calculated form deg. to rad.)
b=90*pi/180; %phase (calculated form deg. to rad.)
fs=1/0.0001; %sampling frequency
X=fft(ia); %FFT
df=fs/length(X); %frequency resolution
f=(0:1:length(X)/2)*df; %frequency axis
M=abs(X)/length(ia)*2; %amplitude spectrum
P=angle(X)*180/pi; %phase spectrum (in deg.)
this technique do not give a good results; I want any technique to get the right "a" an "d" the initial phase angle of 10 HZ and 50 HZ;
I know it is a hard question but please help me

Accepted Answer

Jeremy on 23 Jan 2015
I ran your code it and seems to be working as-is. -30 and -90 deg at 10 and 50Hz

  1 Comment

mouh nyquist
mouh nyquist on 23 Jan 2015
what about if I dont know my signal I say that all frequency (10 HZ 20 HZ ..............78 Hz .......) have a initial phase angle .this is not correct

Sign in to comment.

More Answers (1)

Jeremy on 23 Jan 2015
You can't expect them to be zero degrees just because there is no signal defined there. With no content at those frequencies, the angle shown will a result of spectral leakage and numerical noise. Zero degrees is no more valid than any other angle and you should always be looking a the PSD or something else to see which frequencies have a significant response.


mouh nyquist
mouh nyquist on 23 Jan 2015
thank you a lot ; and there is another method to get the initial phase angle ?
Jeremy on 27 Jan 2015
This is the correct method, any other method will be a round about way of doing the same thing.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!