What affects the HRM?

Posted on
  • The heart rate monitor in the bangle2 doesn't give realistic data, so (being a curious person) I'm trying to understand how it works and what the problem is. I understand the HRM is affected by movement, but I can't find more details how the algorithm works and what kind of movements are the issue.

    I also have a Garmin watch which I wear for testing on the other arm, and this generally gives realistic values. They don't match the data from a belt exactly, but are generally in the right range and go up during exercise etc.

    But the Bangle HRM really only gives realistic values when I'm totally at rest. In particular, when cycling the measured HRM mostly just jumps around and I even get totally mad rates like 30 when it should be around 150.

    As I understand, the HRM is essentially a Photoplethysmograph, so it measures the reflected/scattered light from the LED which is modulated by the blood flow and other factors.

    I guess then the algorithm tries to find the peaks in the scattering and determine the dominant frequency. Is this simply counting the peaks, or does it do some kind of Fourier analysis?

    Movement can easily produce artificial peaks, but do we understand the mechanism a bit better? Is it the movement of the sensor against the skin (so that different parts of the skin are measured), or does movement and vibrations change the actual blood flow at the wrist?

    I noticed two particular things:

    1. When cycling, my hand is not really moving much as it's on the handle bar, so are just the vibrations from the road enough?

    2. I tried to stop a few times, waited a minute and hold the hand very still, but the HR is still almost random. How long does the monitor typically to take good measurements? Or is there something else going on that it doesn't handle higher HR very well?

  • Hello, its basically a bandpass filter followed by a peak detector.
    Definitely much room for improvement. After looking into it and getting an overview I wrote a summary here (including links to the code and a quick experiment to visualize):

    Unfortunatly had to stop due to time issues, but plan to come back soon.

  • Thanks! I had not seen that thread, sorry.

  • No problem.

    How long does the monitor typically to take good measurements

    There is a median filter at the end (of 8 measurements if I remember right).
    So it should forget history after time of 8 measurements + FIR lenght right now.

  • I think the above is a pretty good write-up, but just to mention here there are a few factors that delay getting good readings...

    • The main one is just the pressure of the watch against your skin - during acceleration that will change, and will change the reading.
    • However if that reading changes too much the HRM sensor will adjust its exposure to compensate - and if that happens when movement stops it can take a few seconds for exposure to readjust (exposure compensation could be disabled during periods of high movement).
    • Then there's the median filter. Generally we do just give you whatever reading we can get, but after a lot of bad data as mentioned it'll take at least good 8 readings I think before all the bad ones drop off

    The algorithm can definitely be improved (although I have tried a few different methods already), but a few people have said they'll look into it and sadly there hasn't been anything yet. I did make a repository containing a test harness and data (see http://forum.espruino.com/conversations/­373033/#comment16554946) so that could be a good starting point as you can run that just on your PC so can easily make changes and debug it

  • I'm one of the people that have looked into it. What can I say? Its complicated. Lets take an example, one of the more prominent algorithms is Troika [1]. It consists of three steps that are all computationally expensive that together you can not run on the Bangle, e.g. I do not want to wait 5 seconds to analyze one second of data. I have not given up on this, there are still some papers to read for me. But I'm not a signal analyzing expert also I'm not doing this as main job.

    What would be really awesome is having a master student working 2 years on this and writing his thesis implementing one algorithm.

    [1] https://www.researchgate.net/publication­/265599501_TROIKA_A_General_Framework_fo­r_Heart_Rate_Monitoring_Using_Wrist-Type­_Photoplethysmographic_Signals_During_In­tensive_Physical_Exercise

  • This is the other part of the problem: This is a fft in BPM of the PPG sensor of the Bangle 2 (similar for Bangle 1) without motion 8s after starting the sensor. As you can see, there is a spike at < 30BPM, 47BPM and 81BPM that hide the real heart rate at 71BPM. At gets a bit better after 10s or so, but the noise more less comes back.

    1 Attachment

    • bpm.jpg
  • Yes, the issue is not so much extracting the actual beats from the signal - it is discounting the noise caused by movement.

    If you're running and moving your hand backwards and forwards at 1 Hz, if you ignore acceleration, you're realistically always going to report 60 BPM, because that is the dominant repeated signal in the data.

    I did in the past have some success with an autocorrelation based approach, and potentially the autocorrelation could just discount any signals where the acceleration was out of range). The downside (much like FFT) is you still don't get 'realtime' data

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

What affects the HRM?

Posted by Avatar for StephanM @StephanM