How to remove noise from accelerometer data?
Show older comments
Here is my question, how can I remove data's noise from external environment?
Sorry I'm new with the signal anaysis, after using MPU6050 to get those vibration data, and then using FFT to get the plot, I receive the graph look like the example down below, can anyone please tell me how to explain it? I can't see any significant peaks on this plot, maybe the problem is the sampling frequency is too small? or do I need to provide some filter to remove the noise from the signal?
(By the way, I'm doing FFT with the sampling frequency 0.1703 Hz, and the data length is 30500.)

3 Comments
Walter Roberson
on 3 Aug 2021
sampling frequency 0.1703 Hz is only one cycle about every 5.8 seconds, but your graph shows quite a number of samples in less than 1 second. There seems to be an inconsistency.
KT Jiang
on 3 Aug 2021
Preetham Manjunatha
on 3 Aug 2021
Edited: Preetham Manjunatha
on 3 Aug 2021
Please see if this can help to filter the acceleration data acceleration to displacement. What is your X and Y values on the plots above?
Answers (1)
Image Analyst
on 2 Aug 2021
1 vote
That's not enough information. There are many kinds of noise. If you're going to use Fourier filtering, do you know that the noise is all high frequency? Or in some limited frequency band? Or else do you have some kind of impulsive noise, like shot noise or something, in the time domain (which would not respond to Fourier filtering)?
Do you have a plot of what you think the plot should look like it it were completely noise free?
How about time domain filters like movmean(), sgolayfilt(), medfilt1(), etc.?
Is there anyway youi can collect your data using a Lock-in Amplifier? A lock-in amplifier is a type of amplifier that can extract a signal with a known carrier wave from an extremely noisy environment. Depending on the dynamic reserve of the instrument, signals up to 1 million times smaller than noise components, potentially fairly close by in frequency, can still be reliably detected.
12 Comments
KT Jiang
on 2 Aug 2021
KT Jiang
on 2 Aug 2021
Image Analyst
on 2 Aug 2021
Did you notice that several of my sentences ended with question marks?
KT Jiang
on 2 Aug 2021
Image Analyst
on 2 Aug 2021
Then why do you think there is noise? Maybe there is no significant noise. Is there any problem with just going ahead with the signa as-is?
KT Jiang
on 3 Aug 2021
Walter Roberson
on 3 Aug 2021
The highest peak is not always at 0 Hz.
When you do an fft(), it works out that the first bin (the one that could be said to be associated with 0 Hz) is the sum() of the input signal.
Suppose you had 180000 points and the mean() acceleration was 0.001, then the first bin would be 180000/1000 = 180 which would probably be much greater than any of the other components. So it does not take much of a non-zero mean for the first bin to come out with a larger (absolute) magnitude than any of the other bins.
I talked about sum() and I talked about mean() multiplied by number of samples. But mean() is defined as sum() divided by number of samples, so mean() * number of samples is sum()/number * number which is sum() . But it is more convenient to think in terms of mean() a lot of the time.
In practice, if your mean() acceleration is non-zero, then you either have sensor drift, or you have biased sensor noise, or else your object is getting faster. Biased sensor noise is common, and sensor drift is not unusual. Sensor drift can occur if, for example, the sensor changes characteristics as it gets warmer, or if it leaks current in a cumulative way.
"Dead reconning" based upon acceleration data is notoriously difficult. It is common that if you drive around the block doing acceleration measurements, ending back exactly where you started, that dead reconning from the acceleration data will calculate you as being a number of feet away from where you really are.. and commonly it would also calculate you as still moving instead of having stopped.
KT Jiang
on 3 Aug 2021
Walter Roberson
on 3 Aug 2021
In my experience, printers vibrate at notably faster than 1/5 Hz; you might be experiencing significant aliasing.
KT Jiang
on 4 Aug 2021
Walter Roberson
on 4 Aug 2021
The only way to avoid aliasing is to sample at a frequency at least twice as high as the highest frequency vibration.
Categories
Find more on Spectral Measurements 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!