fft of given data
이전 댓글 표시
I got data from a lab, and the FFT I get have a peak in zero Hz. But it is not right, it should have a peak at 50 Hz (european frecuncy). I just don't know what else to try, I'm without new ideas of way to continuo. Please give me an adavise!
The data is xlsx below.
Summering:
% same as in http://www.mathworks.es/es/help/matlab/ref/fft.html but with Fs=150, thus 150/2=75 so close to my 50 Hz, and y and t are vectors given.
y=v;
Fs = 150; % Sampling frequency
% T = 1/Fs; % Sample time
L = length(t); % Length of signal
% t = (0:L-1)*T; % Time vector
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
plot(f,2*abs(Y(1:NFFT/2+1)))
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')
답변 (1개)
Wayne King
2013년 11월 16일
편집: Wayne King
2013년 11월 16일
That indicates that the data has a non-zero mean. First, subtract the mean
y = detrend(y,0);
or simply
y = y-mean(y);
Then execute your commands above.
댓글 수: 2
Wayne King
2013년 11월 17일
which column in the excel file is the data you are trying to Fourier transform? what is the title of the column
카테고리
도움말 센터 및 File Exchange에서 Get Started with Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!