Hello,
I have a problem with my fft analysis, it seems to work for the amplitudes, the spectrum ist the same as in the test function, but the phase ist different. If i change the frequency of the test function it works better, but there's still a difference. Later I want to use the file to analyze a signal from simulink.
Here my test fft:
yout.time=linspace(0,1.6384,16384);
yout.signals.values = sin(2*pi*36*yout.time) + 3*sin(2*pi*18*yout.time+(pi/2))+5;
Fs = 10000; % Sampling frequency
T = 1/Fs; % Sample time
L = length(yout.time);% Length of signal
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
fsignal=yout.signals.values-mean(yout.signals.values);
ha=hann(L);
fsignal=2*fsignal(:).*ha;
Y = fft(fsignal,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
phase = angle(Y);
If I use the unwrap command it destroys the values completely, I get values about 20 which should be about +-pi.
Thanks in advance,
Regards

1 comentario

Wayne King
Wayne King el 15 de Feb. de 2012
Pleae format your code for readability.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 14 de Feb. de 2012

Editada:

el 12 de Oct. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by