필터 지우기
필터 지우기

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 CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by