Cart | Help
 You are here: NI Home > NI Developer Zone > NI Discussion Forums Select Community English Français Italiano 日本語 한국어 Español 简体中文 繁体中文 Português (BR)

## Life Science

Active Participant
Posts: 958

# Re: Analysis of ECG signal

It should be the same.  Try putting your t0 and dt value into the properties of the graph (offset and mulitplier) and see if it looks OK.
Randall Pursley
Member
Posts: 3

# Re: Analysis of ECG signal

2. Perform a Hilbert Transform of X to get Y

Randall Pursley

Hi Randall, can you explain better the function of the Hilbert Transform in your code ? I doens´t understood the step 2 above.

Eduardo Alvarenga

Active Participant
Posts: 958

# Re: Analysis of ECG signal

The Hilbert Transform takes a signal (which, by definition, is made up of sinusoidal components) and changes the sines to cosines and vice versa.

The most basic case is if you input a cos(x), the output of the Hilbert transform is a sin(x).

Another way to explain it is if you look at your signal in the frequency domain, the Hilbert transfrom changes the sign of the spectrum on the negative side of 0 Hz.

The reason I use it here is to turn the ECG signal into an analytic signal using the Hilbert transform.  The magnitude of which is the envelope of your original signal.  The envelope of the signal gives a better peak that is easier to detect.

The most basic case is the cos(x).  The Hilbert transform result is a sin(x).  The analytic signal would be y=cos(x) + jsin(x).  And, of course, the magnitude of this would be one.

Hope this helps.  There is plenty of info on the web on Hilbert Transforms and analytic signals.
Randall Pursley
Member
Posts: 3

# Re: Analysis of ECG signal

thanks Randall... this helps me a lot

Member
Posts: 8

# Re: Analysis of ECG signal

[ Edited ]
can someone tel how  BPM is calculated in EKG processor.vi.i am not able to understand.here
waiting for help

Message Edited by iam on 03-18-2008 04:22 AM
Member
Posts: 189

# Re: Analysis of ECG signal

Hi iam,

rpursley8 explains how to calculate the beats per minute in the first page of this discussion forum. Here is what it says about how the EKG processor.vi calculates the BPM:

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.

If you have more specific questions about certain parts of the calculations, please let us know!

Carla

National Instruments
Applications Engineer
Member
Posts: 6

# Re: Analysis of ECG signal

Hi,

Instead of generating a ECG signal, can I use a real ECG signal-using same technique to calculate the Heart rate-Peak detection.

I substituted the Waveform.in to a DAQ Assistant and obtained a mismatch error. Can you please correct me...

I appreciate any help.
Member
Posts: 133

# 回复： Re: Analysis of ECG signal

You can read the following app notes for more help on HRV detection and analysis.

http://zone.ni.com/devzone/cda/epd/p/id/5832

Member
Posts: 19

# Re: Analysis of ECG signal

Hello

I tried to compare the result of the beat per minute to constant number; To use the output and activate a case containing an alarm but since the output is array of Boolean there was an error in the wiring. Is there a way to compare the beat per minute and get a Boolean output?

I attached the VI

Thank you

Knight of NI
Posts: 10,167

# Re: Analysis of ECG signal

[ Edited ]

Please continue the discussion in the original thread and do not hijack other threads with a new topic.

Thanks,

RayR

Message Edited by JoeLabView on 06-22-2008 01:30 PM
.
(starting to) See Life in a brand new way...

b* ^ )