offline heart rate extraction from ECG signal

Post Reply
mbinder
Posts: 3
Joined: Sat Aug 09, 2008 4:12 pm
Location: Poland

offline heart rate extraction from ECG signal

Post by mbinder » Sat Aug 09, 2008 5:14 pm

I have acquired raw ECG signals with EXG electrodes and now I'd like to extract /convert them into HR values.

Do you know any NI VI or any easy-to-implement algorithm for an offline HR data extraction from analog ECG data acquired with BioSemi ActiveTwo?

Any help greatly appreciated! :)

Marek

Coen
Site Admin
Posts: 904
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Post by Coen » Mon Aug 11, 2008 6:23 pm

A VI to calculate the heartrate from 2 EX channels is available for download from http://www.biosemi.com/download/Heartrate.vi , I have written this VI a few years ago for online heartrate calculation (was included in some custom versions of ActiView), but you can of course use it in off-line applications just as well.

Best regards, Coen (BioSemi)

Pascal
Posts: 1
Joined: Wed Apr 20, 2011 10:22 am
Location: Uni Bi

Post by Pascal » Wed Apr 20, 2011 10:43 am

Hello,
I had quiet the same question as mbinder. I acquired ECG signals and are now trying to calculate them into HR values. Since I never used Labview before, I have some problems in reading and usign the VI. Is there a "how to" or sth similar I could use.

kind regards
pascal :)

Teuniz
Posts: 32
Joined: Wed Feb 06, 2008 9:42 am
Location: Neverland

Post by Teuniz » Fri May 04, 2012 7:21 pm

You can also use EDFbrowser to extract heartrate values from raw ECG-data.

http://www.teuniz.net/edfbrowser/

echoinsist
Posts: 5
Joined: Fri Nov 25, 2016 6:36 pm

Re: offline heart rate extraction from ECG signal

Post by echoinsist » Wed Jan 04, 2017 5:28 pm

Hi Coen,
The HR value you mentioned is heart rate variability? and how to use the VI to extract? Thanks in advance.

Best,
Qian

liming
Posts: 5
Joined: Wed Jun 21, 2017 8:09 am

Re: offline heart rate extraction from ECG signal

Post by liming » Tue Apr 17, 2018 11:57 am

Hi
I am using EX8 electrode and CMS,DRL as reference to get my ECG data. However, i had some problem. The ECG diagram is good and R peaks were obvious in Actiview Two but when i receive the voltage data by c++ algorithm ,it seems not so clear,such as -35768, -25674,- 9.25596e+61,3.4825567e+06. As far as i know, the ECG voltage ranges from -0.6 to 0.6 mv. How could i get the correct data?
This is my c++ code acquiring ECG data from Actiview Two:
(32+8EX channels,256Hz)


buffer_idx = 0;
char data[MSGSIZE];
recv(sock, data, MSGSIZE, 0);

for (int channel = 0; channel < (32 + ; ++channel){
complex<double> sample[40];
double samp[40];
for (int m = 0; m < 2; ++m){
int offset = 3 * (m * (32 + + channel);
samp[channel] = (data[offset + 2] << 16);
samp[channel] += (data[offset + 1] << ;
samp[channel] += data[offset];
sample[channel] = samp[channel];
A[channel].push_back(sample[channel]);

Look forward to your reply.

Coen
Site Admin
Posts: 904
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: offline heart rate extraction from ECG signal

Post by Coen » Tue Apr 17, 2018 2:25 pm

ECG/EEG/EMG is measured BETWEEN two (or more) electrodes. The signal of a single electrodes with respect to CMS (raw, unreferenced) is not a valid signal, see

https://www.biosemi.com/faq/cms&drl.htm
viewtopic.php?f=1&t=33&p=86
viewtopic.php?f=1&t=40&p=109
viewtopic.php?f=1&t=177

So, for ECG use (at least) two electrodes on the chest and subtratc the signals in sofwtare.

The scaling for active electrode systems is:

32-bit words from USB-reciever: divide by 8192 (32*256) to convert to microVolt
24-bit words in the BDF file: divide by 32 to convert to microVolt

Note: custom systems for passive electrodes have 1/4th of the above gain (divide by respectively 32768 and 128)

Note that the system uses a DC amplifier. Therefore, the ECG/EEG/EMG signal is superimposed on a relatively large (typically several tens of milliVolt) electrode offset voltage. Use a high-pass filter or baseline correction to cancel the DC offset and extract the biopotentials.

Best regards, Coen (BioSemi)

liming
Posts: 5
Joined: Wed Jun 21, 2017 8:09 am

Re: offline heart rate extraction from ECG signal

Post by liming » Thu Apr 19, 2018 4:22 am

Hi, Coen
Thank you for your reply! Now I am using EX7 and EX8 which are placed under my left and right collarbone to acquire ECG data. Reference electrode CMS on my left thumb and DRL on my right thumb, is that connection correct? I used c++ algorithm to get 24bits ECG data from Actiview via TCP/IP. So that is to say, i have to record EX7 and EX8 and calculate EX7-EX8,then the EX7-EX8 divided by(256*24)is final ECG(uv)?And what are the active electrodes and passive electrodes ?

Best regards,Lee

Coen
Site Admin
Posts: 904
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: offline heart rate extraction from ECG signal

Post by Coen » Thu Apr 19, 2018 1:57 pm

CMS on the center of the chest may give better CMRR, DRL can be anywhere on the body.

Divide the 24-bit results by 32 to scale the values to microVolt.

You are using active electrodes (preamp integrated with electrode), ignore the remark about passive electrodes.

Best regards, Coen (BioSemi)

liming
Posts: 5
Joined: Wed Jun 21, 2017 8:09 am

Re: offline heart rate extraction from ECG signal

Post by liming » Fri Apr 20, 2018 3:03 am

Hi,Coen
Your reply is very useful to me.One last question. In the Bipolar Leads display mode, i could see very good ECG diagram like obvious R peaks and stable T wave(row EX7 - EX8).However, in Monopolor Display mode,the diagrams of EX7 and EX8 look like noise(no obvious peaks and troughs).Nevertheless, i can only record data of mono-channel. Should i just record EX7 and EX8 respectively without considering their diagrams and use EX7 subtracts EX8 ? Do you have other online method acquire EX7-EX8 in Bipolar Leads display mode directly?
Sincerely Yours

Coen
Site Admin
Posts: 904
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: offline heart rate extraction from ECG signal

Post by Coen » Mon Apr 23, 2018 3:29 pm

You should indeed record both E7 and E8 (use the "add 8 EX electrodes" in the TCP/IP tabpage) . The noise that you see in the raw E7 and E8 signals is mainly Common Mode (same noise for both channels). When you calculate E7-E8, then the Common Mode noise is canceled out, and the ECG remains (this is what ActiView does for the bipolar leads).

Best regards, Coen (BioSemi)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest