04-29-2019 08:38 AM
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.
04-29-2019
10:11 AM
- last edited on
12-19-2024
10:28 PM
by
Content Cleaner
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).
04-29-2019 10:16 AM
@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:
Bob "Can't See What You Don't Attach" Schor
[I "borrowed" this from RTSLVU's Signature]
04-29-2019 10:35 AM
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)
04-29-2019 10:41 AM
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
04-29-2019 11:17 AM
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" > ...
04-29-2019 11:47 AM - edited 04-29-2019 11:49 AM
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
04-29-2019 12:08 PM
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
04-29-2019 12:30 PM
UPDATE:
I wired it into the circuit and it does not work. I am back to square one.
Please help?
04-29-2019 03:55 PM
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.