This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

how to count steps
#1
Just as an exercise i want to implement a step counter based on the acceleration sensor:

With every step you get a peak in the accelaration, you just need to identify these peaks and count them.

Standard method would be take the timeseries of the accelearation a(t), convert to a two valued rectangular function which is  0 for a < a0 and 1 for a >= a0 with a0 some threshold. Search and count the positive flanks of this by differentiating this function and output this as value 'steps' .

in a simple scheme:

acc.sensor:abs ---> formular sign(a-a0)  --> differentiate --> range filter(y>0.5)  --> count  = 'steps'

This is not perfect but works somehow (would be great to have somthing to smooth the sensor output like gliding average or some digital filter ...)

But i tought also of using some of the other predefined modules:
In the editor i find a module "threshold" which delivers the index of the first occurence when the input goes above threshold. I thought appending this to a new buffer and counting ellements in this buffer would give the steps. But this counter remains allways at 1. What am i  doing wrong ?


acc.sensor:abs ---> threshold, a0 --> append --> count = 'steps method 2'



.phyphox   Step_counter.phyphox (Size: 5.34 KB / Downloads: 385)
Reply


Forum Jump: