++FPGA Based Arrhythmia Detection
++FPGA Based Arrhythmia Detection
com
ScienceDirect
Procedia Computer Science 57 (2015) 970 – 979
c
JNTUK, Electronics and Communication Engineering, University College of Engineering JNTU, Vizianagaram.
d
M.TECH,Department of Electronics and Communication Engineering,VNR-VJIET,Hyderabad,India.
Abstract
This paper proposes a simple and reliable Field Programmable Gate Array (FPGA) based ECG Analysis system.
Electrocardiogram (ECG) is important biomedical signal, which show the electrical activity of the heart. ECG waveform
provides the valuable information for detection of abnormal heart diseases. For accurate analysis, ECG signal must be
processed to remove the noise signal. Also, various features of ECG must be extracted for diagnosis of cardiac disorders.
Thus, ECG signal processing includes two stages: Preprocessing and Feature Extraction. Preprocessing stage removes noise
from the raw ECG signal and the feature extraction stage extracts diagnostic information from the ECG signal. The main
objectives of the work are (i) ECG signal enhancement using Empirical mode decomposition (EMD) based method. (ii)
Detection of R peaks which is the first step towards automatic detection of cardiac arrhythmias in ECG signal. The
proposed system can detect three different arrhythmias. 94.76% accuracy of the proposed method is achieved in detecting
the different heart Arrhythmias correctly by using subset of data records from the MIT-BIH database. The system is
implemented using Verilog HDL and Xilinx Spartan 3E FPGA respectively.
©© 2015 TheAuthors.
2015 The Authors. Published
Published by Elsevier
by Elsevier B.V.is an open access article under the CC BY-NC-ND license
B.V. This
Peer-review under responsibility of organizing committee of the 3rd International Conference on Recent Trends in
(http://creativecommons.org/licenses/by-nc-nd/4.0/).
Computing 2015 responsibility
Peer-review under (ICRTC-2015). of organizing committee of the 3rd International Conference on Recent Trends in Computing 2015
(ICRTC-2015)
Keywords: FPGA; Verilog HDL; EMD; QRS; ECG; MIT-BIH; Heart Arrhythmia.
1. Introduction
Electrocardiogram (ECG) is one of the important tools used by the cardiologists to analyze the ECG waveforms
in diagnosis of various diseases and monitoring the conditions associated with the heart. It is obtained by
placing electrodes on the skin of the patient. It provides information of a human heart like disturbances in heart
rhythm, abnormalities in the electrical impulses etc. Signal corruption takes place due to noise [1] and artifacts
during the transmission of ECG. The characteristics of ECG signal vary due to different types of noises like
Power Line Interferences, Baseline drifts, Motion Artifacts, EMG, Instrumentation noise etc. Such a noisy
signal analyzation bound to give erroneous results. Thus it is important to denoise or enhance the ECG signal.
A number of methods have been implemented for the Enhancement of ECG signal. These include use of Neural
Networks, PCA, Filter banks [2], ICA [3], Adaptive Filtering [4], wavelet transform [5-7] etc. In this paper, we
1877-0509 © 2015 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license
(http://creativecommons.org/licenses/by-nc-nd/4.0/).
Peer-review under responsibility of organizing committee of the 3rd International Conference on Recent Trends in Computing 2015 (ICRTC-2015)
doi:10.1016/j.procs.2015.07.495
L.V. Rajani Kumari et al. / Procedia Computer Science 57 (2015) 970 – 979 971
used a recent technique called Empirical Mode Decomposition (EMD) which is a time frequency analysis
method suitable for mainly non linear and non stationary signals like ECG. After Enhancement, ECG Feature
extraction involves extracting useful information like R peaks, detection of different heart arrhythmias etc. As
R wave is the most dominant wave in the ECG signal, we detect the R peaks calculate RR intervals and heart
rate based on which different arrhythmias are detected. Here, we implemented a QRS detection algorithm,
which detects R peaks by using Threshold Methodology. This design is implemented on Xilinx Spartan 3E
FPGA board.
The paper is designed as follows: Section II describes the Theoretical aspects of empirical mode decomposition
and QRS Detection Algorithms. Section III describes the methodology of the proposed techniques, Simulation
and Synthesis results are shown in Section IV and the conclusions of the paper are shown in Section V. The
block diagram of the proposed method is shown in Fig. 1.
2. Theoretical Background
The EMD method which is a new non-linear technique has been recently developed by N.E Huang et al. [8] for
representing the non stationary signals like ECG. The basic principle of EMD is to decompose a signal into a
finite number of IMFs [17][18]. The extracted IMFs satisfy the following requirements:
(a) The maximum difference between the number of extrema and the number of zero crossings must be one in
the entire data set.
(b) At any point, the mean value of envelope defined by local maxima and local minima is zero.
A systematic way to extract the IMFs is called the Sifting Process and its algorithm is given below
A. Sifting Process
Step 1) Identify all the maxima and minima of the original signal x(t ) .Interpolate between maxima and
minima to obtain xmax (t ) and xmin (t ) .
Step 2) The mean or average between the two envelopes is calculated as xavg (t ) [ xmax (t ) xmin (t )] / 2
Step 3) The candidate IMF d1 (t ) is calculated i.e.
d1 (t ) x(t ) xavg (t ) . Here d1 (t ) is given as the input to the next iteration process.
As the resulting signals do not carry significant physical information after a certain number of iterations. To
prevent this, we go for some boundary conditions. The sifting process is stopped by limiting the normalized
.
972 L.V. Rajani Kumari et al. / Procedia Computer Science 57 (2015) 970 – 979
2
L 1 d k 1 (t ) d k (t )
SD ¦
t 0 d 2 k 1 (t )
The Standard Deviation is set between 0.2 and 0.3[3] to obtain proper results.
n
Step 6) The sifting process is stopped until the residue function r (t ) x(t ) ¦ hi (t ) becomes a monotonic
i 1
function in which no more IMF’s can be extracted.
Thus, the original signal x(t ) is decomposed into the n IMFs h1 (t ), h2 (t ),........hn (t ) and a final residue
signal which can be denoted as
N
x(t ) ¦ h (t ) r
k 1
k N (t )
Where N= no of rounds of sifting process performed on the given signal x(t ) .
The QRS complex is one of the most distinct features in an ECG waveform. Amplitude, width and its
morphology play a very important role in the diagnosis of various cardiac ailments. Many new
approaches vary from the use of Hilbert Transform [16], wavelet transforms [15], which are mostly based
on non-linear transformations [10].The frequency components of QRS complex of ECG waveform is from 10
to 25 Hz. Therefore low pass filter is needed for suppressing noise and the attenuation of P and T waves. The
filtered signal is then used to extract the R Peak by comparing it to a threshold value.
3. Methodologies
In EMD Technique, Enhancement of ECG signal is done by expressing the noisy ECG signal as the sum of a
series of IMFs. The noisy components are mostly found in the initial IMFs [I3] among the finite set of IMFs
generated. It is important to determine whether noise is present in a particular IMF or not. In order to determine
L.V. Rajani Kumari et al. / Procedia Computer Science 57 (2015) 970 – 979 973
this, Spectral Flatness (SF) measure is used here. The proposed denoising method using EMD is shown in Fig 2
and the different steps to be followed are explained below
¦ H ( n)
n 0
L
If the Spectral Flatness is above the threshold T for the 1st n IMF’s then they are considered as noisy IMFs. The
threshold value T is taken as 0.09. Here L=Length of the signal.
Step 4: Using a band pass Butterworth filter of order 10 with pass band of 40-60Hz [12], the 1st IMF is filtered
since significant part of the high frequency content of ECG is in this range. The remaining noisy IMFs are
filtered using low pass butter worth filter of same order with cut off frequency of 60Hz to extract the significant
signal components.
Step 5: The original ECG signal is obtained by adding the filtered IMFs and the remaining signal IMFs. The
reconstructed signal xˆ (t ) is given by
n
~ N
xˆ (t ) ¦ h (t ) ¦ h (t ) r
k 1
k
k n 1
k N (t )
~
Where hk (t ) is the filtered version of hk (t ) .
.
974 L.V. Rajani Kumari et al. / Procedia Computer Science 57 (2015) 970 – 979
One of the approaches based on filtering suggested by Yun-Chi Yeh [11] was implemented in the hardware
with a few modifications. Difference Operation Method [11] is one of the simple and fast methods in detecting
QRS complexes. The basic principle of this method is to find the R peak by applying difference operation to
the ECG signal. Complex mathematical calculations such as cross-correlation, Fourier transform etc. are not
involved in this method. It mainly involves finding the difference signal or the derivative. Therefore basic
calculus is used for finding the peak points. The algorithm for the difference operation method is described
below: The difference operation is first implemented according to the following steps:
Step1) Take the original ECG signal as x (t) and derivative signal as d (t).
Step2) the difference or derivative signal of x (t) is given as
D (t) = x (t)-x (t-1).
Step3) Then the difference signal is passed through a low pass filter to obtain xdf (t).
Step4) Threshold logic is applied for finding the peak points.
Design:
The design can be divided into two main sections. The first section is the pre-processing stage. This was where
the derivative and filtering are implemented. The second section is the peak detection stage where the peaks are
detected. The block diagram of the proposed design is shown below:
A) Pre-ProcessingStage
Below Fig 4(a)-4(c) show the stages that are involved in the Preprocessing Stage.
Threshold Methodology:
We consider the initial Threshold value as 30% of the maximum value of all samples. Then the input sample is
compared to the threshold value. All the data samples below the threshold value are removed. Then we search
for three consecutive samples among which peak value can be detected. A sample value is considered as a peak
value such that if its preceding and succeeding values must be less than the sample value i.e. if n is a sample
then its preceding n-1sample and its succeeding n+1sample must be less than the sample n. Then n is
considered as the peak value. Thus peak is detected based on the Threshold Methodology. The result of Peak
detection stage is shown in the above Fig 4(d).After detecting the R peaks, calculate the R-R interval and Heart
Rate to detect Arrhythmias.
For detection of Arrhythmias, first we need to know the Heart rate of different Arrhythmias. It is shown in the
below Table I.
Heart Rate = (60/RR Interval) BPM
The proposed method is evaluated by using MIT-BIH Normal Sinus Rhythm database (nsrdb), Supra
Ventricular Arrhythmia database (svdb), Atrial Fibrillation database (afdb) and Arrhythmia database (mitdb).
The effectiveness of the proposed method in detecting the diseases with the overall accuracy of 94.76% is
shown in the below Table II. Fig 5 shows the Denoising result using EMD. Fig 6 shows the result of Top level
Design. Fig 7 and Fig 8 shows Block Diagram and synthesized RTL schematic of top level of our proposed
design.
Fig 5(a) Input ECG Signal Fig 5 (b) Noisy ECG Signal
.
976 L.V. Rajani Kumari et al. / Procedia Computer Science 57 (2015) 970 – 979
Fig 5(c) Denoised Signal Fig 5 Overall Simulation Result of Denoising Using EMD
Fig 6: Simulation result of Top Level design (Both denoising and Heart Rate Calculation)
Fig 7: Block Diagram of our proposed design Fig 8: RTL Schematic generated by the Synthesis Tool.
Fig (9-12) shows the Simulation Results of four different data records calculating Heart Rate and detecting corresponding Arrhythmias.
The proposed model is implemented upon XILINX SPARTAN XC3S500 FPGA board processor.
Fig15:Green Light(LED-D11) indicating the detected Fig16:Green Light(LED-C11)indicating the detected disease as
detected disease as ATRIAL FIBRILLATION VENTRICULAR TACHYCARDIA
.
978 L.V. Rajani Kumari et al. / Procedia Computer Science 57 (2015) 970 – 979
Table II: shows accuracy rate of the algorithm in detecting three diseases i.e. Normal Sinus Rhythm, Supra Ventricular Arrhythmia and
Atrial Fibrillation tested with the respective MIT-BIH Databases.
5. Conclusions
An efficient method for arrhythmia detection has been developed based on heart rate. EMD based method for
denoising of ECG signal is proposed in which Automatic detection of noisy IMFs is done using Spectral
Flatness measure. After Enhancement, R Peak detection, the most relevant feature of an ECG waveform is
done using Threshold methodology. Once R peak is detected, RR interval is calculated to estimate the heart
rate for arrhythmia detection. This design is implemented on Xilinx Spartan 3E FPGA board using Verilog
language. The implemented design tool (Xilinx ISE), uses only 38% of the resources available in a small sized
FPGA device (Xilinx Spartan XC3S500) and is able to compute the heart rate of the signal and detect the
arrhythmia (through LED).The performance of proposed method is evaluated using different arrhythmia data
records of MIT-BIH databases. Till now the analysis is done with R-peak but in future the work will go on with
the other peaks too as some heart arrhythmias depends not only on the R-R interval but also P, T waves. Our
system can’t detect those kinds of arrhythmias. The algorithm can be modified further to calculate all the ECG
parameters automatically at the output. Thus, it can be used for the processing of real time ECG signals in
future.
References
[1] Anil Chacko, Samit Ari,“ Denoising of ECG Signals using Empirical Mode Decomposition based Technique,”IEEE- International
Conference on advances in Engineering Science and Management(ICAESM-2012)March 30,31,2012.
[2] V.X. Afonso, W.J. Tompkins, T.Q. Nguyen, K. Michler & S. Luo,“ Comparing stress ECG enhancement algorithms” , IEEE Eng. Med.
Biol. Mag. 15 (3) , pp. 37–44, 1996.
[3] V. Almenar, A.Albiol, “A new adaptive scheme for ECG enhancement”, Signal Process. 75 (3), pp. 253-263, 1999.
[4] A.K.Barros A. Mansour & N. Ohnishi, “Removing artifacts from electrocardiographic signals using independent components analysis”,
Neuro computing 22, pp. 173–186, 1998.
[5] Mohammed AlMahamdy, H.Bryan Riley, “Performance study of Different Denoising Methods for ECG Signalsl”,Procedia Computer
Science, Volume 37,2014,Pages 325-332.
[6] C.Y.-F. Ho, B.W.-K.Ling, & T.P.-L.Wong“Fuzzy multi wavelet denoising on ECG signal”, Electron. Lett39 (16), pp.1163–1164, 2003.
[7] E. Ercelebi, “Electrocardiogram signals de-noising using lifting based discrete wavelet transform”, Comput Biol. Med.34 (6), pp,479 –
493, 2004.
[8] N. E. Huang, Z. Shen, S. R. Long, M. C. Wu, H. H. Shih, Q. Zheng ,N. C. Yen, C. C. Tung, and H. H. Liu, “The empirical mode
decomposition and the Hilbert spectrum for nonlinear and non-stationary time series analysis,Proc.Roy.Soc.Lond.A 454(1998)903-906.
[9] Hualao Ling, Qiu-Hua Lin, and J.D.X. Chen, “Application of the Empirical Mode decomposition to the analysis of Esophageal Reflux
Disease,” IEEE Transactions on Biomedical Engineering, Vol.52, No.10, 2005.
[10]. Andre Vander Vorst, Arye Rosen, Youji Kotsuka, RF/Microwave Interaction with Biological Tissues (IEEE Press, John Wiley
and Sons Inc.2006).
[11] Yun-Chi Yeh, Wen-June Wang, “QRS complex detection for ECG signal: The Difference Operation Method”, Computer Methods
and Programs in Biomedicine 9I (2008) 245-254.
[12] A. Karagiannis, and P. Constantinou, "Noise-Assisted Data Processing With Empirical Mode Decomposition in Biomedical Signals,
L.V. Rajani Kumari et al. / Procedia Computer Science 57 (2015) 970 – 979 979