Accelerometer and Noise Filtering (Moving Average Example)
Often times, in data collection, the raw data is rather noisy. In the figure below, I have connected all 3 axes of our accelerometer to our board, and set the board to log every 100mS.
I then moved the accelerometer through a serious of orientations, such that acceleration due to gravity (1 G) was sensed on each of the axes. As you can see, the resulting data was quite noisy.
However, we can apply a moving average to the data inside the MDX software as follows:
Note the options history and auto average. Options history specifies how many of the past parameters to hold in memory when performing the averaging calculation. For example, in this case:
<iochannel id="Port9" port="9" brain="TestBrain1" type="analogue_input">
<options history="10" auto_average="true"></options>
Value _new = (Value1 + Value2 + Value3 + Value4 + Value5 + Value6 + Value7 + Value8 + Value9 + Value10) / 10
where values 1-10 are the past 10 measured values, respectively.
Then, the accelerometer is put through a range of motions, as shown below:
The units are 100mS and G-force.
Hope this helps! Post any questions.