fft phase accuracy

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

回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息

产品

提问:

2012-2-14

Community Treasure Hunt

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

Start Hunting!

Translated by