What I can tell others from my experience:
hrmSportMode setting should be best left at -1.
This is because hrmSportMode: 0 is real heart rate approximation for values between 50-90. Values above this are mostly impossible to predict with an algorithm considering the values this device produces.
hrmSportMode: 1 is a boosted heart rate from acceleration heuristics, but if you leave it on when you are not moving much it creates false positives. That explains moments of hr persisting above 100 when we are at 60. This mode NEEDS movement for it to make any sense. ( perhaps if it didn't trigger so easily from just being stationary it could be improved, it has hard-coded ppg delta change and the ppg moves a lot for no apparent reason on macro scale ).
Using hrmSportMode: -1 gives us best of both worlds, if we move a lot within a 20 second window period, we become 1, and then 20 seconds later, we are back to 0.
So ye, the 0 mode is really good for normal relaxed heart rate values. I tried to create an algorithm that is as good as it and it took me A LOT of effort just to get close. The difference was small and so I don't think I will even bother to release it. I will however collect some more data over the coming days.
When testing, remember to use Bangle.dbg() to notice the sportsMode changing because of the auto -1 in Bangle.getOptions().hrmSportMode
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.
What I can tell others from my experience:
hrmSportMode setting should be best left at -1.
This is because
hrmSportMode: 0
is real heart rate approximation for values between 50-90. Values above this are mostly impossible to predict with an algorithm considering the values this device produces.hrmSportMode: 1
is a boosted heart rate from acceleration heuristics, but if you leave it on when you are not moving much it creates false positives. That explains moments of hr persisting above 100 when we are at 60. This mode NEEDS movement for it to make any sense. ( perhaps if it didn't trigger so easily from just being stationary it could be improved, it has hard-coded ppg delta change and the ppg moves a lot for no apparent reason on macro scale ).Using
hrmSportMode: -1
gives us best of both worlds, if we move a lot within a 20 second window period, we become1
, and then 20 seconds later, we are back to0
.So ye, the
0
mode is really good for normal relaxed heart rate values. I tried to create an algorithm that is as good as it and it took me A LOT of effort just to get close. The difference was small and so I don't think I will even bother to release it. I will however collect some more data over the coming days.When testing, remember to use
Bangle.dbg()
to notice the sportsMode changing because of the auto-1
inBangle.getOptions().hrmSportMode
I believe the algorithm relies on something similar to :
http://sim.okawa-denshi.jp/en/OPseikiLowkeisan.htm after looking at the decompilation. So its a frequency-domain based solution? I guess.
The method I have been testing recently was a threshold based peak detection on the time-domain.
I'm personally grateful we have something that works so well, considering how the signal looks, its kind of a miracle.