# Removing noise from accelerometer data

I am new to signal analysis and I need to remove noise from an accelerometer recording. 2 accelerometers are mounted a machine and recorded vibrations at 500 Hz. The aim is use vibrations to differentiate working situations, we expect increased vibrations on certain situations.

The figure below shows recording for one channel.

Machine started to work at 250 s and stopped at around 3100 s, the recordings before and after shows noise from other sources. These noise sources are also exists during the machine's working time. Figure below shows fft for noise and signal+noise.

What I need to do is remove the noise from recordings. What kind of filter should I use?

• Are you certain your board or coax is not microphonic from change in capacitance? Is it mounted to the largest mass and stable? Your SNR appears adequate for detection, in the spectral display? You need to define what acceptable error rate of detection you want then the threshold of signal and noise and decide what/ how much filtering is needed will come out of your needed error rates for true/false detections. Jan 21, 2017 at 0:36
• With multiple channels, you can try to cancel out noise like a phased array does. Noise or signal need to be correlated in a different way to use this approach. Changing the position of sensors may help, if noise and signal excite the machine in different modes. Jan 21, 2017 at 9:00
• I think the question you should ask is: *Do* I have to filter out the noise? It is not obvious to me that you do, it looks like nice and clean white noise that doesn't interfere much with the signal.
– pipe
Jan 21, 2017 at 13:12
• @Andreas, which would be those algorithm? Sep 3, 2017 at 18:50
• @hyprfrcb You would phase-align individual channels, then average all channels. Your signal will be coherent in all channels, you will gain 6dB amplitude per channel. Noise will be non-coherent, it will still add up, but only with 3dB per channel. SNR is improved. Sep 3, 2017 at 20:14

From the looks of this data you could simply clamp any samples between 0.7 and 1.3 to 1.0 so that you get a flat line until the machine starts operating. Alternatively (or additionally) only enable data collection when you see a short series of samples above a particular threshold.

Looking at your frequency plot, you show that the noise floor is wideband and spans all the way across your target range. This means there's no frequency-based filter (e.g. low pass) that you can use in this scenario.

• What do you mean with 0.7, 1.3, 1? Sep 3, 2017 at 18:48
• @hyprfrcb Values between that range on the graph appear to be part of the noise floor rather than data. So by clamping those to a fixed value (1.0) you discard a lot of the useless samples. Sep 3, 2017 at 18:52
• you mean 0.7g, 1.3g, 1g....... Sep 3, 2017 at 18:54
• @hyprfrcb Yes. I skipped the units because I thought they were obvious from the context. Sep 3, 2017 at 19:36

your approach will depend on how much you know about the noise.

if you know its frequency composition, for example, you can decompose it via FFT, reset the amplitude for the frequencies where you think the noise is present, and do a reverse fft.

if you have additional measurements of the same physical attributes, you can fuse those measurements.

if you don't know much (other than that the noise is of higher frequency), you can filter it.

each strategy has numerous ways to be implemented, however.

You can increase the signal to noise ratio by using a filter that has a higher gain in the portions of the spectrum where your signal has higher power, and lower gain where your signal has lower power. You do that by creating band-pass filters centered around the parts of the spectrum where your signal has the highest power level. The result is that you throw out the noise across most of the spectrum. You also throw out some of your signal, but only in the parts of the spectrum where it had much lower power levels.

From your FFT graph, your signal has the highest power levels at 150Hz and 200Hz. There is also a little more power at 50Hz and 225Hz. If you take your FFT data array and zero out all the samples from 10Hz to 40Hz, 70Hz to 120Hz, 230Hz and onward, and then take the inverse FFT you will get your original signal, with some minor distortion, and most of the noise removed.

If you are using MEMS accelerometers, the RMS noise is often proportional to the square root of the sample rate. So sampling at a lower rate can often lower the noise power.

If the noise were occurring at some particular frequency you could just create a notch filter at that frequency. Or even simpler, take the FFT of your results, set the values in the FFT data array at the noise frequency to 0, and then take the inverse FFT to get your original signal minus noise.

The problem is that your FFT graph shows the noise amplitude as pretty flat across the in the frequency domain. So it would be classified as white noise. Therefore you can't use a notch filter to remove the noise.

If you just want to detect what operating mode some machine is in based on the vibration (and you don't really care about the shape of the signal itself), then you can just put a band pass filter at the frequency you know the vibration to be occurring, and then trigger based on the amplitude going over a certain threshold.