initial phase angle calculation

조회 수: 5 (최근 30일)
mouh nyquist
mouh nyquist 2015년 1월 16일
댓글: mouh nyquist 2015년 1월 27일
hello
I have this signal
clear all;clc;
t=0:0.0001:10;
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.)
ia=5*cos(2*pi*10*tt-a)+7*cos(2*pi*50*tt-b);
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
subplot(2,1,1);
M=abs(X)/length(ia)*2; %amplitude spectrum
plot(f,M(1:length(f)));
subplot(2,1,2);
P=angle(X)*180/pi; %phase spectrum (in deg.)
plot(f,P(1:length(f)));
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
  댓글 수: 2
mouh nyquist
mouh nyquist 2015년 1월 18일
plz
mouh nyquist
mouh nyquist 2015년 1월 19일
plz

댓글을 달려면 로그인하십시오.

채택된 답변

Jeremy
Jeremy 2015년 1월 23일
I ran your code it and seems to be working as-is. -30 and -90 deg at 10 and 50Hz
  댓글 수: 1
mouh nyquist
mouh nyquist 2015년 1월 23일
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

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Jeremy
Jeremy 2015년 1월 23일
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.
  댓글 수: 3
Jeremy
Jeremy 2015년 1월 27일
This is the correct method, any other method will be a round about way of doing the same thing.
mouh nyquist
mouh nyquist 2015년 1월 27일
thank you alot

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by