2 Ecg Labvew
2 Ecg Labvew
Abstract
The incidences of cardiovascular diseases are rapidly increasing worldwide. The electrocardiogram (ECG) is a test to detect and mon-
itor heart issues via electric signals in the heart. Presently, detecting heart disease in real time is not only possible but also easy using
the myDAQ data acquisition device and LabVIEW. Hence, this paper proposes a system that can acquire ECG signals in real time, as
well as detect heart abnormalities, and through light-emitting diodes (LEDs) it can simultaneously reveal whether a particular waveform
is in range or otherwise. The main hardware components used in the system are the myDAQ device, Vernier adapter, and ECG sensor,
which are connected to ECG monitoring electrodes for data acquisition from the human body, while further processing is accomplished
using the LabVIEW software. In the Results section, the proposed system is compared with some other studies based on the features
detected. This system is tested on 10 randomly selected people, and the results are presented in the Simulation Results section.
Keywords: Electrocardiogram Signal Processing, NI myDAQ, NI LabVIEW Software, Data Acquisition, ECG Feature
Extraction
Most people assume that wellness, which actually entails taking muscles that are measured by small electrode patches that are
care of ourselves, indicates the absence of illness. In recent years, attached to the human body, specifically on the skin of the arms,
a drastic change has been experienced in the lifestyle of people chest, and legs. ECG signal processing mainly includes three
worldwide in reference to the shift in their gastronomic patterns steps: 1- ECG data acquisition; 2- Signal preprocessing; and 3-
from consuming healthy to street foods and transitioning from fit Feature extraction. Cardiac cells are the muscle cells that form
to fat. This habit has increased the risk of many maladies, chief heart muscles [2]. These cells are electrically polarized in the
among which are cardiovascular diseases (CVDs). normal state, and their insides are negatively charged. The
With the loss of an estimated 17.9 million lives per year, CVDs fundamental electrical activity of the heart is depolarization,
are the primary cause of death globally. The menace of CVDs whereby cardiac cells lose their negativity. Depolarization occurs
remains escalating, with more than 75% of these deaths occurring from cell to cell, building a wave of that can be transmitted across
in developing countries [1]. CVD does not connote a single the whole heart. This depolarization wave builds an electric
disease, but it is an illness that includes all the issues related to the current flow, which is detectable through the use of electrodes.
heart and blood vessels of an individual. Some of the diseases Upon the completion of depolarization, cardiac cells return to their
under the umbrella of CVDs include arrhythmias and normal polarity through a process called repolarization, which is
congestive heart failure. Although there are several approaches to also identifiable by the electrodes [3]. When acquiring ECG
detect these types of disease, the most commonly used method is signals, some noise-like baseline wandering, powerline
interference, and noise due to electrode movement also develop.
Thus, we need to denoise (preprocess) the signal before using it
Department of Electronic Engineering, Daegu Universtiy for feature extractions, and the parameters responsible for this are
Daegudaero 201, Gyeongsan, Gyeongbuk 38543, Korea
+
Corresponding author: [email protected] the PR interval, PR segment, QRS interval, and ST segment [4],
(Received: May. 22, 2020, Revised: May. 30, 2020, Accepted: May. 31, 2020) as shown in Fig. 1.
This is an Open Access article distributed under the terms of the Creative
ECG results tell us about the heart rate and rhythm and inform
Commons Attribution Non-Commercial License(https://creativecommons.org/ us whether or not there is an enlargement of the heart due to high
licenses/by-nc/3.0/) which permits unrestricted non-commercial use, distribution,
blood pressure (hypertension) or if there is any evidence of a
and reproduction in any medium, provided the original work is properly cited.
previous heart attack (myocardial infarction) exists. ECG at rest is
software to use it practically. The algorithm used herein is shown some noise. This can be baseline wandering, channel noise, or
in Fig. 6 which contains the steps that are used in the algorithm as motion artifacts, for example [14]. Baseline wander is a low-
follows: frequency noise that occurs due to body movement and respiration
[15]. It creates problems in detecting peaks in the signal,
3.1. Acquire ECG Signals especially R-peaks that are very important for the interpretation of
the ECG signal. Herein, to remove these kinds of artifacts/noise
In the first step, ECG Signals are acquired from the individual’s “Wavelet Denoise” is used, and to remove the baseline wander,
body with the help of sensors and myDAQ device. The LabVIEW eliminating the trend of the ECG signal is necessary. For
“DAQ Assistant” is used, and it is configured with the myDAQ removing baseline wander and other noises from the raw ECG
hardware device to acquire ECG signals. At the time of signal, the option for approximation is chosen as detrend,
measurement, the most important point is the sampling rate. The Thresholding rule is universal, soft thresholding is checked,
analog to digital and vice versa conversion depends on the wavelet is selected as db06, and transform type UWT
determination of the scan rate in the myDAQ device. The fast (Undecimated Wavelet Transform) is chosen. The block diagram
Herein, “Collector” and “WA Multi Peak Detection.vi” is used. Fig. 10. Raw acquired ECG signal
The collector is used to display the heart rate and its status
whether it is normal or suffering from tachycardia or bradycardia
using some more VI’s and WA Multi Peak detection.vi is used to
detect the R-peaks and display the same in the front panel.
R-peak detection is the most important part of ECG parameter
research. Herein, the Teager energy method is used, which is Fig. 11. Denoise ECG signal
based on squaring the signal amplitude. R-peaks have the highest
amplitude, which is greater than 1 mV [5]. Thus, it can be
detected efficiently with this method. After squaring “Bio-signal
rate Extractor.vi” is used and the high and low threshold value is
selected. A low threshold is selected as 2.5, and a high one as 3.
In Peaks/Valley, peaks are selected as we need to find R-peaks. As Fig. 12. Peaks detected in ECG signal
output, it will show us the “number of cycles,” and we further
apply Equation (1) to calculate the heartbeat rate: location and amplitude. Its block diagram is shown in Fig. 9, and
After calculating the heartbeats, the system will indicate the detected R-peaks shown in the front panel are presented in Fig.
whether they are normal or affected with tachycardia or 10, 11, and 12.
bradycardia. The block diagram of this part of the system is In this step “3,” the most important parameter of ECG features,
shown in Fig. 8. i.e., R-peaks, is detected, which can be used to find the correct
WA Multiscale Peak Detection.vi is used to detect the R-Peaks, heart rate and other important parameters. Since the R-peaks are
detected, in further steps all other ECG features, such as the
features related with P wave, PR interval, PR segment, QRS
complex, ST segment, QT interval, T wave, Statistics, and
whether or not the important waves are in range will be extracted
using the NI Biomedical Toolkit.
numeric expressions.
In the front panel, the results of these extracted features are
shown with the help of the LED. The block diagram is shown in
Fig. 14. All these above-mentioned steps were involved in the
algorithm to detect the ECG features in real-time, and the full
block diagram of this model is shown in Fig. 15. In the next
section, the simulation results of the model are displayed.
4. SIMULATION RESULTS
Fig. 13. ECG feature extractor
The ECG signals are taken for 1 min from an individual’s body
Table 1. Heart Rate Range for Different Conditions to evaluate the performance of the system, and it is tested on 10
Normal Sinus rhythm 60–100 ECG features are taken and displayed as a result.
Sinus Bradycardia < 60 The first result is displayed after analyzing R-peaks and then
Sinus Tachycardia > 100 automatically the LED light is blown and displays the heart
condition, i.e., normal or suffering from tachycardia or
bradycardia and calculates heart health based on some parameters
diagram of the feature extractor is shown in Fig. 13. depicted in Table 1. Based on Table 1, parameters heart rate of 10
The extracted features are also inserted into an array to calculate people are taken and the result is shown in Table 2. In Fig. 16, the
whether the various intervals and segments are in range or not. output of the heart rate detector is shown on the front panel of the
The normal range of these segments and intervals is shown in modeled system. The heart rate detected to be 79 BPM; hence, the
Table 1. reason why the LED of the normal condition keeps blowing.
With this normal range of ECG signals, we have calculated if Second, the other ECG parameters, such as the P onset and P
the P wave, PR interval, PR segment, QRS complex, ST segment, offset values of all the waves, are extracted. The sequential
QT interval, T wave are in range or not using Boolean and activation right and left atria are represented by a P wave. If P
wave is absent in the signal and has a flat baseline, this indicates
Fig. 16. Result of heartbeats in the front panel
fine atrial fibrillation and sinoatrial arrest wave of atrial flutter.
Detecting P wave is difficult because of its very low amplitude
[16]. In QRS complex, if the duration is more than normal, it Table 3. Normal ECG parameters
indicates hyperkalemia or bundle branch block. If the amplitude is Phase Duration (s) Amplitude (V)
increased more than normal, then it indicates cardiac hypertrophy. P wave 0.006–0.11 < 0.25
If the amplitude of Q wave is less than 1/3 of QRS or less than PR Interval 0.12–0.20 ~
1/4 of R wave, then it represents an abnormality in the presence PR Segment 0.08 ~
of infraction. The T wave in ECG is for the representation of the QRS Complex <0.12 0.8–1.2
repolarization of the ventricles. The normal range of all the waves ST Segment 0.12 ~
of the ECG signal is shown in Table 3 [2,17]. By using the values QT Interval 0.36–0.44 ~
from Table 3, all the waves are in their range or not are T Wave 0.16 <0.5
[7]
[8]
Proposed System
representing a very convenient system for detecting ECG The objective of acquiring ECG in real time to detect various
parameters. The proposed method is compared with some other ECG parameters and some diseases is successfully implemented
previously developed methods, as shown in Table 6. by this paper, and this model was tested on 10 randomly selected
subjects. The results and the comparisons with previously built
methods are also shown in the Simulation Result section. The
5. CONCLUSION
proposed system is user friendly, and anyone can use it to learn
about their heart status, even before consulting a doctor. In the
In the entire medical world, heart-related diseases are future, we can include more diseases related to the wave structure
numerous, and the number of cardiac patients is also increasing on in the system. We can also use AI algorithms to make this system
a daily basis. ECG is the most prominent approach for detecting much better for further processing.
diseases related to the heart. After analyzing the importance of
ECG, the current scenario of the work herein is conducted.
In this paper, the ECG signals are acquired in real time from the REFERENCES
real world using the myDAQ device and LabVIEW software. The
system uses a 1-min ECG signal and denoises the signal using [1] J. Huang, B. Chen, B. Yao, and W. He, "ECG Arrhythmia
wavelet denoise simultaneously. After denoising, it extracts not Classification Using STFT-Based Spectrogram and Con-
volutional Neural Network”, IEEE Access, Vol. 7, pp.
only the heart rate but also other features of the ECG signal, such
92871-92880, 2019.
as R-peaks, P onset-offset, PR interval, PR segment, QRS [2] N. Keskes, S. F. Ghribi, R. Barioul, and N. Derbel, "Param-
complex, ST segment, QT interval, and T wave. Then, the system eter Extraction of ECG Using Labview”, 15th Int. Mul-
will also show the statistics of various parameters. Finally, ticonf. on Syst. Signals Dev., pp. 49-54, 2018.
[3] C. Saritha, V. Sukanya, and Y. Narasimha Murthy, "ECG
employing the normal ECG parameter range system will indicate signal analysis using Wavelet Transforms”, Bul. J. Phys.,
whether the various intervals, such as PR interval, and segments Vol. 35, pp. 68-77, 2008.
(including ST segment) are in the normal range. [4] E. Haque and F. Ahmed, “ECG Signal Based Heart Disease
Detection System for Telemedicine Application”, 1st Int. LAB & LABVIEW as effective tools”, Int. J. of Comput.
Conf. on Adv. Inf. Commun Technol, pp. 1-4, 2016 Electr. Eng., Vol. 4, No. 3, pp. 404-408, 2012.
[5] A. N. Ay, M. Z. Yildiz, and B. Boru, “Real-time feature [12] J. H. Lee and D. W. Seo, “Development of ECG Monitoring
extraction of ECG signals using NI LabVIEW”, Sakaray System and Implantable Device with Wireless Charging”,
Univ. J. Sci., pp. 576-583, 2017. Micromachines, Vol. 10, No. 1, pp. 38(1)-38(15), 2019
[6] A. Sharma and H. P. Shukla, “Designing a simple toolbox [13] A. Kumar, L. Dewan, and M. Singh, “Real Time Mon-
for the early detection of arrhythmia, using advanced virtual itoring System for ECG Signal Using Virtual Instrumen-
instrumentation”, Biomed. Res., Vol. 30, No. 1, pp. 82-87. tation”, WSEAS Trans. Biol. Biomed., Vol 3, No. 11, pp.
2019. 638-643, 2006.
[7] D. Kaya, M. Türk, and T. Kaya, "Wavelet-based analysis [14] A. Velayudhan and S. Peter, “Noise Analysis and Different
method for heart rate detection of ECG signal using Lab- Denoising Techniques of ECG Signal - A Survey”, IOSR J.
VIEW”, 40th Int. Conve. on Inf. Commun. Technol. Elec- Electron. Commun. Eng., pp. 40-44, 2016.
tron. Microelectron., pp. 314-317, 2017. [15] Y. Luo, R. H. Hargraves, A. Belle, O. Bai, X. Qi, K. R.
[8] S. Jain, P. Kumar, and M. M. Subashini, "LABVIEW based Ward, M. P. Pfaffenberger, and K. Najarian, “A Hierarchical
expert system for detection of heart abnormalities”, Int. Method for Removal of Baseline Drift from Biomedical
Conf. on Adv. Electr. Eng., pp. 1-5, 2014. Signals: Application in ECG Analysis”, Sci. World J., Vol.
[9] V. Nandagopal, V. Maheswari, and C. Kannan, “Newly 2013, pp. 896056(1)-896056(10), 2013.
Constructed Real Time ECG Monitoring System Using [16] M. Rahimpour and B. M. Asl, “P wave detection in ECG
LabView”, Circuits Syst., Vol. 7. No. 13, pp. 4227-4235, signals using an extended Kalman filter: an evaluation in
2016. different arrhythmia contexts”, Physiol. Meas., Vol. 37, No.
[10] A. S. Vijoriya and R. Maheshwari, “ECG Signal Acqui- 7, pp. 1089–1104, 2016.
sition, Feature Extraction and HRV Analysis Using Bio- [17] R. Begum and R. Manza, “Detection of Cardiomyopathy
medical Workbench”, Int. J. Adv. Res. Eng. Technol., Vol. 9, using Support Vector Machine and Artificial Neural Net-
No. 3, pp. 84-90, 2018. work”, Int. J. Comput. Appl., Vol. 133, No. 14, pp. 29-34,
[11] M. K. Islam, N. Haque, G. Tangim, T. Ahammad, and M. 2016.
Khondokar, “Study and analysis of ECG signal using MAT-