Accelerometers are notoriously noisy, as most sensors are, and this inevitably will generate inaccuracies. PhoneLabs is about tool building and we need to figure out how best to deal with noise. There are many ways to do it.
Lets get some data
I swung my phone around for about 7 seconds and this is what was emailed to me by the Physics Tool Box app.
Hope you can see some noise. Lets try averaging it.
We can find averages in Excel by using = AVERAGE( ). Lets try averaging 3, 10, and 20 readings. Now you can see the data getting smother, but its shifting or a small delay is caused by averaging. So this is just one simple way of reducing noise.There is another way.
Low Pass Filter
…. and it seems to be easy as it is based on this formula :
y[ i ] : = y[ i-1 ] + Alpha*( x[ i ] – y[ i-1 ] )
It worked nicely. But there is a little shift in the other direction (not sure why). The noisy kinks are gone for sure.
So we now know how to get rid of noise.
You can download this data in Excel and have a play.