0

simple question hard answer:

I'd like to be able to read if the device (and the user) is running/walking holding his device. I know that the iPhone accelerometer calculates acceleration so if the user runs at a constant speed, there will be no signal spotted.

Any help on that ?

Yohan Attal
  • 37
  • 1
  • 4
  • I think the right answer depends on how correct you need the detection to be. A simple shake gesture detector triggers pretty often when I run with the phone in my pocket (and nearly no false positives). Maybe I'm just a jiggly runner, but this might be a simple way to start. – danh Apr 16 '12 at 22:58

2 Answers2

9

I actually used to work on that...what you can do is to detect with the accelerometer and gyro the frequency of the movement. If you plot a chart, you will see a periodic behavior when you walk or run. Do some "field" testing and you could see how those frequency change between walking and running. It's pretty cool.

TommyG
  • 4,145
  • 10
  • 42
  • 66
  • In addition, I would also expect that a person that is running produces higher acceleration values. Sounds like something interesting to work on! – thundersteele Apr 16 '12 at 22:49
  • This all sounds very exciting! – sooper Apr 16 '12 at 22:55
  • 1
    Yeah it looks exciting... especially when you like maths and physics, which I don't... Ali, would you have a snippet example to show your theory ? I really don't how what to use to calculate frequencies of movements... – Yohan Attal Apr 17 '12 at 10:02
1

Try dynamic time warping (DTW).

First, you build a small "database" of motions that you would like to recognize.

Then, in your application you compare the current sensor readings with DTW to the ones in the database and pick the most similar one.

Community
  • 1
  • 1
Ali
  • 56,466
  • 29
  • 168
  • 265