Moving Average for Speed and Acceleration

299 Views Asked by At

I am tracking a person using a set of ultrasound tracking device. The ultrasound system provides (x,y) location data at 8Hz frequency, and there are 131 data points in total. When calculating the person's speed and acceleration in the y-direction using just the raw location data (differentiate the distance to get velocity and then differentiate the speed to get acceleration), the results looked very noisy. Thus I applied moving average using averaging interval = 8. For speed, it seemed straightforward: apply moving average filter to the 131 speed data points (thus I would have 124 speed data points that are smoothed out). However for acceleration, I am not sure if I should: 1)apply moving average filter directly to the 131 acceleration data points that were calculated from the original 131 speed data points, or 2)calculate acceleration by differentiating the smoothed out 124 speed data points.

I tried to calculate and plot using both methods and it seemed that in some cases the differences are not negligible.

This is the speed data before and after applying the moving average filter

enter image description here

This is the acceleration data. The orange line was from method 1) and the grey line was from method 2).

enter image description here

Which method is more logical if I want to get smoothed out acceleration data? Thanks.