views:

842

answers:

2

Using the accelerometer output, how do I determine if the user (iphone mounted on waist) is walking?

Looking for a good algorithm to determine if the user is walking to determine activity transitions- standing-to-walking or walking-to-standing.

please help.

Thank you for your time.

+3  A: 

For a previous project, I tried calculating the magnitude of the acceleration vector, and just setting a threshold of about 2g, and that worked pretty well in testing. A typical (hardware) pedometer will ignore single jolts that happen more than about a second apart, which seems like a good way to filter out occasional movement that isn't "walking".

Additionally, you could automatically adjust the threshold by examining the data for a while.

Mark Bessey
A: 

Hey,

Can someone please help and suggest a simple way (or maybe not :)) to calculate the direction which i'm heading to (i.e. walking), from the accelerometer data?

Thanks!

scorpiocos
I don't think you can do that because you don't know the iPhone's exact aligment in the pocket / backpack / whatever. You would need the compass data, too.
Thomas