How to plot FFT in MATLAB by executing Vibration data recorded in Excel?

Hi,
I have several recorded vibration measurements in Exel files as Time vs. Acceleration. Now I need to plot Time Vs. Acc and FFT graphs for further analysis.
Thank in Advance for all put their comments and suggestions below!

 Risposta accettata

Use the fft function. The documentation will tell you how best to implement it for your signal.
Note that the sampling intervals must be constant, so if they are not, first use the Signal Processing Toolbox resample function to interpolate them to a constant sampling interval. Then use the fft function to calculate the spectra.

8 Commenti

I tried an alternative way. First I did the math in the same excel sheet then I plotted the datas (magnitude vs frequency) in matlab. but I am not sure my answer is right. I am getting a symmetric graph. In the youtube tutorials everyone show how to do fft by creating a wave using sin function and then they do fft with (sampling frequency etc...) Where can I find the steps from very basics to call the raw datas form excel and plot Time vs Amplitude, Frequency vs magnitude graphs for my vibration analysis. [Beside all, I am new for MATLAB],
The symmetry in the plot is because you are most likely plotting the complete fft results. The first half of that vector is a ‘one-sided’ Fourier transform, and the second half is the flipped complex-conjugate of the first half. It is only necessary to plot the first half in most instances. If you plot both, you will need to use the fftshift function, and then create an appropriate frequency vector with negative and positive components.
I usually use s version of this to plot a one-sided fft:
t = ...; % Time Vector
s = ...; % signal Vector
L = numel(t); % Signal Length
Ts = mean(diff(t)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
FTs = fft(s)/L; % Normalised Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
plot(Fv, abs(FTs(Iv))*2)
grid
title('Fourier Transform')
xlabel('Frequency (units)')
ylabel('Amplitude (units)')
.
Thank you so much! This reply makes lot of sense for me. I apprecite your time and effort on my question, Is there any way I can contact you? by E-mail?
As always, my pleasure!
Contacting me here is the best option. (I have email set up through my profile page, however I do not frequently look at that account, and almost always do not respond to any MATLAB-related emails sent to it.)
haha.. I got you. I have started my works based on your support. i will keep updating you.
thank you once again
It really worked Star Strider! You have no idea how much this help worths for me. Thank you so much! Thanks a lot.
As always, my pleasure!
I am happy that you got everything sorted!

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by