how to calculate exact foot step count using accelerometer in android?

前端 未结 5 1129
既然无缘
既然无缘 2020-12-07 10:01

I am developing some application like Runtastic Pedometer using the algorithm but I am not getting any similarity between the results.

my code is as follows:

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 10:52

    I am using step detection in my walking instrument. I get nice results of step detection. I use achartengine to plot accelerometer data. Take a look here. What I do:

    1. Analysis of magnitude vector for accelerometer sensor.
    2. Setting a changeable threshold level. When signal from accelerometer is above it I count it as a step.
    3. Setting the time of inactive state (for step detection) after first crossing of the threshold.

    Point 3. is calculated:

    • arbitrary setting the maximum tempo of our walking (e.g. 120bpm)
    • if 60bpm - 1000msec per step, then 120bpm - 500msec per step
    • accelerometer passes data with certain desired frequency (SENSOR_DELAY_NORMAL, SENSOR_DELAY_GAME, etc.). When DELAY_GAME: T ~= 20ms (this is included in Android documentation)
    • n - samples to omit (after passing the threshold)
    • n = 500msec / T
    • n = 500 / 20 = 25 (plenty of them. You can adjust this value).
    • after that, the threshold becomes active.

    Take a look at this picture: My application

提交回复
热议问题