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:
- Analysis of magnitude vector for accelerometer sensor.
- Setting a changeable threshold level. When signal from accelerometer is above it I count it as a step.
- 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:
