Life Science

Showing results for 
Search instead for 
Did you mean: 

Heart rate variability and heart rate

Hi Friends,


 I am working on a project for measuring Heart rate variability and heart rate using contactless coupled ECG which has active sensors for measurement of ECG parameters in car seat integration. I am acquring real time measurement from my data acqusition device which has a sampling rate of 1k, and no of samples is 5k, ie I am measuring for a period of 5 seconds. I want to display Heart rate in beats/min and then find heart rate variability ie the distance between two R-R peaks and plot them.


I adopted the same method as mentioned in one of the article-- Labview for ECG signal processing,  I am not able to get heart rate correctly. Kindly have a look at my attached vi, where I have my sample data and also data from a conventional ECG.


Thank you,


0 Kudos
Message 1 of 8

Your main problem was that you didn't set a threshold for your peak detection, so it defaulted to 0.0


I have attached a mod where I add a Hilbert transform function to generate an analytic signal of the ECG.  This gives you the envelope of the ECG which will be easier to use peak detect on.  Also I found the max value of each data segment and set the threshold to 50% of that value.  Everything else looked good.




Randall Pursley
0 Kudos
Message 2 of 8

Dear Mr. Pursley


Thank you very much for mod vi, now the algorithm is working absoulutely fine with the conventional ECG it varies around 70-80 beats/min which is very good, but for my real time measurement using DAQ acqusition, heart rate is continously varying it goes into negative values and then reads values above 1000 beats/min soemtimes which is wrong. What do you think can be the problem with my real time data. I am using Hi-speed USB carrier DAQ Ni USB-9162 to acquire real time data. and my sampling rate is 1k and no of samples is 5k.


My second question is how can I mesure the distance between two R-R intervals, ie distance between 2 R-R peaks and plot them as frequency spectrum, as that is my aim to find heart rate variabilty and display both heart rate and HRV in numbers.




0 Kudos
Message 3 of 8

Can you post some of your acquired data so I can see what it looks like?  I would like to see how noisy it is.


I do not know alot about HRV, but there seems to be several sources out there for it.  I know of one company that makes software that does just what you want (well, maybe).  It looks like NI may have some software that they will provide upon request.  See links below.


NI HRV info


Mindware Technologies




Randall Pursley
0 Kudos
Message 4 of 8

I have posted my acquired data here, I have tried a method to calculate R-R intervals in this, I dont know if this is the right way or is it correct. Kindly look into it.

I downloaded the HRV startup kit from NI, but I dont know how to use that in my vi, according to my requirements. I could not get much help from the HRV start up kit.




0 Kudos
Message 5 of 8

The data sets you sent me are of very poor quality.  It will be very difficult to extract ECG out of them.  I was able to see some repetitive signal from 25 s to 75 s in the first lvm file but it didn't really look like ECG data.  I could not see any repetitive signal at all in the second lvm file.  I could only see them when I took a look at the signal after the notch filter.  By the time the signal went through the wavelet functions, it was completely gone.


If I were you, I would create a data acquisition function that just displays the output so can try to improve the signal.




Randall Pursley
0 Kudos
Message 6 of 8
Can you tell us more about the signal conditioner or amplifier you are using before the data acquisition system that you are using? 
0 Kudos
Message 7 of 8

My signal conditioner before data acqusition is as below. 


Capacitive coupled Electrocardiography: The technique uses electrode plates to couple capacitively to the body skin through clothes. Two signals from A1 & A2 are fed to

a differential amplifier to remove common mode signals and to amplify the differential signal. Amplifier A3 and its associated components present a so called driven seat

circuit arrangement to reduce noise. I have used an ultra low input bias current instrumentation amplifier INA116 from Texas Instruments that has very high input resistance (1015 Ω) and the lowest input capacitance (0.2 pF) to cope with the signal attenuation.

Differential Amplifier :A FET-input, low power instrumentation amplifier INA 121 from Texas Instruments is used here because it has a high CMRR of 106 dB and the gain can be set with only one resistor. Body works as an antenna and couples surrounding noises. So to reduce the noises, driven seat circuit is used.

0 Kudos
Message 8 of 8