Biomedical User Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Poor man's ECG acquisition and analysis

Hey Everyone,

S.E.Johnson recommended I start a discussion here about my "poor man's" system for acquiring and analyzing ECG.  This was done in rats, but I think it would extrapolate well to humans, and is certainly cost effective.  Please note, I am definitely not an experienced Labview coder, so don't judge me based on my code.  I also have no experience in circuit design or signal analysis.  I'm doing this by the seat of my pants with help fro ma friend of mine and from these forums.  If you have any suggestions, I'm definitely up for hearing them.  Here goes:

Acquisition:

I designed and constructed a simple instrumentation amplifier, which included 2 inputs (= & -) and a ground.  The inputs went on either side of my subject's check, with the ground placed on the lower torso.  I'd be happy to share the circuit design with anyone.  Just send me a private message.  It worked great on the rats, and astoundingly well on human test subjects.  The total cost of the board and components ran about $15-$20.  The amplifier output went to a USB-6210 DAQ we had in the lab, but pretty much any DAQ will do, with the signal recorded at 1.25kS/s.  The data are saved as tdms for later analysis.  I've uploaded my recording vi for anyone to use or edit as they see fit, as well as some sample data.  For my application, I needed to record the ECG of 4 animals simultaneously for 3 hours, in 10 minute bins, so the vi is designed specifically for that application.  It's not entirely flexible, but it works.

Analysis:

This got to be a little tricky.  I had a lot of motion in my subjects, so I needed a way to account for that as well as baseline drift and non-motion noise in the signal (electrical, etc).  I did this through a series of filters (a band-stop to remove electrical noise, and bandpass to remove signal drift and further reduce noise).  I'm not set on these filters, so if you have any thoughts on them, please don't hesitate to comment.  You can check out the specifics in the second uploaded vi. I don't have the Advanced Signal Analysis Toolkit, so I'm stuck using the basic filters included in Labview 2009 (this is the poor man's version after all).  As I said above, I have zero experience in signal analysis, so help me if you can. 

For my application, I was most interested in the average heart rate and R-R interval across the 10 minute bin, so my analysis has been catered to those measures.  In short, I used the available Peak Detection.vi to find my peaks after manually setting a threshold.  Once the peaks were identified, the intervals between those peaks were calculated and that's what I used for analysis.  However, many of the peaks detected this way were the product of motion, etc, so I had to find some way of eliminating these from the pool.  I did this by using a simple outlier test of all the intervals I collected (if the interval deviates from the mean interval by more than 1.5 times the standard deviation, it is excluded).  This culled the excessively long and short intervals from those collected.  I then took the mean interval for the 10 minute bin (excluding the outliers), and extrapolated from this how many beats would have occurred per minute.  Unfortunately, due to the manual threshold selection, the data I get from this method is highly variable.  I welcome any suggestions to make this less so.

So, there you have it.  For about $20 and an old DAQ, you too can have beautiful ECGs like these:Sample ECG.jpg

0 Kudos
Message 1 of 5
(7,774 Views)

Hey,

Good work!

I have several questions:

  1. Why you use 1.25KHz sampling rate? Maybe you could decrease it for small size of TDMS file.
  2. The file you attached here contains only 800ms signal. You could attach a sample file in which you find it is difficult to find all the R peaks. I could have a try using the Biomedical Startup Kit

Thanks!

ZJ Gu

0 Kudos
Message 2 of 5
(4,031 Views)

I just want to let folks know that my NDE Wave & Image Processor developed at NASA is very applicable for further in-depth medical signal analysis.  It incorporate routines from the NI  Advanced Signal Processing and Vision toolkits, as well as my own algorithms.  I have a large manual available that explains how to use it.

Here are some links if you are interested, with the download site.

http://www.google.com/search?q=nde+wave+and+image+processor&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:e...

Sincerely,

Don

Message 3 of 5
(4,031 Views)

Thanks for posting this!

0 Kudos
Message 4 of 5
(4,031 Views)

thanks for your sharing~

0 Kudos
Message 5 of 5
(4,031 Views)