National Instruments LabVIEW Biomedical Toolkit for Measuring Heart Beat Rate and ECG LEAD II Features

Electrocardiogram (ECG) is undoubtedly the gold method for assessing heart activities. However, the ECG machine for measuring ECG is mostly only available in health care center especially in the third-world countries. Therefore, this research proposed to utilize the product of National Instruments i.e. LabVIEW Biomedical Toolkit and data acquisition device as an alternative approach to acquire ECG features and heart beat rate (HBR). As for performances verification, the NI-LabVIEW instruments are tested simultaneously with two types of ECG machine which are Philips PageWriter TC 30 and KenZ ECG 108. The results indicated that the ECG features and HBR obtained from NI-LABVIEW instruments are agreed well with the measurements attained from both of the ECG machines. Hence, this study proved that NI-LabVIEW instruments are highly potent for measuring ECG features and HBR. Moreover, the computerized NI-LabVIEW instruments with the self-interpretation function can always outperform most of the conventional ECG machines that are still required cardiologists for manually interpreting the results printed on the ECG paper.


Introduction
Human cardiovascular system is the foundation for various physiological parameters where it consists of five major components i.e. heart, arteries, capillaries, veins and blood. Cardiovascular system can be further divided into two types of circulatory system, which are systematic circulation and pulmonary circulation [1]. These circulatory systems are behaved like a closed loop system, which is controlled by the heart. In every cardiac cycle, the cardiac cells in the heart generate bio-potential. Thus, various heart activities which also included the measurement of heart beat rate (HBR) can be determined via analyzing the generated bio-potential.
Electrocardiogram (ECG) is a graphical method established for measuring the bio-potential generated by the heart. It is considered a contact based non-invasive method because the electrodes are required to attach on the correct position of the body parts for acquiring the bio-potential signals. According to [3], three types of electrodes i.e. electrode with adhesive gel (disposable), clamp electrodes (reusable) and suction electrode (reusable) are commonly used for ECG measurement. Although ECG method has been developed many decades ago, the twelve-leads ECG system is still the gold standard for measuring heart activities in clinical units [2,3]. Among the twelve-leads ECG system, Lead II is the most preferable lead utilized for determining HBR and continuously monitoring the patient's condition because it can closely resemble the route of the sequence bio-potential generated in the heart [4,5,6]. The equipment used to acquire ECG is known as electrocardiograph or more simply ECG machine [4]. Unfortunately, ECG machine mostly only available in health care center and required well-trained health professionals to operate. Furthermore, some of the ECG machines are unable to provide continuous HBR and ECG measurements. Thence, in this research, National Instruments (NI) LabVIEW Biomedical Toolkit, which is associated with the NI data acquisition (DAQ) device are proposed as an alternative method in continuously acquiring HBR and ECG features.

NI-LabVIEW Hardware Setup
In this research, the model of NI USB-6281 DAQ device is selected for acquiring the bio-potential generated by the heart through electrodes as the sensors. According to [7], NI USB-6281 DAQ device is under categories of NI M-series, which is a multifunctional USB DAQ device that is optimized to achieve high accuracy measurements at fast sampling rates. Since NI USB-6281 DAQ device is a high accuracy DAQ device, it is able to log the voltage faster and accurately, which is essential for acquiring ECG signals. Figure 1 displays the NI USB-6281 DAQ device with its screw terminal pinouts for connecting the sensors.
The 16 analog inputs of the NI USB-6281 DAQ device either can be used as differential channels or single ended channel to acquire signals. Since the placements of the electrodes are based on the Lead II configuration to find the bio-potential difference between the two electrodes, hence in this research only two analog inputs are used to acquire the ECG signals.
This NI USB-6281 DAQ device supports three types of ground reference settings for the analog input. In this research, the ground reference setting of differential mode is selected for measuring the bio-potential through the Lead II configuration. In order to use differential mode, the input signal is required to be low level which is less than 1 V, therefore it is very suitable for measuring the biopotential generated by heart, which only consists of millivolts.
As mentioned earlier, the differential mode is used to measure the potential between two analog inputs, hence it is necessary to pair the analog inputs for differential measurements. In this study, the pair of the analog input AI 4 and AI 12 is used to record the Lead II ECG signals. AI 4 acts as the positive lead is connected to the electrode placed at left leg (LL), while AI 12 acts as the negative lead is connected to the electrode placed at right arm (RA) as shown in Figure 2.

Logger and Player Workbench of Ni-LabVIEW Biomedical Toolkit Configuration
After set up the hardware and connected the electrodes to the NI USB-6281 DAQ device, the NI-LabVIEW software needs to be configured for acquiring the ECG signals. In this study, the Logger and Player workbench in LabVIEW Biomedical Toolkit is used to log the Lead II ECG signals. In the logger setting, the user is requested to select the corresponding DAQ device used for logging the signals. According to [8], the sampling rates that are typically used for NI DAQ device to acquire raw ECG signals are either 125 Hz or 250 Hz. In this study, 250 Hz is chosen as the sampling rate because the modern ECG machines usually operate at this rate to record the ECG signals. Subsequently, the terminal configuration is set to differential, so that the DAQ device can record the potential between the two analog inputs.
The Logger and Player workbench provides various customized digital filters in the virtual channel settings for selection. If the user prefers to use analog filter to filter the high frequency of the raw ECG signals, this step can be discarded. Otherwise, virtual channel can be used to attenuate the high frequency noises. In order to set up the virtual channel for filtering, the types of noise need to be identified. Power line interference, electrode contacting noise and electromyographic noise (caused by muscle movement) are the high frequency noises that could influence the ECG signals during signals acquisition [9]. However, among these various types of noise, only power line interference is the most significant noise that could contaminate the ECG signals during the recording process.
Power line interference is mainly caused by improper grounding, electrode cables, or nearby devices, which normally centered at high frequency of 50 Hz or 60 Hz with the narrow bandwidth of fewer than 1 Hz. Hence, in this study a virtual channel is set to filter the power line interference using notch filter to preprocess the Lead II ECG signals acquired from the NI USB-6281 DAQ device. Notch filter is selected because it is able to filter the frequencies with the narrow bandwidth of the interfering noise [10,11].

ECG Feature Extractor Workbench of Ni-LabVIEW Biomedical Toolkit Configuration
ECG Feature Extractor is one of the workbenches in NI-LabVIEW Biomedical Toolkit that is responsible to interpret the ECG waveform for ECG features extraction. There are two ways ECG Feature Extractor imports the ECG signals. The first way is to acquire the real time ECG signals by switching the toggle to the direction towards DAQ settings. Unfortunately, it is unable to save the ECG signals for future clarification. The second way is to import the files that are saved in the computer for the ECG features extraction by switching the toggle to file settings. However, it does not support the real time measurement.
Various ECG features such as R wave amplitude; QRS, PR, QT and RR intervals can be extracted using ECG Feature Extractor. To begin with, it detects the R waves in the ECG waveform and followed by other features because R waves with the highest amplitude are the easiest features to be identified. Therefore, accuracy in detecting R waves becomes very essential. In order to enhance the quality of the logged ECG signals, this workbench also allows the user sets the feature settings to filter and rectify the entire logged ECG signals. After enhancing the ECG signals, the exact locations of the R waves in the entire ECG waveform will be more obvious and distinguishable. According to [12,13], R wave normally has a frequency between 10 -25 Hz. Hence, the user can apply the digital band pass filter that is provided by ECG Feature Extractor to filter the entire ECG signals for R waves detection. Subsequently, the threshold adjustment factor is the threshold used by the workbench to detect the peak of the R wave. The default value for the threshold adjustment factor is 0.1, if this factor is set to a larger value, the R waves can be detected will reduce due to the ignoring of the R waves that with smaller amplitude. Furthermore, the rough highest heart rate is the value for initializing the internal parameter in the first several cycles for obtaining more accurate results. The default value given by NI is 60 bpm. In addition, number of beats for initialization is used to skip the R waves at the beginning of the ECG signals. The default value is 8, which means the workbench will skip 8 beats because the ECG signals at the beginning are normally not yet steady. Besides, user is required to tick the box of "remove noise from raw signal" for more accurate measurements. Lastly, the isoelectric limit is set to 0.1 mV to refine the P wave and T wave of ECG signals [14]. If the difference between the maximum and minimum amplitude within the time intervals of PR segment and ST segment is less than the isoelectric limit, it is considered as isoelectric. Figure 3 indicates the feature settings to filter and rectify the entire logged ECG signals and Figure 4 shows the filtered and rectified ECG signals.
After the R peaks are being detected, other ECG features will be extracted using the R waves as the reference. Figure 5 displays the ECG features being extracted using LabVIEW ECG Feature Extractor workbench. Besides, the HBR can also be calculated by using the average of the RR intervals [15].

Results and Discussions
The ECG features obtained from the NI-LabVIEW Biomedical Toolkit are compared with the commercial ECG machines, which are used in the health care center. In this study, two types of ECG machines (Philips PageWriter TC30 ECG machine and Kenz ECG 108 ECG machine) are used for performance evaluation. Both of these ECG machines also used twelve-leads ECG system to acquire ECG signals, while Lead II is used for ECG monitoring and HBR calculation. In order to produce ECG results that are comparable between the mentioned devices, the ECG signals are recorded simultaneously using the NI-LabVIEW instruments and ECG machines as shown in Figure 6. The evaluation process of NI LabVIEW instruments in measuring ECG involved two persons. For Case 1, the ECG test is performed simultaneously using Philips PageWriter TC30 ECG machine and NI LabVIEW instruments. For Case 2, the ECG test is done using Kenz ECG 108 ECG machine and NI LabVIEW instruments. Case 2 Figure 6. NI USB-6281 DAQ device with LabVIEW Biomedical Toolkit acquires the ECG signals simultaneously with ECG machines.
For Case 1, Table 1 shows the results comparison between NI-LabVIEW instruments and Philips PageWriter TC30 ECG machine. From the results shown in Table 1, it can be seen that NI-LabVIEW instruments show a good agreement with the results from health center using Philips PageWriter TC30 ECG machine by achieving only 1 bpm difference for the HBR measurement. Although other ECG features like PR interval, QT interval and QRS interval obtained are slightly different between NI-LabVIEW instruments and Philips PageWriter TC30 ECG machine but they are still in close range with just a maximum of 14 ms difference. This is because Philips PageWriter TC30 not only filtered the power line interference but it also has the extra function to filter the baseline wander of the ECG signals, in which the ready-to-execute NI-LabVIEW Biomedical Toolkit does not occupy this function. Baseline wander is the low frequency noise that below the frequency of 0.5 Hz. The sources for creating the baseline wander are respiration, the loose contact of the electrodes with the skin surface or movement of the subject during the recording process. Hence, there is a slight difference in the time interval of the ECG features between these two instruments. Although the ready-to-execute NI-LabVIEW Biomedical Toolkit is unable to set the baseline wander filter, but the results obtained are able to fulfill the allowable error (±20 ms), which is in ANSI/AAMI/EC13:2002 for ECG features intervals [16].
For Case 2, Kenz ECG 108 ECG machine is used to assess the NI-LabVIEW instruments in measuring ECG features. This ECG machine acquires the ECG signals using suction electrodes, hence it is not suitable for continuous ECG monitoring because the suction electrode will cause pain to the subject after a few minutes. This Kenz ECG 108 ECG machine is unable to interpret the ECG waveforms for ECG features calculation, but it does provide the HBR during the entire ECG signals acquisition process. Hence, manual calculation is required in this case to extract the ECG features from the ECG waveforms printed on the ECG graph paper. In order to assess the performance of the NI-LabVIEW instruments, the ECG features are calculated from the Lead II ECG waveform and the results are listed in Table 2. In this case, the CMS 50D+ pulse oximeter also measures the subject's pulse rate simultaneously as shown in Case 2 of Figure 6.
From the results shown in Table 2, the HBR for Kenz ECG 108 ECG machine and NI-LabVIEW instruments also 72 bpm, while other ECG features time interval are able to satisfy the allowable error (±20 miliseconds) stated in ANSI/AAMI/EC13:2002. Again, it shows that the results obtained using NI-LabVIEW instruments show a good agreement with the commercial ECG machine that are used in health care centers. As a conclusion, NI-LabVIEW Biomedical Toolkit associated with the NI USB-6281 DAQ device can be used as an alternative method to acquire, process and analyze the ECG signals for various ECG features and HBR measurements. Furthermore, the pulse rate obtained using CMS50D+ pulse oximeter is also agreed well with the HBR obtained from Kenz ECG 108 ECG machine and NI-LabVIEW instruments. The difference is only 0.7 bpm for this case.