# Time interval correction for step detection algorithm

Computer Science Asked by Johhny Bravo on October 19, 2020

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

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:

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?

References:

[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.

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).

Answered by Johhny Bravo on October 19, 2020

## Related Questions

### What are the differences between Earliest Deadline First (EDF) and Earliest Due Date (EDD)?

1  Asked on November 5, 2021

### If a grammar G is left and right regular, why $||L(G)|| leq ||P||$?

1  Asked on November 5, 2021

### Scheduling jobs online on 3 identical machines – a lower bound of 5/3

0  Asked on November 5, 2021

### Proof for values of d with d:= ||L|| – N(L) with $d in mathbb{Z}$ and N(L) Nerode Index

1  Asked on November 5, 2021

### Is there a way to map the concatenation operation over strings to the addition operation over $mathbb{N}$

1  Asked on October 21, 2021

### Confusion in Reduction of Hamiltonian-Path to Hamiltonian-Cycle

2  Asked on October 21, 2021

### Proof: is the language $L_1={langle Mranglemidemptyset subseteq L(M)}$ (un)-decidable?

2  Asked on October 21, 2021 by schleudergang

### Removing left factoring from Context-Free Grammar

1  Asked on October 21, 2021 by mmbs

### Design of a synchronized clock

0  Asked on October 21, 2021 by ahmedou

### How do you calculate the running time using Big-O notatation?

1  Asked on October 21, 2021 by veree

### How private IP address is determined?

1  Asked on October 21, 2021 by nurin-izzati-jafri

### Is the discrepancy in Turing’s representation of complete configurations intentional?

0  Asked on October 21, 2021

### First-time and second-time seen edges in DFS on undirected graphs

1  Asked on October 21, 2021 by mgus

### Race Condition in Mesa Monitor

0  Asked on October 21, 2021 by heroman

### Equivalence of Krom formulas tractable?

2  Asked on October 21, 2021

### Nondeterministic polynomial time algorithm versus certificate/verifier for showing membership in NP

1  Asked on October 21, 2021 by atsina

### Intuition behind the entire (amortized) concept of Fibonacci Heap operations

0  Asked on October 21, 2021

### Counting one’s in a stream of bits

0  Asked on October 21, 2021 by srajan

### Conway’s Game of Life: Is it really P-complete?

1  Asked on October 21, 2021 by fluffysheap

### Find original array from array with pairs of adjacent elements

1  Asked on October 21, 2021 by james-flanagin