0% found this document useful (0 votes)
38 views

Detection of Cardiac Disorder Using MATLAB Based

Uploaded by

Seira Loyard
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Detection of Cardiac Disorder Using MATLAB Based

Uploaded by

Seira Loyard
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2017 IEEE Region 10 Humanitarian Technology Conference (R10-HTC)

21 - 23 Dec 2017, Dhaka, Bangladesh

Detection of Cardiac Disorder using MATLAB based


Graphical User Interface (GUI)
Kusum Tara Ajay Krishno Sarkar Muhammad Abdul Goffar Khan Jannatul Robaiat Mou
Dept. of Electrical and Dept. of Electrical and Dept. of Electrical and Electronic Dept. of Electronics and
Electronic Engineering Electronic Engineering Engineering Telecom. Engineering
Rajshahi University of Rajshahi University of Rajshahi University of Engineering Rajshahi University of
Engineering & Technology Engineering & Technology & Technology Engineering & Technology
Rajshahi-6204, Bangladesh Rajshahi-6204, Bangladesh Rajshahi-6204, Bangladesh Rajshahi-6204, Bangladesh
kusum.ruet@gmail.com sarkarajay139@gmail.com agmagk@gmail.com robaiat.ruet@yahoo.com

Abstract—Cardiac disorder leads to abnormal variability in diagnostic algorithm for ECG signal processing was
the RR intervals. Hence accurate identification of such beats and implemented for cardiovascular disease diagnosis on
pattern recognition are important for effective decision making. smartphone [6]. Application Specific Integrated Circuit
In this work, a platform using MATLAB based Graphical User (ASIC) generated report and sent to a cardiologist via email.
Interface (GUI) is developed for automatic detection of infected Smith discussed about electrocortiographic spectral
or non-infected heartbeat conditions. Four subjects having characteristics by optimizing noise performance of the system
normal sinus rhythm, atrial fibrillation, and arrhythmia [7]. A prototype is fabricated that consumes low power.
respectively are investigated by analyzing distribution of power
and statistical features (heart rate, form factor, kurtosis,
skewness, and LF/HF ratio). RR interval of affected subject is
In recent years, researchers tend to improve automated
less than the normal heart beat. Moreover, heart rate, kurtosis, detection systems for fast identification of such disorders
and skewness are higher but LF/HF ratio is lower for affected through analysis of ECG signal. John designed a MATLAB
heart beats. The proposed classification procedure is tested on graphical user interface window to detect the condition of
MATLAB based GUI platform and the results are compared heart using wavelet transform (WT) [8]. Only R-R interval
with real report obtained from medical. The result provides a and heart rate are considered to find the status of heart. George
significant clinical advantage, and matches the doctor's opinion. designed a Graphical User Interface (GUI) using MATLAB
A new platform can be found to detect the condition of heart program to distinguish between the ECG signals of a healthy
within very short time. person and patients with the three specific heart diseases
(Premature Atrial Contraction, Premature Ventricular
Keywords— MATLAB based Graphical User Interface (GUI); Contraction, and Atrial Fibrillation) from the raw ECG data
cardiac disorder; Wavelet Transform (WT); Power Spectral Density using fractal dimension method [9].
(PSD); kurtosis;
In this work, a platform of cardiac disorder detection is
I. INTRODUCTION designed for pattern classification, decision making about the
The Electrocardiogram (ECG) is an important tool to give condition of heart. ECG signal is loaded into the platform, and
information about the activity of the heart. Different types of filtered using bandpass filter. The PSD is used to detect the
cardiac disorders such as atrial fibrillation, ventricular presence of a significant peak in the range 0.6-250 Hz for
arrhythmia, and arrhythmia may increase the risk of stroke or identification of abnormal rhythm. If the power spectral
sudden cardiac death. These disorders also affect the density (PSD) is available, a high value of fractional power in
propagation of excitation pulse through the conduction system the High frequency (HF) band 1.7-250 Hz indicates the
of the heart [1]. Most ECG measurements are taken in clinics presence of cardiac disorders. Several statistical features (heart
requiring large processing time because of having no rate, form factor, kurtosis, skewness, and LF/HF ratio) of an
computerized and automated detection system. A large part of ECG signal are measured. So, the clinical specialist may be
the biomedical research is dedicated to develop ECG signal able to use the features in his or her diagnostic logic.
processing techniques to contribute to early diagnosis. So, an
effective computer aided platform is needed to design as a
II. METHODOLOGY
powerful pattern classifier as well as feature extractor that is
capable of extracting important information from the original
signal. Khamis proposed a QRS detection algorithm to analyze The proposed prediction technique consists of three main
ECG recordings generated in telehealth environments [2]. stages such as (i) data acquisition and filtration, (ii) PSD
Another researcher named Diery provided an automated analysis and (iii) features extraction and classification. The
diagnostic process to analyse P-wave [3]. Oster gave a model bandpass filter (2-250Hz) is used to reduce the influence of
to classify ventricular heart beats based on switching Kalman noise such as power line interference, baseline wander and
filter [4]. An algorithm is proposed to classify arrhythmia motion artifacts which are generally embedded with acquired
using wavelet transform and neural network [5]. A disease signal. Then, the QRS complexes of ECG signals are detected.

978-1-5386-2175-2/17/$31.00 ©2017 IEEE

440
2017 IEEE Region 10 Humanitarian Technology Conference (R10-HTC)
21 - 23 Dec 2017, Dhaka, Bangladesh

The block diagram of the proposed cardiac disorder detection Where the constant C is chosen to obtain the energy by
technique is shown in Fig. 1. using WT,
^ 2

Ψ ( w)
C= dw (3)
w
r
A reference frequency, wr is chosen from w=w to
a
obtain a time-frequency density. Finally, wavelet time-
frequency analysis can be expressed by eq. (4).
wr w
PWT (t , w) = PWT (t , r ) (4)
w2 w
2
1 w
PWT (t , a) = WT(t, r )
2ΠCwr w

Then, the instantaneous power, PWT (t , a ) is obtained


from Eq. (5), which contains the messages of time and
Fig. 1. Block diagram of proposed cardiac disorder detection technique. frequency. For assessing the instantaneous power of
independent frequency components of signal, the power
A. Data acquisition from subjects spectrum at different frequency is divided into three parts:
The ECG data is collected from MIT-BIH database, (i) The power spectrum for very low frequency (VLF,
available from Physionet, sampled at 360Hz for performance 0.003–0.6 Hz) is:
evaluation of the proposed cardiac disorder detection platform. 0.6
Four subjects with age of 24-35 years are taken to record PVLF (t , a) =  PWT (t , f )df (5)
signals for 10 minutes each. According to the report one 0.003

subject with normal sinus rhythm (heart rate of 70 beats/ where, f = w frequency interval is related to the scaling
minute), one having atrial fibrillation, and other two with 2Π
arrhythmia are considered. factor a.
(ii) The power spectrum for low frequency (LF, 0.6–1.7
B. Signal processing in MATLAB GUI to determine PSD Hz) is:
Lead II is considered for the analysis. The obtained signal
has noise due to high frequency, motion artifact, or power line 1, 7
interference. The significant QRS peaks of the signal are PLF (t , a) =  PWT (t , f )df (6)
0.6
extracted through a band pass filter at 1-300 Hz and sampled
at 200 Hz to obtain the signal x(t). The signal, x(t) is (iii) And for high frequency (HF, 1.7–250 Hz) the power
segmented into three part part x i (t ) according to the three spectrum is:
frequency spectrum, i = 1, 2, 3. After the x i (t ) is obtained,
250
WT is used to compute its wavelet power coefficients, WT(t,a) PHF (t , a) =  PWT (t , f )df (7)
1.7
as follows
1 t −b C. Statistical features extraction for disorder detection
 x (t )ψ
*
WT (b, a ) = i ( ) dt
a a (1) Different statistical features (heart rate (HR), form factor
^ ^ * (FF), kurtosis, skewness, and LF/HF ratio) are extracted to
WT (t , a) = a  e jwt x i ( w) Ψ (aw)dw differentiate among infected and non-infected heart beats.
1) Average heart rate: Instantaneous heart rate values are
where w, x i (t ) , ψ (t ) represents angular frequency, the obtained by the inverse of the RR interval of each beat.
signal in the ith state, and Morlet wavelet respectively. The 60 60 60 60 (8)
IHR=[ , , ,......... ........., ]
scaling factor, a and shifting factor or space, b are real and a > tRR1 tRR2 tRR3 tRRn
0. Actually, the WT is not a function of time and frequency
but time b and the scaling factor a. As scale is related to Where t RR1 , t RR 2 , t RR 3 ,........, t RRn are time instants at
frequency, PWT (t , a ) defines spectral density of time and which the QRS complexes occur in the ECG signal.
scale. 60
AHR = (9)
1 2
(2) t RRAverage
PWT (t , a ) = 2
WT (t , a )
2Π Ca

441
2017 IEEE Region 10 Humanitarian Technology Conference (R10-HTC)
21 - 23 Dec 2017, Dhaka, Bangladesh

2) Form Factor: It is the ratio of the mobility of the first


derivative of the signal to the mobility of the signal itself. It
discriminates between normal and infected heart beats.
3) Kurtosis: Kurtosis is a measure for the degree of
flatness or peakedness in the variable distribution.
E [( X − μ ) 3 ]
Kurt [ X ] =
[
E ( X − μ)2 ]
2
(10)
High kurtosis tends to have a distinct peak near the mean,
decline rather rapidly, and have heavy tails. While low
kurtosis tends to have a flat top near the mean rather than a
sharp peak.
Fig. 3. Original and filtered signal on MATLAB based GUI platform.
4) Skewness: Skewness can reflect the degree of
asymmetry in the histogram of instantaneous power: Another button, Show all provides all statistical features on the
platform so that, the condition of heart can be detected easily.
Skew[X ] = E( ) =
[ ]
 X − μ 3  E X − 3μσ − μ
3 2 3

 σ  σ 3
-20

Power/frequency
(11)
Where, E is the expectation operator. If the histogram is -25

(dB/Hz)
-30
symmetrical, the skewness is zero. If the left hand tail is
-35
longer, the skewness will be negative. If the right hand tail is -40
longer, the skewness will be positive. -45
5) LF/HF ratio: Instantaneous power of independent -50
0 50 100 150 200
frequency components PVLF (t ) , PLF (t ) , and PHF (t ) are Frequency (Hz)
calculated from eq. (5)–(7). The ratio of LF and HF is (a)

LF P (t )
ratio = LF -25
HF PHF (t ) (12) -35
Power/frequency
(dB/Hz)

-45
III. RESULTS -55
The raw data obtained from database is loaded by pressing -65
Load Xls button on the Matlab based GUI platform. Then the 0 50 100 150 200
Frequency (Hz)
signal is processed by a single click of different buttons. The (b)
designed platform is shown in Fig. 2. -30
-40
Power/frequency

-50
(dB/Hz)

-60
-70
-80
-90
0 50 100 150 200
Frequency (Hz)
(c)
-25
-35
Power/frequency

-45
(dB/Hz)

-55
-65
-75
-85
-950 50 100 150 200
Frequency (Hz)
(d)
Fig. 4. Power spectral density for differenent subjects. (a) S1(Normal
Fig. 2. Designed MATLAB based GUI platform. rhythm), (b) S2 (Atrial fibrillation), (c) S3 (Arrhythmia), (d) S4 (Arrhythmia).

When Plot ECG and Filtered signal buttons are pressed, then Fig. 4 represents the Power spectral density (PSD) analysis
the original signal and filtered signal for normal subject for different subjects to detect the difference between the
respectively appear on the designed platform as shown in Fig. infected and non-infected heart beats. Initially, PSD of normal
3. Plot PSD button shows plot of distribution of power with subject is higher than other infected subjects. Then, it
the variation of frequency. decreases slowly.

442
2017 IEEE Region 10 Humanitarian Technology Conference (R10-HTC)
21 - 23 Dec 2017, Dhaka, Bangladesh

10
Analyzed Signal
TABLE I. STATISTICAL FEATURES FOR DIFFERENT SUBJECTS
5

0
200 400 600 800 1000 1200 Subjects Heart FF Kurtosis Skewness LF/HF Status
Contours of the peaks x 10
-3 Rate ratio
(bpm)
127 8
120
113 7
106
99
92
85
6
S1 70.8051 3.7898 1.3749 0.0864 0.9210 Normal
Scales a

78

S2 88.9621 5.3844 1.8045 0.2347 0.8140 Infected


5
71
64
57 4
50
43
36
29
3
S3 110.2857 7.3344 1.9310 0.3955 0.7398 Infected
22
S4 98.3163 7.0107 4.7611 1.6646 0.5991 Infected
2
15
8
1 1

Table 1 summarizes the statistical features for different


200 400 600 800 1000 1200
Space b

(a)
Analyzed Signal
subjects. For healthy subject, HR, FF, kurtosis, and skewness
are lower than the other infected subjects. In addition,
2

0
500 1000 1500 2000 2500 compared to healthy subjects, As power in HF for affected
127
Contours of the peaks x 10
-3
subjects is increased significantly, LF/HF ratio is less than
normal subject.
120
113 5
106
99
92 4
85
78
Scales a

71
64 3
57
50
43
36
29
22
2
IV. DISCUSSION AND CONCLUSION
15 1
8
1
500 1000
Space b
1500 2000 2500
A user friendly MATLAB based GUI platform is designed
(b) so that anybody can operate without having knowledge of
0.4
Analyzed Signal
signal processing. The platform stores data, provides reliable
0.2

0
performance and assists patients to observe their own
conditions of heart. Moreover, the proposed platform provides
200 400 600 800 1000 1200

flexible and visual utilization to observe the infected/non-


Contours of the peaks -3
x 10
127 6
120
113

infected heart beats and test results. Further research is needed


106 5
99
92
85

to observe the change of heart rate variability for large number


78
Scales a

4
71
64
57

of patients to increase accuracy. The platform would yield


50 3
43
36
29 2

acceptable results for clinical implementation after further


22
15
8
1 1

study.
200 400 600 800 1000 1200
Space b

(c)
Analyzed Signal
2

0
500 1000 1500 2000 2500
References
127
Contours of the peaks x 10
4
-3 [1] Rangaraj M. Rangayyan, Biomedical Signal Analysis: A Case-Study
120
113
106 3.5 Approach, IEEE Press, 2012.
[2] H. Khamis, R. Weiss, Y. Xie, C. W. Chang, N. H. Lovell, and S. J.
99
92 3
85
78
Scales a

Redmond, “QRS Detection Algorithm for Telehealth Electrocardiogram


2.5
71
64
57 2

Recordings,” IEEE Trans. Biomed. Eng., vol. 63, no. 7, pp. 1377-1388,
50
43
36 1.5
29
22
15
8
1
2016.
[3] A. Diery, D. Rowlands, T. R. H. Cutmore, and D. James, “Automated
1 0.5
500 1000 1500 2000 2500
Space b

(d) ECG diagnostic P-wave analysis using wavelets,” Computer Methods


and Programs in Biomedicine, vol. 101, no. 1, pp. 33-43, 2011.
Fig. 5. Spectogram plot for differenent subjects. (a) S1(Normal rhythm), (b) [4] J. Oster, J. Behar, O. Sayadi, S. Nemati, A. E. W. Johnson, and G. D.
S2 (Atrial fibrillation), (c) S3 (Arrhythmia), (d) S4 (Arrhythmia). Clifford, “Semisupervised ECG Ventricular Beat Classification With
Novelty Detection Based on Switching Kalman Filters,” IEEE Trans.
Fig. 5 shows the spctogram plot where different patterns Biomed. Eng., vol. 62, no. 9, pp. 2125-2134, 2015.
appear for different subjects. After filtering, the analyzed [5] J. A. Gutiérrez-Gnecchi, R. Morfin-Magaña, D. Lorias-Espinoza, A. d.
C. Tellez-Anguiano, E. Reyes-Archundia, A. Méndez-Patiño, and R.
signal is obtained where QRS peaks can be observed very Castañeda-Miranda, “DSP-based arrhythmia classification using wavelet
clearly. As the peaks appear in the same vicinity in Fig. 5(a), transform and probabilistic neural network,” Biomedical Signal
the pattern is perfectly periodic and regular. Contours for both Processing and Control, vol. 32, pp. 44-56, 2017.
atrial and ventricular rate are periodic. That’s why, the rhythm [6] S. K. Jain, and B. Bhaumik, “An Energy Efficient ECG Signal Processor
Detecting Cardiovascular Diseases on Smartphone,” IEEE Trans.
is normal. But for other subjects, the pattern is not regular Biomed. Circuits Syst., vol. 11, no. 2, pp. 314-323, 2017.
because QRS peaks do not appear in periodic manner due to [7] W. A. Smith, B. J. Mogen, E. E. Fetz, V. S. Sathe, and B. P. Otis,
the affected conduction system of heart. Fig. 5(b) shows that “Exploiting Electrocorticographic Spectral Characteristics for Optimized
contours for atrial rate is almost absent at spaces of 1300- Signal Chain Design: A 1.08 W Analog Front End With Reduced ADC
2200. For the subject S4, contours for atrial rate is periodic but Resolution Requirements,” IEEE Trans. Biomed. Circuits Syst., vol. 10,
no. 6, pp. 1171-1180, 2016.
for ventricular rate is aperiodic and absent at spaces of 700- [8] A. A. John, A. P. Subramanian, S. K. Jaganathan, and B. Sethuraman,
900 as shown in Fig. 5 (c). Fig. 5 (d) represents that contours “Evaluation of cardiac signals using discrete wavelet transform with
for both atrial and ventricular rate are random. As the pattern MATLAB graphical user interface,” Indian Heart Journal, vol. 67, no.
becomes more random, the rhythm is irregular. Statistical 6, pp. 549-551, 2015.
features are important to evaluate the results of classification [9] Jacqueline. J. George, Eman Mohammed Saeed Mohammed, “Heart
disease diagnostic graphical user interface using fractal dimension,” in:
of the designed platform based on pattern recognition. The International Conference on Computing, Electrical and Electronics
statistical features (HR, FF, skewness, and kurtosis) are Engineering(ICCEEE),Sudan,2013.
calculated for four subjects subjects by eq. (9)–(12).

443

You might also like