Bangle.js 2 Cutting Edge - new heart rate algorithm

Posted on
Page
of 6
First Prev
/ 6
  • 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

    I believe the algorithm relies on something similar to :
    http://sim.okawa-denshi.jp/en/OPseikiLow­keisan.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.

  • Yes, I think as you say the binary blob is frequency based - it works on blocks of data, rather than instantaneously (as the 'open' algorithm does). I think the benefit there is it's relatively straightforward to discount readings where there's high acceleration.

  • Hey all. Thanks for all the hard work tinkering and testing the HRM settings. I've read the 6 pages of back and forth and just want to confirm a couple of things. As a non-technical end user and based on the current firmware, overall how accurate is the HRM? What are the key things to presently be aware of when considering HRM data (ex: certain activities are more prone to bad data VS resting HRM, etc.)? Thanks in advance!

  • I think someone else needs to jump in here and answer as I haven't done a great deal of comparison testing, but my experience has been that with the new algorithm, HRM works well enough for everyday use.

    However it's not going to compete with a device that uses an actual ECG - it's a different technology that is much less susceptible to movement.

  • Thanks for the reply Gordon! I didn't realize that we weren't really comparing apples-to-apples. It sounds like it'll be most useful to gather a really good understanding of my resting heart rate and maybe my sleep heart rate, but that I should take it with a grain of salt when moving.

    I'd be curious if someone else can comment on if light movement walking HRM tends to be accurate. Also, does it find its "groove" over the course of exercise (I.e. maybe the first few minutes of a 30-60 min walk might be a bit funky, but perhaps it settles into a rhythm once movement is detected)?

  • Very late response, but I don't know how useful it is anyway:

    Compared to a Fitbit Versa 3, I usually get within 5-10bpm consistently. They both use the photosomethingorother sensor, but in case there was some secret algorithm Fitbit uses, here's a roughly what I've found:

    Fitbit likes to draw their graphs as "landscape" as possible, with a thick line that hides how spikey it gets, but usually it has the exact same peaks and valleys as Bangle.

    Attached are screenshots of the graphs of both while shoveling and using a snowblower on and off for about an hour and a half.

    Peaks in the Fitbit graph are 117bpm, then 132, 132, 132.
    Corresponding peaks in Gadgetbridge are 90bpm, then 127, 130, 137.


    2 Attachments

    • Fitbit Versa 3 - 20240325.png
    • Screenshot_20240325_155050_Banglejs Gadgetbridge.jpg
  • Appreciate the insights :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle.js 2 Cutting Edge - new heart rate algorithm

Posted by Avatar for Gordon @Gordon

Actions