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