phase plot fft (strange)values

1 回表示 (過去 30 日間)
KE BR
KE BR 2020 年 8 月 9 日
回答済み: Sulaymon Eshkabilov 2020 年 8 月 9 日
i Have the following code;
Fs = 500;
t = 0:1/Fs:10-1/Fs;
s = cos(2*pi*15*t - 30) + cos(2*pi*40*t +60);
NFFT=length(s);
ft =(1/NFFT)*fft(s);
freq = Fs*(0:(NFFT/2))/NFFT;
Am=abs(ft);
tol = 1e-6;
ft(abs(ft) < tol) = 0;
Ph = angle(ft);
Am = Am*2;
Am = Am';
Am = Am(1:end/2,:);
freq = freq';
freq = freq(1:end-1,:);
Ph=Ph';
Ph = Ph(1:end/2,:);
plot(freq,Ph*(180/pi));
How do i interpretend the phase of this signal? shouldnt the phase plot give me -30° at 15Hz and 60° at 40Hz? How does it come that the fft gives 81.13° and -162.3°?
Kind regards

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020 年 8 月 9 日
Hi,
There was a small but crucial mistake while defining 's' signal. Here is the corrected one:
s = cos(2*pi*15*t -30*pi/180) + cos(2*pi*40*t+60*pi/180);
Good luck.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by