vee_yar Posted February 13, 2007 Report Share Posted February 13, 2007 Respected seniors, This is my first project in Labview, and also this is my first post in the extremely active labview forum. I am trying to develope a system to monitor ECG waveform and to calculate heart rate. I am using (labview 8) DAQ 6025E to acquire ECG signal,and also I got a noise free ECG waveform on the display but I am unable to calculate heart rate from the ECG waveform.I want to display heart rate(BPM) on the front panel while the VI is running(real time heart rate display). I have attached my labview code for your referrence. Expecting suggestions from experts. Thanking you in advance Quote Link to comment
Jeff Plotzke Posted February 14, 2007 Report Share Posted February 14, 2007 QUOTE(vee_yar @ Feb 12 2007, 09:10 AM) but I am unable to calculate heart rate from the ECG waveform.I want to display heart rate(BPM) on the front panel while the VI is running(real time heart rate display). Here's a few suggestions I have for your VI: You're calculating the heart rate based on finding peaks each time this loop runs. However, this loop will execute every 0.1 sec (It's timed by your DAQ acquisition -- Continous samples at 1kHz, grabbing 100 at a time). So, right now you're assuming that you're going to find two peaks in your data each iteration of the loop... This means that you'll need a signal hooked up going at 20 Hz -- or a patient with a heart rate of at least 1200 beats per minute! (Talk about a stress test! ) What you'll want to do is to store the last peak found and store it on a shift register of the while loop, since there will many iterations of the loop without any peaks at all. You know that there will only be, at maximum, one peak per cycle, so you don't have to worry about if there's more than one. Now, for each subsequent peak detection, you can take the time of the current peak, subtract it from the value on your shift register (the time the last peak was found), and find the difference. Then, as you did, take the inverse of that time to find the frequency (altough this is in 1/sec, you want 1/min, so multiply by 60) You may also want to consider averaging the BPM you find over time. If there's some peaks that aren't detected, or if you find some extra peaks, this number will jump all over place. You'll probably want to average over the last few times to smooth it out. I've attached a quick fix I did to your VI to help my explaination... You'll of course want to clean it up -- And this doesn't look at all at the averaging issue. Quote Link to comment
vee_yar Posted February 14, 2007 Author Report Share Posted February 14, 2007 Jeff Plotzke sir, Thank you for immediate reply.I got your points and VI is working Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.