Dave
Dave

Reputation: 1950

using accelerometer to determine if phone is at rest

I'm building an app using the Windows Phone 7 SDK and I've got a thread that is constantly returning X, Y, and Z accelerometer data. I need to determine at any given time whether the phone is moving or not. Can someone help me step through the logic/math needed for this?

Upvotes: 0

Views: 202

Answers (1)

Ali
Ali

Reputation: 58521

Use a high-pass filter. Chose an alpha arbitrarily (0.3 seems as a good initial guess), and if y[i] exceeds a threshold determined by your experiments then the phone is moving, otherwise it is not. Note that you only need to store the last y[i] and the last measurement. Good luck!

Upvotes: 1

Related Questions