MATLAB: How to use excel data in matlab for fast fourier transform

fftvibration

Hi everybody
i have attached a excel file. In this file, the first column is my magnitute in micron. I have got 71 magnitude values and all recorded in 0.5 seconds.I would like to use FFT, to change from time domain into frequency domain.
Sampling frequency is 142.
Can anyone help me out how to do that?
Kind regards.

Best Answer

[V,H]=xlsread('Vibration_analysis_FFT.xlsx'); % read data
H % headers -- ok, says lateral, axial in first two column
T=mean(diff(V(:,3))) % sample rate.. 0.005 --> 5 ms
Fs=1/T; % sampling frequency, 200 Hz
L=length(V); % length of sample
t=(0:L-1)*T; % time vector -- not really needed
Y=fft(V(:,1:2)); % FFt the two accelerations
P2=abs(Y/L); % 2-sided PSD estimator
P1=P2(1:fix(L/2)+1,:); % 1-sided
P1(2:end-1)=2*P1(2:end-1); % (-)freq half the energy but only only one DC;Fmax bin
f=Fs*(0:fix(L/2))/L; % the frequency at 200 Hz for L points
figure
plot(f,P1)
Shows have mostly just a DC component (non-zero mean) whch, parenthetically, means the sensor must be moving somewhere...let's compensate for the mean and see if helps...don't think will a lot because there's still mostly just a 1/f rolloff, no real spectral content in the signal...untitled.jpg
Y=fft(V(:,1:2)-mean(V(:,1:2))); % remove mean before FFT
P2=abs(Y/L);
P1=P2(1:fix(L/2)+1,:);
figure
plot(f,P1)
untitled.jpg
As thought, just wipes the one commponent out, but leaves most other low frequency stuff. Try just a little more resolution by interpolationg since is very short signal...
N=128;
Y=fft(V(:,1:2)-mean(V(:,1:2)),N); % use 128-pt FFT
P2=abs(Y/L); % all the energy still in L time samples
P1=P2(1:fix(N/2)+1,:);
P1(2:end-1)=2*P1(2:end-1);
f=Fs*(0:fix(N/2))/N;
figure
plot(f,P1)
untitled.jpg
Shows a little more structure, maybe -- whether any of it is real is probably questionable I'd guess...what is the measurement of?