phase plot fft (strange)values

2 次查看(过去 30 天)
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
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 中查找有关 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