# Life Science

cancel
Showing results for
Did you mean:

## Analysis of ECG signal

Can anyone advice me on how to get a display and beats/min from a signal coming out of ECG???
I am receiving 3 signals from the microcontroller (after they are converted by 8 bit A/D) and one of them represents heart rate.
How can I convert that signal to display and give me a digital heartbeat/min value using labview???
Message 1 of 32
(18,120 Views)

## Re: Analysis of ECG signal

I have attached a VI that should do what you want if you have Labview 7.1 and Advanced Analysis Library.

If not, then this is what the VI does.

First you process the signal a little to enhance the R wave.

1. Take the derivative of the signal (difference function), name this signal X
2. Perform a Hilbert Transform of X to get Y
3. Combine to get Z = X + iY (complex) and take the magnitude of Z
4. This process will enhance the R wave amplitude in relation to the rest of the signal

Then you perform a peak detection to find all of the peaks and their locations.

Find the difference between the peaks to get the number of points between beats.

Divide this number by (Sampling Rate * 60) and invert the number to convert to beats/min.

The Advanced Analysis Library has the Derivative, Peak Detect, and Hilbert Transform functions used in the VI. I tried to save it as version 7.0 but it wouldn't let me.
Randall Pursley
Message 2 of 32
(18,093 Views)

## Re: Analysis of ECG signal

Randall,
Thank you so much for your quick response and attached example.
I will try that and update you on what happened.
I assume that the input signal representing the heart beat is a digital signal coming out of the microcontroller in 8 bits via a serial cable as that is the signal I am working with.
Thanks again.
Rodawg
Message 3 of 32
(18,087 Views)

## Re: Analysis of ECG signal

Randall,
Thank you so much for your quick response and attached example.
I will try that and update you on what happened.
I assume that the input signal representing the heart beat is a digital signal coming out of the microcontroller in 8 bits via a serial cable as that is the signal I am working with.
Thanks again.
Rodawg
Message 4 of 32
(18,088 Views)

## Re: Analysis of ECG signal

What I sent you would as post processing. If you want to use it as real-time processing you would have to change the functionsx to their pt-by-pt versions and it should still work with a little modification. The VI was adapted from some work I did a couple years ago in which I was processing saved data.
Randall Pursley
Message 5 of 32
(18,085 Views)

## Re: Analysis of ECG signal

Thanks again for your prompt response.
Looks like you were storing the data manually in the array you have.
Do you have any samples that I could look and use for this simulation to see and understand the logic and the vi more.
Thanks and have a great day.
Message 6 of 32
(18,054 Views)

## Re: Analysis of ECG signal

Here is a file with 30 seconds of test ECG data (60 bpm).
Randall Pursley
Message 7 of 32
(18,056 Views)

## Re: Analysis of ECG signal

Here is another VI which may do some of what you are trying to do. EKG analysis can be very complex - many papers have been published on the subject.

Lynn
Message 8 of 32
(18,047 Views)

## Re: Analysis of ECG signal

Thanks alot Randall. Appreciate your help.
Message 9 of 32
(18,028 Views)

## Re: Analysis of ECG signal

Thank you Lynn. You have helped me quite alot in my previous problems as well.
Message 10 of 32
(18,028 Views)