How to plot FFT in MATLAB by executing Vibration data recorded in Excel?
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
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!
Accepted Answer
Star Strider
on 3 Jan 2021
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 Comments
Wakeel Mohammed
on 6 Jan 2021
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)')
.
Wakeel Mohammed
on 6 Jan 2021
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?
Star Strider
on 6 Jan 2021
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.)
Wakeel Mohammed
on 9 Jan 2021
haha.. I got you. I have started my works based on your support. i will keep updating you.
thank you once again
Star Strider
on 9 Jan 2021
As always, my pleasure!
Wakeel Mohammed
on 9 Jan 2021
It really worked Star Strider! You have no idea how much this help worths for me. Thank you so much! Thanks a lot.
Star Strider
on 9 Jan 2021
As always, my pleasure!
I am happy that you got everything sorted!
More Answers (0)
Categories
Find more on Discrete Fourier and Cosine Transforms in Help Center and File Exchange
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)