How to remove noise from accelerometer data?

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

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.
Oh there is a small text " ×10^4 " on the bottom right side of the graph, so the time vector be like 0s, 20000s, 40000s.....180000s.
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?

Sign in to comment.

Answers (1)

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

Thanks for your advice! I would try the time domain filter that you suggest!
First, these data are collected from the 3D printer, I don't know that the vibration data does include noise or not, the reason I do FFT with these data is because I want to know if it can tell me that the machine occur trouble or not. Is there a way to check if the signal include noise or not?
I have see many of FFT plot that include only one or two significant peaks, so I think that the plot I complete must be the same as that kind of result.
Did you notice that several of my sentences ended with question marks?
Sorry, I know that you are asking me several questions, but I'm new with it, so I think I'll take any of your opinion as advices.
About the question you ask about the noise, because I don't know if my data include noise or not, so I can't confirm that the noise belong to what frequency.
Can I get more information about the relation between noise and specific frequency by doing this amplitude plot?
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?
Ok I think I'll just keep going for it, still appreciate so much for your opinion.
KT Jiang
KT Jiang on 3 Aug 2021
Edited: KT Jiang on 3 Aug 2021
Forgive me, but I would like to know why there is always highest peak exist at 0Hz? (not the graph I posted above)
I have search for it, but I still can't figure out what does that mean when the data is collected by accelerometer, is that normal or I did something wrong with FFT?
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.
Thanks for your clear explanation about the question I asked, but I'm still a little bit confused about the sensor data, the temperature of the location I set MPU6050 doesn't changed much, it's always be like around 27℃, so I think the mean of acceleration is about 0.44 is caused by the sensors noise, and I'm sure that the object doesn't moving faster.
So the way to remove sensor noise from acceleration data, is to use some kind of filter such as movmean(), sgolayfilt(), am I comprehend it correctly?
By the way, here is the code I used for FFT, I would like to know if it has any mistakes or not, thanks.
In my experience, printers vibrate at notably faster than 1/5 Hz; you might be experiencing significant aliasing.
I would like to know if there is a way to avoid aliasing, can you please explain more about it?
The only way to avoid aliasing is to sample at a frequency at least twice as high as the highest frequency vibration.

Sign in to comment.

Products

Release

R2020a

Asked:

on 2 Aug 2021

Commented:

on 4 Aug 2021

Community Treasure Hunt

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

Start Hunting!