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

Wayne King
Wayne King 2012년 2월 15일
Pleae format your code for readability.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

질문:

2012년 2월 14일

편집:

2013년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by