FFT in MATLAB: wrong 0Hz frequency

Posted by roujhan on Stack Overflow See other posts from Stack Overflow or by roujhan
Published on 2010-05-28T15:02:05Z Indexed on 2010/05/28 17:32 UTC
Read the original article Hit count: 187

Filed under:
|

Hello

I want to use fft in MATLAB to analize some exprimental data saved as an excell file. my code:

A=xlsread('Book.xls'); G=A'; x=G(2, : );
N=length(x);
F=[-N/2:N/2-1]/N;
X = abs(fft(x-mean(x),N))
X = fftshift(X);
plot(F,X)

But it plots a graph with a large 0Hz wrong component, my true frequency is about 395Hz and it is not shown in the plotted graph. Please tell me what is wrong.

Any help would be appreciated.

© Stack Overflow or respective owner

Related posts about matlab

Related posts about fft