PPG analysis beyond HR at rest

Posted on
of 4
/ 4
Last Next
  • Hello - this thread is intended to colaborate on PPG analyis, especially for bangle.
    This discussion bagan in other threads (eg. http://forum.espruino.com/conversations/­371899/?offset=75#comment16386217) where it doesent really belong.

    I will try to collect a summery of the status quo soon.
    [Update]: not really soon, but finally here is introduction overview and summery of the current state:
    [Update 3.9.22: @Gordon test harness; Analysis and literature from @user140377 ]


  • Excuse me asking what is PPG?

  • Photoplethysmography. It is the principle behind the heart rate monitor on most smart watches. Heart rate itself is just the tip of the iceberg, but heart rate during exercise is probably the top of the list.

  • Ok - so this thread is for fixing the HRM on Bangle 2.
    I'd be happy to do some tests but dont want to get sucked into doing R&D for it.
    In fact I just went out on a 4 mile walk with the Run and recorder on.

    I also wore my amazfit bip on the same wrist and could clearly see when the Bangle HRM was struggling. Its all down to speed of movement. Unfortunately after about 1h20 the watches clashed together and a long button press occurred on the Amizfit and stopped the activity. The Amizfit frooze and actually crashed (first time I have seen it do that) and the log was lost. Just about to see what I can pull off from the Recorder App.

  • Yes, that is exactly what it is about, and eventually more.

    I am not sure that I am even getting a reasonable heart rate when staying still at the moment, but I need to get something to compare to.

  • I was in the mountains today (therfore myownself was faster answering you @HughB for the PPG) and for some time did record bangle HR/Confidence and H10 reference simultaniously. Will do a statistic later this evening to compare were we are when it comes to walking on rough terrain.
    (we do not yet have the ability to record the raw PPG data on the go though, but halemmerichs hrmaccevents is a great starting point for quick experiments with raw input, bt hrm gold standard and acc to compensate for motion)

  • I'm using 2v12.0 firmware and my feel of the heart rate is that it is beleivable up to about 2mph. After that it quickly goes off piste. But I did see my heart rate at 145 bpm when I was moving at 3mph. My perception is that is slighly improved by definitely not good enough for running yet.

    Glad you guys are working on this. I wish you every success. Happy to do some test runs of new versions of stuff. I have an AmizFit Bip, Fitbit HR and Amizfit GTS2 if you want me to compare against.

  • Oh I hadn't seen that. @halemmerich seems like you should be in this thread.

  • @Mi (trying to keep the HRM chat in one place, although follows on from the run app thread): is it easy to extract data from the H10? Would I be able to use it to record data and then extract it to a Linux computer easily enough, or do I need to connect it to something to live transfer it?

  • Did a first statistic of current state HR when moving but not heavily (walking and in car as a passanger). By mistake posted this in other thread:
    In essence: pretty good when confidence >90 which was the case in a little bit over 10% of the readings. For other times the standard deviation gets much higher but when averaging the values are not totally off for more than half the time.

  • yes, recognized my error - before seeing your remark and question

    is it easy to extract data from the H10? Would I be able to use it to record data and then extract it to a Linux computer easily enough

    Its very easy. Heaving installed the BT HRM App it does write both internally measured and bluetooth measured values in the csv of recorder app. I just read in this csv with pandas in a jupyter notebook on linux and could do statistics easily.
    If you are interested I can post this nb or see if I can check in somewhere

    UPDATE: File is actually not that big, so just added it here

    1 Attachment

  • Excellent. Thanks. That was (besides price) one of the things giving me qualms.
    I'll think about it further before getting one, maybe there are enough people who can provide data already and the last 2 weeks I have been too busy with work (and now being ill) to spend the time I want with the Bangle. Hopefully that is going to improve soon.

  • What the polar does not have as an ECG device is SpO2 obviosly (don't see that for their opticals either though).
    I do have a pollux 400 here, which can measure and record SpO2, but this has no bluetooth so sync will be more effort.

  • @HughB: Some even easier plots, clearly showing the effectiveness of Confidence:
    (ideally all dots should be on the diagonal. Be careful: I didn't manage to have the axis the same)
    Now the task is "just" to get more dots with high confidence :-)

    1 Attachment

    • Scatter_HRvsHR.png
  • Ah, I will have a think, perhaps getting something for that makes more sense.

    I have access to a Blood Pressure cuff when we have got the basics sorted. I don't know of any devices that claim to do BP without requiring calibration, nor in motion, so lack of Bluetooth isn't a big deal there.

  • I've done a few old fashioned tests (watch and finger on pulse) and have confirmed pretty much what I suspected. Even staying still, the Bangle is missing every second beat. It reports pretty much exactly half my actual heart rate, sometimes claiming 100% confidence.

  • What firmware are you using? Make sure to have the newset.
    I had the same behaviour, but I don't see that halve values anymore with current firmware 2v12.
    (probably that change I guess: https://github.com/espruino/Espruino/com­mit/407dd17e0903840df724ebf25f83d2bb9586­3fb5)

  • I am on 2.12.

  • Got an overview of the current HR algorithm at https://github.com/espruino/Espruino/blo­b/407dd17e0903840df724ebf25f83d2bb95863f­b5/libs/misc/heartrate.c
    Basically a FIR filter emphasizing 0.9 Hz - 3 Hz with step recognition via demanding two upward steps after having been below moving average. [Idea that comes into mind is to demand upward steps to be above moving average? Will try]:
    Then a median filter from the last 8 peaks. Confidence is out of the spread of those 8 values.

    I struggled a bit with line 268. Seems to introduce a factor of 175/16=10.9.
    Probably to bring result in good range for integer arithmetic?

    And here is where the raw values come from.: https://github.com/espruino/Espruino/blo­b/407dd17e0903840df724ebf25f83d2bb95863f­b5/libs/misc/hrm_vc31.c Need to understand what was done to the signal already and what options the hardware brings.

  • I'm happy to contribute with running data. I have an arm bthrm. For those like me who'd like to contribute can you specify which settings are ideal to get consistent data to help ?
    How do you want the watch to be worn ? Like tight, slightly loose, like everyday ?
    Which settings in bthrm and apps ? Which file do you then want: csv, gpx, kml, all of them ?
    Something else ? Like informations on the kind of surface ?

  • I would say wear it as you usually do, unless you usually wear it very loose so that it slides around your wrist. I know that for some (probably cheaper) watches people do say they need to wear them very tight, but that isn't what we should be aiming for I don't think.

    I will let someone who has more experience with the actual monitors answer about the format, but I suspect CSV is going to be fine.

    Information that will be helpful: which Bangle (the hardware in the kickstarter and non-kickstarter bangle 2 is slightly different), which reference device. What activity and terrain etc. might be useful but not as useful as the reference data itself.

  • Ok, thanks @myownself !

    • What about the settings in the recorder app ? I log gps every 5 seconds, more, less ? I suppose I log hr, bthr and steps, something else ?
    • in the bthr app, I use the settings:
      Use BT HRM: ON
      Replace HRM:off
      Is that fine ? I suppose other settings don't matter.
  • What we need ideally is the raw hrm signal, the accelerometer, and the values from your other hrm. I don't think we have the means to get all of this yet. I'd hold off doing any recordings at the moment. What do you say @Mi?

  • Thank a lot Fteachter for the offer - we will come back to it.
    But as @myownself said, and I wrote in the Run app thread some days ago, we are not yet ready for that. We first need to make the software and testsuite running. To see if that works some of my own recordings are sufficient. We come back to you as soon as data is the bottleneck - and then with precise format wishes since homogenity then saves effort for us.

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

PPG analysis beyond HR at rest

Posted by Avatar for Mi @Mi