How do I plot the FFT of signal from accelerometer
Show older comments
The Sample rate of the accelerometer from the arduino IDE was 833Hz and I placed the accelerometer on a shaker, The shaker has an input frequency of 200Hz and amplitude of 3Vpp in 13s. The data generated was recorded in .CSV as attached.
Can anyone help with the FFT code using either the X-axis(First column) or Y-axis data(Second column) ?
Accepted Answer
More Answers (1)
William Rose
on 6 Aug 2022
0 votes
Sampling rate is fs=833 Hz and there are N=1110 samples. (I deleted line 1 since it has only one number.)
When you do the FFT, you get a vector of N complex numbers. The first N/2+1 of those numbers correspond to frequencies 0:df:Fs/2, where df=fs/N.
Plot the amplitudes of the first N/2+1 elements of the FFT, versus the frequecies as described above.
2 Comments
tje_b
on 6 Aug 2022
William Rose
on 7 Aug 2022
The script I posted in the comment below computes the FFT of all three components. It also plots all three components.
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
