Detection of Cardiac Disorder Using MATLAB Based
Detection of Cardiac Disorder Using MATLAB Based
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.
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
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
σ σ 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
(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
4
71
64
57
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
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
443