OpenSeizureDetector / BangleSD

A BangleJS watch app that acts as a Bluetooth data source for OpenSeizureDetector
https://openseizuredetector.org.uk
MIT License
1 stars 0 forks source link

Heart Rate Value Accuracy #3

Open jones139 opened 9 months ago

jones139 commented 9 months ago

I am suspicious of the heart rate measurement accuracy - it looks like it is too high on me (I would have expected about 60 bpm but it was indicating over 90 bpm (V0.12)

jones139 commented 9 months ago

See discussion on Espruino forum here: https://forum.espruino.com/conversations/385922/?offset=75

jones139 commented 9 months ago

I thought the difference might be because of my heart rate rhythm issue, but we tested it on Sandie and got the same result - BangleJS2 value was significantly higher than both Garmin and manual measurement of heart rate while at rest. We have not tried to do this during exercise.

jones139 commented 8 months ago

Maybe it just needs more time to settle than Garmin - if I sit still we get pretty good agreement, but if there is any movement the BangleJS reading seems to go high - I think the movement is causing spikes in the photodiode reading which is being counted as a peak.

jones139 commented 8 months ago

I have added the HRM app to this repository (and modified it so I can read the confidence value with my eyes) so we can see what it is doing more easily

jones139 commented 8 months ago

I'll have a look at this paper and see how it compares to the Banglejs algorithm: https://www.researchgate.net/publication/336880338_Analysing_Noisy_Driver_Physiology_Real-Time_Using_Off-the-Shelf_Sensors_Heart_Rate_Analysis_Software_from_the_Taking_the_Fast_Lane_Project

jones139 commented 8 months ago

Someone else has been thinking of the same sort of thing: https://www.majorinput.co.uk/post/bangle-js-2-dealing-with-noisy-ppg-signals

jones139 commented 8 months ago

I haven't had much success. I collected HRM data from the BangleJS2 while I was walking, and have tried some simple processing to try to see the signal as shown in the graphs below. The top graph is the raw HRM signal, the middle one is after I have tried differentiating it to take away the absolute level of drift. The bottom one is a check of the time spacing between readings - we sometimes miss a reading, but this will not be causing the issue as it will be only a small effect. These graphs cover 10 seconds, so we expect to see around 8 heart beats in the signal. BangleJS_HRM_walking The issue is, I can't really see a heart rate signal.... I tried firing up a PineTime with WaspOS and used their simple HRM app and this is showing a very clear signal varying at the correct frequency for it to be heart rate (admittedly this signal is cleaned and filtered on the Pinetime ppg.py) Pinetime_HRM

So there is something not right about the BangleJS2 HRM for the signal to be so difficult to see in the data.

One noticeable thing is the brightness of the LEDs - the device on the left is the PineTime, and the one on the right BangleJS2: Pinetime_Banglejs_hrm_leds

Now my Garmin Forerunner 245 watch HRM LED intensity is between the two, but the Garmin LEDs are much larger, so may well be putting out similar amounts of light to the Pinetime. So I am wondering if the auto gain function in the Banglejs2 is turning down the LED current too far that there is not much return signal to detect?