HRV Heart Rate Variability algorithms

edited March 2015 in General Discussion
Hi, I'm interested in measuring heart rate variability. I used OpenBCI with an innovating thinker Alex Doud at a codeathon and was super impressed about how much functionality OpenBCI gives you out of the box. However, I'm interested in measuring the heart's electromagnetic output as an indicator of emotional/psychological/coherence state (how do you feel to put it bluntly). 

Does this technology lend itself well to changing electrodes and measured frequencies so I could measure the heart instead? 

If not, have other people worked in this space and can anyone give me some tips to learn more? I've been working with HeartMath and they are doing some super cool things, now I want to develop a new technology or algorithm that measures momentary coherence - anybody interested give me a shout! 

Adam
adammoen.me 

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Adam, hi.

    This pdf explains how the HeartMath emWave devices compute the "coherence" level / score.


    Basically you want to find the IBI inter beat intervals in milliseconds, and then do an FFT on the resulting HRV wave. The coherence score is then computed as shown in the paper. I'm assuming you want to replicate the HeartMath computation, then perhaps branch out from there.

    There are some other apps that don't do it this way at all,


    They compute something called rMSSD, again from the IBI's.



    William
  • wjcroftwjcroft Mount Shasta, CA
    Also see the docs.openbci.com section for how to setup your electrodes to operate better in the ECG voltage range (millivolts), vs. EEG (microvolts). It's just some settings in the OPENBCI_GUI control panel.

    Another way to do this is with Joel's Pulse Sensor,

  • Wow, super cool stuff! Thanks William. I'm looking into it now and will get back to you soon! I've also got some sick research from Rollin McCraty at Heartmath on heart rate variability and the coherence project if you are interested in this stuff! 
  • wjcroftwjcroft Mount Shasta, CA
    I've used the emWave technology for years, great tech. Rollin is the best. A real hero of bringing science and evolution / spirituality together. My own work is involved with heart-intelligence and "transformative technology" as well, http://lightfield.com/nf.htm .
  • biomurphbiomurph Brooklyn, NY
    @wjcroft thanks for the plug ;)
    I did put together a basic introduction to HRV, with a bit of a bibliography. 
    There are three pages, linked from this first page
    I have heard, 'tho I'm not a scientist, that a large amplitude in IBI (large range of HRV) corelates with increased alpha waves.
    I'd be interested to know if that is the case...
  • Any thoughts of adding pulse sensing to OpenBCI?
    Seems like it would be pretty easy to add the sensor to the earclip.
  • wjcroftwjcroft Mount Shasta, CA
    Jake, are you talking about using the PulseSensor with OpenBCI? Such as connecting the PulseSensor into the OpenBCI GPIO pins? OpenBCI already does great with just plain EKG, such as the docs tutorial shows at the wrists. (Using reduced gain factor.) You can use snap connector pre gelled foam electrodes on the chest as well.

    A lot of EEG setups use the ear lobes for reference or ground connections. I guess you could multiplex both the ground (bias) function and the PulseSensor on one ear lobe. Might be some increased noise though. Definitely would not want to multiplex it with reference.
  • The pulse sensor is only using light, so I would guess there would be no major problems with using pulse sensor on one side of the ear clip and electrode on the other.  They would be on two different circuits, not even sharing the same ground.
    AgCl is light reactive, but I'd guess that a steady light source like the pulse LED might not cause any problems.

    Do you see any specific problems with that type of setup?  Just seems pretty handy to me and would be easy enough to implement with the existing hardware.
  • wjcroftwjcroft Mount Shasta, CA
    The pulse sensor has a spring ear clip built into it. So the ear lobe you put it on has essentially both sides covered. Circuit board on one side, and ear clip on the other. You could alternately use the pulse sensor on a finger held with velcro.

    Most OpenBCI users who use the ear lobe for bias or reference, use a gold cup electrode with Ten20 paste and possibly some tape to hold it in place. It's always recommended not to mix electrode metals, because of potential battery effects.

    But I'm recalling now that you are doing EMG and not EEG, so likely have nothing else on the ears.

    If you have an extra channel (+ and -) it would be easiest to just measure the direct EKG. Actually the electrical EKG signal is somewhat more accurate for HRV measurements than the plethysmography based systems. The HRV technology used in sports training and conditioning generally uses a chest strap because of the increased accuracy. And less movement artifact. Plethysmography works better when you are relatively still.
  • Although it doesn't directly apply to my research I am interested doing some EEG work for fun.  Pulse just seems like something really easy and fun to add.  There are quite a number of pulse sensor boards on ebay for $1-4, so it seems a worthwhile feature to add.

    Clips are easy enough to build, so I can't imagine it would be difficult to put ref and pulse on opposite sides of the clip.  OTOH it would be easy enough to just clip the pulse on the other ear or finger as you mentioned.

    I don't expect much interesting with EMG, but it might be interesting to look at if the pulses affect MUAP waveform.  I would think there might be some small effect, probably causing a little extra high pass filtering due to the distance increase.  I'm actually curious to see if this would even be significant enough to measure now.

    There's some other applications where it might be interesting to have pulse data, such as pulse wave velocity measurements.

    I'm working on constructing some high density electrode arrays while I wait for parts, and I just thought it might be worthwhile to order a bit of gear for pulse measurements also.

    I thought it might be interesting to do a full SpO2/pulse setup, but then again I don't think that SpO2 would really be all that interesting.  Do you think that different breathing techniques would have much effect on SpO2 or if that would be valuable for feedback in any way?

    There are lots of cheap units on ebay, but having the data integrated into the stream or at least having meaningful feedback would be pretty essential.  I don't think doing breathwork while staring at a LED readout on your finger would be very fun in the long term.
  • wjcroftwjcroft Mount Shasta, CA
    Don't have any experience with SpO2. Breath cycle DIRECTLY effects HRV. HeartMath's emWave tools incorporate visual or LED breath pacers for getting started building what they term 'coherence'. See previous pdf link. If you want the tightest integration of your EEG / EMG signals with the EKG, I'd use the stick on foam electrodes and a spare channel on your ADS1299.
  • biomurphbiomurph Brooklyn, NY
    Just want to add that we have really good results using OpenBCI for EEG on 7 channels, and then a single channel (differential) for ECG. The ADS1299 input muxer allows for assigning different gain to each channel, and then we separate the ECG channel from the BIAS generation and the SRB. The signal separation between the channels is excellent.
  • Collecting raw ECG data is very easy with OpenBCI.  For example, I've done it:


    and Autodidacts has done it:


    The part that is missing is any real-time algorithms for detecting each heart beat (and the associated heart rate variability) from the raw ECG data.  

    Chip
  • wjcroftwjcroft Mount Shasta, CA
    Here's a related post, where @brain mentions a link to a Brainbay ECG pulse detector design,

    http://openbci.com/forum/index.php?p=/discussion/316/ekg-analysis-filtering

  • I think you must mean EKG?
  • ECG and EKG are the same thing..."electrocardiogram".


    Chip
Sign In or Register to comment.