I am currently going over this paper, and in fact have already tried to implement it:

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4634483/ [1]

Paper looks at the amplitude of the step and the time between the swings. ALthough I seem to understand the general idea, I am slightly confused about one of the formulas, which describes time between steps, namely:

"To extract only one valley from a gathered group of valley candidates in a very short time range, every valley candidate is validated by checking the time distance to the recent valley using the following threshold.

$Th_v = \mu_v - (\sigma_v/\beta)$

where $\mu_v$ and $\sigma_v$ represent the average and the standard deviation of the time interval between adjacent valleys in the magnitude of acceleration, respectively. These averages and the standard deviations are calculated for recent M peaks or valleys."*

Except time threshold obviously magnitude is also taken into consideration.

So I have produced magnitudes that I obtain from my sensor: enter image description here

where red dots correspond to initially discovered valleys and purple to points that should re-evaluate last valley.

So what I currently have is something like this:

1) I obtain valley at point 20. I obtain valley at Point 49. This should mean that the average distance between two valleys is 29 readings, and therefore I set my $\mu_v = 29 and \sigma = 0$, which yields me a value of $Th_v=29$ ( my $\beta = 1/3$). I also store the difference (29).

2) Then I get to point 51, which should update the $Th_v$ value. So now I calculate the mean, which I think means $(29 + (51-49))/2 = 15.5$

And calculate standard deviation, which equals $19.09$. So then when I actually plug these values in the formula above I get $Th_v = -41.909$, which should not be possible as I believe this value should be always positive to indicate the time between two valleys.

Am I dong something incorrect or do you have any idea what's wrong with my or paper's approach?


[1]: Lee H, Choi S, Lee M. Step Detection Robust against the Dynamics of Smartphones. Wang X, ed. Sensors (Basel, Switzerland). 2015;15(10):27230-27250. doi:10.3390/s151027230.

  • $\begingroup$ Don't use images as main content of your post. This makes your question impossible to search and inaccessible to the visually impaired; we don't like that. Please transcribe text and mathematics (note that you can use LaTeX) and don't forget to give proper attribution to your sources! $\endgroup$ – Raphael Nov 18 '17 at 17:19
  • 1
    $\begingroup$ We expect references to fulfill the minimal scholarly requirements and be as robust over time as possible. Please take some time to improve your post in this regard. We have collected some advice here. $\endgroup$ – Raphael Nov 18 '17 at 17:19
  • $\begingroup$ The title you have chosen is not well suited to representing your question. Please take some time to improve it; we have collected some advice here. Thank you! $\endgroup$ – Raphael Nov 18 '17 at 17:19

I managed to solve the problem of the algorithm by using a different approach. Algorithm is not clear on what is happening with the initial values or how to reliably capture a set of peak/valley candidates and how to deal with them.

Therefore, we decided to use only magnitude part of the paper, which radically simplifies the whole algorithm, and in fact works great ( assuming you are getting reasonable sensor readings).

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.