phase plot fft (strange)values
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
KE BR
el 9 de Ag. de 2020
Respondida: Sulaymon Eshkabilov
el 9 de Ag. de 2020
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
0 comentarios
Respuesta aceptada
Sulaymon Eshkabilov
el 9 de Ag. de 2020
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!