The original idea is to calculate distance from accelerometer input. However, accelerometer reading also contains the gravitational values, thus to remove gravity, I tried using Gyroscope. The idea was to calculate angle of rotation from gyroscope and then calculate gravity at this angle and subtract it from accelerometer. However, gyroscope values drift.
So I tried using Kalman Filter for this. However, Kalman Filter is working very slow. So now finally, I am thinking of converting the gyroscope values in frequency domain with the help of Fourier Transform, and then trying to calculate angle of rotation.
Has anyone tried such crazy idea before? Any leads? I managed to calculate Fourier Transform of Rotation Rate of Gyroscope, however, I am not sure how I should go ahead with these transformed values.
P.S. - I am working on Windows 8 device, and coding in c#.