LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ECG beats per minute help please

Hello all,

I posted this a few days ago but I think I posted in the wrong section because I received no replies.

I am a senior at Purdue University. I have a project for a class that I am working on that I need some help with. I need to make a functioning ECG circuit and capture the waveform with the USB-6008. Then I need to make the information easy to read for the user with labview.

 

We currently have a working circuit and most of the labview works with the exception of the beats per minute of the heart rate. Can someone take a look at this and give me some advice?

We are not allowed to use the Daq assistant.

Thank you in advance.

 

0 Kudos
Message 1 of 21
(3,683 Views)

Sounds like what you need is to capture the peaks in the ECG input (did you already get this? It sounds like it, from the "working circuit and most of the LabVIEW" (;)).

 

You might find this kind of link helpful: Peak Detection. You'd then need to count the number in a given time, and work out the rate.

 

I don't know how regular you expect the pulse to be, but you can also consider a power spectrum (http://www.ni.com/example/30803/en/ ) and then try detecting the dominant frequency (and then rescale to bpm or similar).


GCentral
0 Kudos
Message 2 of 21
(3,659 Views)

@Brad750 wrote:

I need to make a functioning ECG circuit and capture the waveform with the USB-6008. Then I need to make the information easy to read for the user with labview.  We currently have a working circuit and most of the labview works with the exception of the beats per minute of the heart rate. Can someone take a look at this and give me some advice?

 

 


Some suggestions:

  • Please learn how to spell LabVIEW (hint -- it is not spelled "labview").
  • We are happy to take a look at "this", but where is "this"?  Please do not attach a picture of your LabVIEW code, but attach the actual VI (or VIs).  If you are using LabVIEW Project (and I hope you are), compress the folder containing the Project files and attach the resulting ZIP file.
  • Your instructor is doing you a great service by requiring that you not use the Dreaded DAQ Assistant.  Please also avoid its Evil Twin, the Dynamic Data Wire -- use Waveforms or plain Arrays of Dbl instead.  If you need help getting started with DAQmx, NI has some excellent Tutorials (search for DAQmx Tutorial).

Bob "Can't See What You Don't Attach" Schor

 

[I "borrowed" this from RTSLVU's Signature]

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)

 

0 Kudos
Message 3 of 21
(3,655 Views)

Sorry about that. I attached it to the other post but for some reason it did not attach here.  So here is my code. (hopefully)

0 Kudos
Message 4 of 21
(3,647 Views)

I actually got it just now.  Attached is my somewhat working code.  Thank you for the advice.  Another student in the class found the tone measurement vi.  The only issue with that is we had to up the number of samples per channel of the DAQmx read vi in order to get it to work.  Attached is my new code

0 Kudos
Message 5 of 21
(3,644 Views)

Looks like you're mostly home and dry. With regards to the input size, currently at 250Hz rate and 1000 samples you'll have 4s of data. At 60 bpm that's probably only 3 full periods, which might not be very accurate if you have a varying pulse. If you have longer data available, you can read multiple times and concatenate the data.

 

As a second comment, if you're not supposed to use the DAQ Assistant, you might also want to avoid the Tone Measurements Express VI. You can find "Extract Single Tone Information" and similar VIs under "Signal Processing" > "Waveform Measurements" > ...


GCentral
0 Kudos
Message 6 of 21
(3,636 Views)

Do you know what an EKG looks like?  Do you have a good understanding of spectral analysis and understand what Tone Measurements actually does, and if it is appropriate to the question you need to answer?  If you look at your Waveform Chart and took a minute of EKG data, would you (from looking at the Chart) be able to tell me how many Beats per Minute you had?  How did you do that?  Did you measure something or count something?

 

Bob Schor

 

P.S. -- When in doubt, apply IBM's Famous Slogan

0 Kudos
Message 7 of 21
(3,629 Views)

Bob, I will try to address your questions in order.

I assume you mean the EKG signal. If so then yes I know what it looks like.  We have our circuit hooked to an oscilloscope to verify its function.

No I do not fully understand what the spectral analysis or tone measurements are doing.

I believe we would be able to get the beats per minute from the chart.  I am currently running a signal generator on triangle wave and it works.  This is a group project and I am in charge of the programming.  The circuit will be complete shortly. We are at the school working on this as I type.  The guys working on the circuit are trimming and making it look pretty at the moment.  

 

Is there some issue with the spectral analysis / tone measurement that I will run into when we actually run it?  I could not get the peak detector to work at all.  It kept having a width fault.  That is the VI above EKG_2 

0 Kudos
Message 8 of 21
(3,620 Views)

UPDATE:

I wired it into the circuit and it does not work. I am back to square one. 

Please help?

0 Kudos
Message 9 of 21
(3,609 Views)

What circuit is that?  So far you've only talked about your LabVIEW VI.  You haven't shown us any electrical circuits yet.  That is a completely different problem.

0 Kudos
Message 10 of 21
(3,588 Views)