I\'m doing some math on both gyroscope and accelerometer data combined and I\'d like to low pass filter the resulting data. So could someone post some generic code for a Low Pas
If Apple's AccelerometerGraph example is too complex for you to understand, I created a simpler accelerometer example for my class which you can download here. This implements a simple low-pass and high-pass filter for raw accelerometer values, then logs the results to the screen.
As hotpaw2 and Goz describe, this uses a very simple weighted rolling average for the filter calculation:
UIAccelerationValue lowPassFilteredXAcceleration = (currentXAcceleration * kLowPassFilteringFactor) + (previousLowPassFilteredXAcceleration * (1.0 - kLowPassFilteringFactor));