EKG analysis / filtering

edited February 2015 in Software
Hey guys,

I'm learning the OpenBCI system and was hoping to start by completing a project using the OpenBCI system. 

Here's what I'm trying to do: obtain EKG data and determine the heart rate of the individual. 

Ideally, this would work in real time. I just want to complete something that has a easier setup and much more reliable signals. If anyone has any particular suggestions on how to proceed or any cautions, please let me know! More importantly, do you suggest building on the available GUI or coding something new?

Thanks!

Comments

  • brainbrain Canada
    edited February 2015
    @jaimze Two options for getting your  heart-rate in real time can be found in this BrainBay design: http://neurobb.com/t/heart-rate-detection-in-brainbay/28

    Brainbay is an open-source neurofeedback and signal processing application that has a driver for the OpenBCI. You can find more information on BrainBay’s website, download the latest version from GitHub, or check out William Croft’s tutorials on getting BrainBay set up with OpenBCI. (If you haven’t done an EKG with the OpenBCI, I  wrote a tutorial about it).


    It’s windows-only software, but I’m running it on Linux using Wine and will post a tutorial about that shortly. Once you’ve fiddled with BrainBay a bit, give the heart-rate design I linked a shot. The default BrainBay hear-rate designs didn’t work for me, but that one did.

    Good luck!
    Omphalosskeptic
  • Hi Jaimze,

    I've used OpenBCI to record EKG (or "ECG", depending on whether you like the German or the Latin):


    As Omphalosskeptic suggested, BrainBay can be a good choice.  But, if you really want the satisfaction of home-brewing your own algorithms, I think that's totally cool, too.

    To get started with your own algorithms, I would recommend that you NOT jump immediately to real-time processing.  I would start with simply recording your ECG signal and then spending some time playing around with different signal processing approaches through post-processing.

    If you use the OpenBCI board with the Processing GUI, it automatically logs all of the data to a data file.  So collecting the data is easy.  Once you've got the log file, now you can start playing around with the data.  Do you do Python or Matlab or Octave anything?  If so, open the data file and start making some plots.  Often, each heartbeat can be detected simply by finding when the signal crosses a fixed voltage threshold.  Sometimes, your processing needs to get more complicated.  If you can make plots, I can help with the algorithms.

    Good luck!

    Chip
  • Thanks Omphalosskeptic and Chip!

    I am looking into the BrainBay, and I think I will definitely use it sometime. At the moment, I am thinking using a home-brewed algorithm (on Python). EKG signals seem much more consistent and strong, so I was wondering if I even needed to process the data that much (using something like FFT). Right now, I'm thinking of an algorithm like the following:

    -finds the typical strength of the QRS complex peak, allowing to find such peaks
    -Calculating the time between peaks and thus getting heartbeat.

    At the moment ^this is super rudimentary, so any suggestions with algorithms would be helpful!


  • Hello,

    I am looking through the GUI code to try to understand the processes a little more, but it would be great if anyone could explain the algorithm that filters the raw data to the data you see on the display graph. In other words, how can I get the data seen on the graph (in uVrms) from the raw data (in uV)?


    Thanks,
    jaimze
  • Sorry, for intruding in this old post. 
    I was interested in the heart rate calculation via BrainBay however the link the file listed in that forum http://neurobb.com/t/heart-rate-detection-in-brainbay/28 is dead.
    Is any copy of that file exists. Please share so that other's can benefit from the same.
    Regards,
  • wjcroftwjcroft Mount Shasta, CA
    You can contact Isa @brain, by clicking on his bold user name, then using the Message button on his profile. Isa and Adam @AdamM are the owners of the NeuroBB site.
  • brainbrain Canada
    Thanks @wjcroft.

    @BioPotential: replied via P.M. I’m working on tracking down a copy of that .con file :)
  • brainbrain Canada
    @BioPotential Adam located a copy of the .con file! Download link in the
    NeuroBB thread should work now: !https://neurobb.com/t/heart-rate-detection-in-brainbay/28
  • Thanks, Thanks and many thanks to @brain, @AdamM and also @wjcroft.

Sign In or Register to comment.