I installed your code to try and undertand how this works. I can see the ringing effect that you point out. As per my post above I think all that is a needed is a two filter approach. This existing filter in your code that detects potential steps. The 2nd filtering stage ensures that 5 steps in 5 seconds are detected before counting them as step events. The step count will always be 5 seconds behind but I think that is ok. I have noticed (external observations as a user only) that FitBits and AmizFit Bips both appear to have a threshold before they will start registering steps. From a pure technical perspective that might not be the best theoretical approach but it appears to be working from a pragmatic point of view. Worth a try and get some feedback from others maybe ?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I installed your code to try and undertand how this works. I can see the ringing effect that you point out. As per my post above I think all that is a needed is a two filter approach. This existing filter in your code that detects potential steps. The 2nd filtering stage ensures that 5 steps in 5 seconds are detected before counting them as step events. The step count will always be 5 seconds behind but I think that is ok. I have noticed (external observations as a user only) that FitBits and AmizFit Bips both appear to have a threshold before they will start registering steps. From a pure technical perspective that might not be the best theoretical approach but it appears to be working from a pragmatic point of view. Worth a try and get some feedback from others maybe ?