Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Heart Rate Monitoring and PQRST Detection Based On Graphical User Interface With Matlab

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

International Journal of Information and Electronics Engineering, Vol. 5, No.

4, July 2015

Heart Rate Monitoring and PQRST Detection Based on


Graphical User Interface with Matlab
Hussain A. Jaber AL-Ziarjawey and Ilyas Çankaya

 heart muscle is thickened in order to look for possible


Abstract—An electrocardiogram (ECG/EKG) is an electrical valvular heart disease or other abnormalities. It is easy to
recording of the heart and is used in the investigation of heart know through Changes in the electrical pattern of the
disease. This electrical activity of the heart translates into line electrocardiogram may give clues to the reason of fainting,
tracings on paper. The spikes and dips in the line tracings are
or may indicate potential heart disease. An
called series of waves. This series of waves consists of six
different waveforms, are discernible, and are differentiated as electrocardiogram is a graphical record of bioelectrical
P, Q, R, S, T and U. The most of earlier method of ECG signal signal generated by the human body during cardiac cycle [2].
analysis for detecting PQRST was based on DSP technique for It is Possible to obtain useful and important information
example (Wavelet Transform and Fast Fourier Transform) through the chart of the ECG that relates to the functioning
and Artificial Neural networks. While this work proposes a of the heart through the baseline and waves representing the
simple and dependable method to detect the P, Q, R, S and T
voltage changes of heart during a period of time [3]. The
values of an electrocardiogram (ECG) signal. This method is
based on finding a mathematical relationship between the ECG is very important and has a particular value in the next
highest values (peaks and valleys) of the ECG waveform and clinical cases [4]:
time. In this proposed method is exemplified by designing a  Myocardial Infarction (heart attack).
graphical user Interface (GUI) by using MATLAB for  Pericarditis.
detecting PQRST by using simple mathematical algorithm to  Electrolytic transformations
get PQRST values and draw these values on ECG wave at the  Auricular and ventricular hypertrophy.
same time. This program will be devoted to the purposes of  Arrhythmias.
scientific research instead of clinical diagnosis.
 Cardiac medicine effects, especially digital and
Index Terms—GUI with MATLAB, QRS complex analysis,
quinidine.
heart rate detection, ECG leads, ECG extraction and methods.  Generalized suffering affecting heart and blood
pressure.
This paper presents a software package. The software has
I. INTRODUCTION been developed for the purpose of scientific research rather
than clinical diagnosis. In this paper, a MATLAB program
The electrocardiogram, or ECG, is the most common test
includes standardized graphical user interface (GUI) for the
used to assess the heart. The ECG is vastly used because it
analysis of P, Q, R, S and T values. All of the parameters
is capable to screen for a variety of cardiac abnormalities,
are computed from the ECG recordings. Loading ECG
ECG machines are easily available in the most of medical
recordings from any source of data as text or binary files
facilities, and the test is simple to perform, (risk-free and
and excel files. The paper is structured as follows: Section II
inexpensive). From the ECG tracing, the following
givesa brief review of the ECG extraction methods. Section
information can be identified [1]:
III summarizes continuous of the ECG waveforms and leads.
 The heart rate.
 The heart rhythm. Section IV focuses on the software which analysis ECG
 Whether the heart muscle has become abnormally signal to get P, Q, R, S, and T values. Section V presents the
thickened. results that have been achieved in this paper. And finally
 Whether there has been a prior heart attack. conclusions are drawn in Section VI.
 Whether there may be coronary artery disease.
 Whether there are “conduction abnormalities”
(abnormalities in how the electrical impulse spreads across II. ECG EXTRACTION METHODS
the heart). The recording of Electrocardiogram (ECG) signal plays
All of these traits can be significant and important.When an important role in the early diagnosis of heart disease
the ECG indicates a heart attack or possible coronary artery which is after that studied and analyzed using a
disease. Extra testing is usually done to entirely determine microcontroller. Through analyzes of ECG may be obtained
the kind of the problem and determine the best treatment. on the measurements of the rate and regularity of heartbeats
(These tests often include a cardiac catheterization and in addition to the size and position of the chambers, the
stress test.) An echocardiogram is often ordered when the presence of any damage to the heart and the effects of drugs
or devices used to regulate the heart. Diagnosis of
Manuscript received September 10, 2014; revised November 21, 2014. cardiovascular disease by using Electrocardiogram signals,
Heart Rate Monitoring and PQRST Detection Based on Graphical User this can be achieved either through the connected the
Interface with Matlab.
The authors are with the Yildrim Beyazit University-Institute of Science sample of the ECG signal with a normal healthy signal,
& Technology-Ankara, Turkey (e-mail: hussainjaber2000@yahoo.com, characterizing the normal ECG signal using basic logical
icankaya@ybu.edu.tr).

DOI: 10.7763/IJIEE.2015.V5.550 311


International Journal of Information and Electronics Engineering, Vol. 5, No. 4, July 2015

decisions, or more complicated algorithms to handle in crossing before the maximum and the S point should be at
depth the heart disease [5]. In recent years, many studies the zero crossing after the minimum. The P and T waves are
and mathematical analyzes have been developed for the done similarly by looking for local maximums in the
exertion of analyzing the ECG signal; all of these studies or original waveform and then using the derivative to identify
techniques and algorithms which have been proposed during peak and end points [17] .While proposed work in this paper
the last decade includes Artificial Neural Network, Fuzzy has presented a simple and dependable method to detect the
Logic methods, Digital Signal Analysis, Genetic Algorithm, P, Q, R, S and T values of an electrocardiogram (ECG)
Support Vector Machines, Hidden Markov Model Self- signal. This method is based on finding a mathematical
Organizing Map, Bayesian, Slope Vector Waveform (SVW), relationship between the highest values (peaks and valleys)
Discrete Wavelet Transform (DWT) and Difference of the ECG waveform and time. In this proposed method is
Operation Method (DOM) [6]-[11]. All of these methods based on designing a graphical user Interface (GUI) by
above have been dealing with the PQRS complex detection using MATLAB to detect PQRST by using simple
for ECG signals. For examples, Slope Vector Waveform mathematical algorithm to get PQRST values and draw
(SVW), in this method proposed an algorithm to detect ECG these values on ECG wave at the same time.
QRS complex and evaluate RR interval. Through this
technique provide quickly and accurately search for the R
location, RR interval and QRS complex duration, and gives III. ECG DESCRIPTION
excellent results ECG feature extraction [12].While the An electrocardiogram is a measurement of the electrical
Discrete Wavelet Transform (DWT) method states to activity of the heart muscle which can be obtained from the
extract the relevant information from the ECG input data in surface of the skin and from different angles Fig. 1. When
order to perform the classification task. Their proposed the heart muscle contracted and pumping the blood for all
work includes number of disjoint processing modules which parts of body, action potentials will be released through the
are data acquisition, Pre-processing beat detection, feature mechanical process within the heart muscle which leads to
extraction, and classification. In the feature extraction electrical activity [18].
module the Wavelet Transform is designed to address the
problem of non-stationary ECG signals. It was derived from
a single generating function termed the mother wavelet by
dilation and translation processes. By using this technique in
feature extraction can get to big advantage is that it has a
varying window size, narrow at higher frequencies and
broad at lower frequencies, which leads to an optimal time-
frequency resolution in all frequency ranges. [13]
Difference Operation Method (DOM) is used for detecting
the QRS complex of an electrocardiogram signal, this
technique includes two processes, one is the difference
operation process (DOP) and the other is the waves’
detection process. The outline of this technique includes two
steps. The first step is finding the point R by applying the Fig. 1. the heart’s anatomy with waveforms from different specific part of
difference equation operation to the ECG signal. The second the heart [19].
step looks for the points Q and S according to the point R to
find the QRS complex [14]. Another different system to A. ECG Waveform
determine the features of ECG signal by using neural
networks, presented an integral system where this system
consists of cepstrum coefficient method for feature
extraction from long-term ECG signals and artificial neural
network (ANN) models for the classification. From these
methods we can recognize features cache inside an ECG
signal and then classify the signal in addition to diagnose
the abnormalities [15]. While a new technique by using
S-T
neural networks and wavelet transformation to classify ECG P-R segment
segment
image by extracting their feature. Features are extracted
from wavelet decomposition of the ECG images intensity,
P-R
and then further processed by using artificial neural lavretni
S-T
networks. The features are: mean, median, maximum, QRS
lavretni

minimum, range, standard deviation, variance, and mean lavretni


Q-T
absolute deviation [16]. Another method by using Artificial lavretni

Neural Networks for detecting PQRST through use of the Fig. 2. Typical ECG waveforms [18].
derivative where search for the minimum and maximum of
the derivative of a wave .The highest peak (R wave) should The ECG is the chart of the heart which prints out on
be the zero crossing between the maximum and minimum of paper and record all the electrical activity of the human
the derivative. Similarly, the Q point should be at the zero heart. The normal ECG wave is composed of a series of

312
International Journal of Information and Electronics Engineering, Vol. 5, No. 4, July 2015

positive and negative waveforms as following P wave, QRS one of these leads represent electrical activity from a
complex, and T wave. The relationship between P wave and different angle on the heart muscle. This leads to the 12
QRS complexes helps distinguish various cardiac different electrical pictures which refer to different shapes
irregularities. These waves are shown as in Fig. 2; where the and amplitudes depending on the position of electrodes on
P wave represents the First upward deflection and atrial the surface of the body as a result allows seeing the heart
depolarization. While QRS complex is composed of three from various different angles. The 12 standard ECG leads
waves Q, R and S and represents ventricular depolarization, are divided in two groups, the first group called limb leads
T wave represents the Repolarization of ventricles and and consist of three bipolar limb leads (I, II, and III), I: is a
concurrent with end of ventricular systole. [18]. lead obtained between a negative electrode and a positive
The above Fig. 2 represents a typical ECG waves where electrode where the negative electrode placed on the right
the horizontal axis of a wave represents a measure of time arm while the positive electrode placed on the left arm.
while the vertical of a wave which includes height and depth While II: is a lead obtained between a negative electrode
represent a measure of voltage. Where, the first time and a positive electrode where the negative electrode placed
interval in the horizontal axis is P-R interval which on the right arm while the positive electrode placed on the
represents the period from the onset of the P–wave to the left foot. And III: is a lead obtained between a negative
beginning of the QRS complex. This interval represents the electrode and a positive electrode where the negative
time between the beginning of atrial depolarization and the electrode placed on the left arm while the positive electrode
beginning of ventricular depolarization. The S–T segment placed on the left foot. and the unipolar limb leads (AVR,
following the QRS and describes the part between the end AVL, and AVF), and the second group called chest leads,
of the S wave (the J point) and the beginning of the T wave also called precordial or V leads,(V1,V2,V3,V4,V5 and
and it represents the interval between ventricular muscle V6) .The description of the 12 ECG leads and the mapping
depolarization and repolarization. The Q–T interval is a of electrodes positions are shown in the following Fig. 3.
time period between the beginnings of the Q wave to the
end of the T wave in the heart's electrical cycle. The QT
interval representing the total duration of electrical activity
depolarization and repolarization of the ventricles. Table I
represents the normal amplitudes range of the ECG
waveform [18].

TABLE I: THE NORMAL AMPLITUDES RANGE OF THE ECG WAVEFORM [18]


Wave Amplitude Range
Lead I Lead II Lead III
Potential(mv) Potential(mv) Potential(mv)
P 0.015 to 0.12 0.00 to 0.19 –0.073 to 0.13
Q 0.00 to 0.16 0.00 to 0.18 0.00 to 0.28
R 0.02 to 0.13 0.18 to 1.68 0.03 to 1.31
S 0.00 to 0.36 0.00 to 0.49 0.00 to 0.55 Fig. 3. A vector view of the standard 12 Lead ECG [23].
T 0.06 to 0.42 0.06 to 0.55 0.06 to 0.3
Lead aVR Lead aVL Lead aVF C. Heart Rate
Potential(mv) Potential(mv) Potential(mv)
P –0.179 to 0.01 –0.085 to 0.140 –0.06 to 0.16 Heart rate is the speed of the heartbeat measured by the
Q 0.00 to0.90 0.00 to 0.22 0.00 to 0.19 number of heartbeats per unit of time usually expressed as
R 0.00 to 0.33 0.00 to 0.75 0.02 to 0.15 beats per minute (bpm).The normal heart rate for normal
S 0.00 to 0.15 0.00 to 0.90 0.00 to 0.71
T –0.00 to 0.00 –0.16 to 0.27 0.04 to 0.46 person is in the range of 60 to 100 beats per minute, but this
Lead V1 Lead V2 Lead V3 may change with age and sex, when a heart rate less than 60
Potential(mv) Potential(mv) Potential(mv) bpm is called Bradycardia while when a heart rate more
P -0.08 to 0.18 0.15 to 0.16 0.00 to 0.18
than 100 bpm is called Tachycardia [24], [25]. There are
Q – – 0.00 to 0.05
R 0.00 to o.49 0.04 to 1.52 0.06 to 2.24 many methods to calculate heart rate depends on an ECG
S 0.08 to 2.13 0.19 to 2.74 0.09 to 2.22 wave by using the R-R interval and as following. The first
T 0.03 to 1.22 –0.14 to 1.44 0.00 to 1.60 one depends on count the number of R waves in a 6 second
Lead V4 Lead V5 Lead V6 rhythm strip, then multiply by 10. Secondly, count the
Potential(mv) Potential(mv) Potential(mv)
P 0.01 to 0.23 0.00 to 0.24 0.00 to 0.19 number of small boxes (RR interval in millimeters) for a
Q 0.00 to 0.16 0.00 to 0.21 0.00 to 0.27 typical R-R interval. Divide this number into 1500 to
R 0.18 to 3.20 0.42 to 2.42 0.25 to 2.60 calculate heart rate. Thirdly, count the number of large
S 0.02 to 2.09 0.00 to 0.97 0.00 to 0.84
boxes (between successive R waves) for a typical R-R
T 0.05 to1.31 0.00 to 0.96 0.00 to 0.67
interval. Divide this number into 300 to determine heart rate
[22].
B. ECG Leads [20]-[22]
Any muscle contraction causes an electrical change –
depolarization, these changes can be detected by pairs of IV. RESULT AND RELATED WORK
electrodes placed on the surface of the body by using ECG The result of this work is a Matlab program which
leads, these Lead indicates to an imaginary line between two analyzes of ECG recordings to get P, Q, R, S, and T as well
ECG electrodes and these leads consist of 12-leads, each as detect heart rate. The graphical user interface is very easy

313
International Journal of Information and Electronics Engineering, Vol. 5, No. 4, July 2015

to use and enables to get P, Q, R, S and T values from then adjust filter (again windowing filter) and detect R-
analysis of ECG signal. It is necessary for anyone who peaks to detect heart rate and P-QRS-T waves after a simple
works on this program should select the numbers of samples mathematical calculations by matlab equations to calculate
for one cardiac cycle in an ECG signal of the P-QRS-T P, Q, R, S and T.
waves are equal to 400 samples. The software tool provides Fig. 5- Fig. 12 show the results of graphical user interface
the following main features for ECG processing and (GUI).
analysis:
 Loading ECG recordings from any source of data as
text or binary files and excel files.
 Plotting the loaded ECG recordings of every lead.
 PQRST detections as individual values and also
appears on the graph.
 Export graph as (fig, png and bmp types).
 Save data as (txt, mat and xlsx types).
 Print out of any lead of ECG graphs.
 Detecting R peaks and measuring the heart rate, the
diagram (Fig. 4) introduces the steps of heart rate
detection.

Fig. 5. Design of graphical user interface (GUI).

Fig. 6. Import data from any source.

The Fig. 5 represent the main graphical user interface in


matlab program and the following points explain everything
regard to this program.
1) Draw full sampling of ECG signal and calculate heart
rate.
2) Import date from anywhere and from any type of data.
3) When select this button performs steps of heart rate
detection by using windowing filter two times.
4) When click this button we can save graph which
display on the left side as three types of file (.fig, .png,
and .bmp)
5) We can save data as (txt, mat and xlsx types).
6) Types of data that program can save data.
7) Types of image (figure) that program can save figure.
8) Get analysis data button mean get analysis of ECG
data to detect PQRST values.
9) We can print out each of figures depend on which one
we want.
10) When click this button we can save graph which
Fig. 4. Steps of PQRST & heart rate detection. display on the right side as three type of files
(.fig, .png and bmp).
The above chart (Fig. 4) describe stages of detecting heart
11) Selection about which one we want to print out, all
rate and P-QRS-T waves, firstly read ECG data after
samples or specific samples.
selecting which lead you select and type of data from any
12) Types of image (figure) that program can save figure.
type of file and then removing low frequency components
13) POP- UP menu used to select steps of heart detection.
after that using windowing filter and later thresholding and
14) Select type of data as (mat, txt and xlsx) to draw ECG

314
International Journal of Information and Electronics Engineering, Vol. 5, No. 4, July 2015

wave.
15) When select data from which data want also these data
for any lead of ecg want to draw it.
16) Enter the range of sampling data for analysis data of
ecg to get PQRST value.
The Fig. 6 clarifies how user can import data from
anywhere and from any type of data.

Fig. 10. Windowing filter and detect peaks by using threshold filter.

The Fig. 10 demonstrates the first treatment with


windowing filter and detect peaks by using threshold filter.

Fig. 7. Load and plot ECG recording of every lead from any source.

The Fig. 7 illustrates how user can load and plot ECG
graph after selectof every lead and from any type of data
((txt, mat and xlsx types).

Fig. 11. Windowing filter and finally detect peaks by using threshold filter.

The Fig. 11 clarifies the second treatment with


windowing filter and finally detects peaks by using
threshold filter.

Fig. 8. Detection PQRST values and heart rate.

The Fig. 8 demonstrates how get P, Q, R, S and T values


Fig. 12. Plot R- peaks detection of ECG signal.
for specific range of data (approximately 400 samples) and
detect heart rate. The Fig. 1 demonstrates R-peaks detection in final stage
of ECG analysis.

V. CONCLUSION AND FUTURE WORK


This paper has presented a thorough matlab program
which it is easy and very useful for clinicians in research
studies in addition to students who works in medical section.
The most of earlier method of ECG signal analysis for
detecting PQRST was based on DSP technique for example
(Wavelet Transform and Fast Fourier Transform) and
Artificial Neural networks. This paper presents a developed
program is a flexible and thorough tool for P, Q, R, S and T
Fig. 9. original ECG with Apply FFT filter. analysis from ECGs and detect heart rate. The proposed
software tool can be utilized in training for clinicians and
The Fig. 9 illustrates the first stage of ECG analysis to engineers working together in the same field which related
detect heart rate by applying FFT filter.

315
International Journal of Information and Electronics Engineering, Vol. 5, No. 4, July 2015

of heart disease. The graphical user interface is very easy to [15] K. K. Jen and Y. R. Hwang, “ECG feature extraction and
classification using cepstrum and neural networks,” Journal of
use and enables to get P, Q, R, S and T values from analysis Medical and Biological Engineering, vol. 28, no. 1, 2008.
of ECG signal. For future work I suggest to use [16] M. B. Tayel and M. E. El-Bouridy, “ECG images classification using
microcontroller for real-time ECG signal processing and feature extraction based on wavelet transformation and neural
network,” presented at ICGST, International Conference on AIML,
analyzing, heart rate and QRS complex detection algorithms June 2006.
from ECG signal in real time. [17] S. Franklin and J. Wallcave, “Cardiac condition detection using
artificial neural networks,” Electrical Engineering Department
REFERENCES California Polytechnic State University San Luis Obispo June 2013.
[18] H. Al-jobouri, “Designation of interface and software program as a
[1] J. D. Bronzino, The Biomedical Engineering Handbook, vol. 1, 2nd base for ECG monitoring and signal analysis,” M.S. thesis, Dept. of
ed., CRC Press LLC, 2000. Medical Eng., AlNahrain Univ., Baghdad, Iraq, 2004.
[2] N. Goldschlager, “Principles of clinical electrocardiography,” [19] P. Gustafsso and J. Hagblad, “Miniaturised multi-channel wireless
Appleton & Lange, 13th ed., Connecticut, USA, 1989. ECG connected to graphical computer interface using bluetooth,”
[3] N. Singh and R. Mishra, “Microcontroller based wireless M.S. thesis, Dept. of Comp. Sci. and Electronics, Mälardalen
transmission on biomedical signal and simulation in MATLAB,” University, Sweden, 2007.
IOSR Journal of Engineering, vol. 2, issue 12, 2012. [20] M. Kutz, Standard Handbook of Biomedical Engineering and Design,
[4] G. Gupta and R. Mehra, “Design analysis of IIR filter for power line McGraw-Hill Professional Publishing, 2003.
interference reduction in ECG signals,” Int. Journal of Engineering [21] D. Jennings, A. Flint, B. C. H. Firton and L. D. M. Nokes,
Research and Applications, vol. 3, issue 6, 2013. Introduction to Medical Electronics Applications, Edward Arnold,
[5] J. S. Prasath, “Wireless monitoring of Heart Rate using 1995.
Microcontroller,” International Journal of Advanced Research in [22] J. D. Enderle, S. M. Blanchard, and J. D. Bronzino, Introduction to
Computer Science and Electronics Engineering (IJARCSEE), vol. 2, Biomedical Engineering, 2nd Ed., by Elsevier Inc., 2005.
issue 2, 2013. [23] M. M. K. Delano, “A long term wearable electrocardiogram (ECG)
[6] C. Saritha, V. Sukanya, and Y. N. Murthy, “ECG signal analysis measurement system,” M.S. thesis, Dept. of Elect. Eng. and Compu.
using wavelet transforms,” Bulgarian Journal of Physics, vol. 35, pp. Scie., Massachusetts Institute of Technology, United States, 2012.
68-77, 2008. [24] R. M. Rangayyan, Biomedical Signal Analysis: A Case-Study
[7] S. Karpagachelvi, M. Arthanari, and M. Sivakumar, “ECG feature Approach, Wiley-IEEE Press, 2002.
extraction techniques-a survey approach,” (IJCSIS) International [25] E. C. Ifeachor and B. W. Jervis, Digital Signal Processing; A
Journal of Computer Science and Information Security, vol. 8, no. 1, Practical Approach, Addison-Wesley, 1993.
2010.
[8] K. Prasad and J. S. Sahambi, “Classification of ECG arrhythmias Hussain Abed J. Alziarjawey was born in 1973,
using multi-resolution analysis and neural networks,” IEEE Baghdad and he received the B.Sc. degree in EEE
Transactions on Biomedical Engineering, vol. 1, pp. 227-231, 2003. from University of technology Baghdad, Iraq, in
[9] J. P. Martínez, R. Almeida, S. Olmos, A. P. Rocha, and P. Laguna, 1997. Currently, he is doing his master degree in the
“A wavelet-based ECG delineator: Evaluation on standard databases,” biomedical engineering at Yildirm Beyazit
IEEE Transactions on Biomedical Engineering, vol. 51, no. 4, pp. University (turkey-Ankara). He has good experience
570-581, 2004. in biomedical field for 15 years old. His areas of
[10] S. Cerutti and C. Marchesi, Advanced Methods of Biomedical Signal interest are electrical design by using computer,
Processing, Wiley-IEEE Press 2011. biomedical devices, Microsoft visual basic 6.0,
[11] A. N. Ali, Advanced Biosignal Processing, Berlin Heidelberg: Microsoft visual fox pro 7.0, MATLAB, etc.
Springer-Verlag, 2009.
[12] X. Xu and Y. Liu, “ECG QRS complex detection using slope vector İlyas Çankaya was born in 1968, Turkey and he
waveform (SVW) algorithm,” in Proc. the 26th Annual International received the B.Sc. degree in electronic from Gazi
Conference of the IEEE EMBS, pp. 3597-3600, 2004. University Ankara, Turkey, in 1990, and PhD degree
[13] E. M. Tamil, N. H. Kamarudin, R. Salleh, M. Y. I. Idris, N. M. Noor, in electronic and computer from Sussex University,
and A. M. Tamil, “Heartbeat electrocardiogram (ECG) signal feature England in 1998. Currently, he is an associate prof.
extraction using discrete wavelet transforms (DWT),” Malaysia, 2007. at Yildirm Beyazit University (turkey-Ankara).
[14] Y. C. Yeh and W. J. Wang, “QRS complexes detection for ECG
signal: The difference operation method,” Computer Methods and
Programs in Biomedicine, vol. 91, 2008.

316

You might also like