Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Journal of Recent Research in Engineering and Technology, 3(10), OCT 2016, PP.31-41
ISSN (Online): 2349 –2252, ISSN (Print):2349 –2260 © Bonfay Publications, 2016
31
Research Article
DESIGN OF EFFICIENT FILTER FOR ECG- BASED PROCESSOR
1S.Manjulambigai , 2Dr. J.Jaya MTech., PhD 1M.E., Applied Electronics, Akshaya college of Engineering and Technology.
[email protected] 2Principal, Akshaya college of Engineering and Technology.
Received 20 Sep 2016; Accepted 24 OCT 2016
Abstract
ECG (Electrocardiogram) is considered to be a must have feature for a medical diagnostic imaging system. Electrocardiogram (ECG), a noninvasive technique is used as a primary diagnostic tool for cardiovascular diseases. A cleaned ECG signal provides necessary information about the electrophysiology of the heart diseases and ischemic changes that may occur. It provides valuable information about the functional aspects of the heart and cardiovascular system. The objective of the work is to automatic detection of cardiac arrhythmias in ECG signal. Recently developed digital signal processing and pattern reorganization technique is used in this project for detection of cardiac arrhythmias. The detection of cardiac arrhythmias in the ECG signal consists of following stages: detection of QRS complex in ECG signal; feature extraction from detected QRS complexes; classification of beats using extracted feature set from QRS complexes. The system is designed using Verilog HDL and implemented using Xilinx ISE tool. FPGAs (Field Programmable Gate Arrays) are finding wide acceptance in medical systems for their ability for rapid prototyping of a concept that requires hardware/software co-design, for performing custom processing in parallel at high data rates and be programmed in the field after manufacturing. Medical companies can now move over to FPGAs saving cost and delivering highly-efficient upgradable systems.
Keyword
ECG signal, QRS complex, Xilinx ISE tool, Verilog HDL, Field Programmable Gate Arrays
1. INTRODUCTION
1.1 Electrocardiogram
Electrocardiogram (ECG) is a diagnosis
tool that reported the electrical activity of
heart recorded by skin electrode. The
morphology and heart rate reflects the
cardiac health of human heart beat [1]. It
is a noninvasive technique that means
this signal is measured on the surface
of human body, which is used in
identification of the heart diseases [2].
Any disorder of heart rate or rhythm, or
change in the morphological pattern, is
an indication of cardiac arrhythmia,
which could be detected by analysis of the
recorded ECG waveform. The amplitude
S.Manjulambigai Journal of Recent Research in Engineering and Technology
40
and duration of the P-QRS-T wave
contains useful information about the
nature of disease afflicting the heart. The
electrical wave is due to depolarization
and re polarization of Na+ and k- ions in
the blood [2].The ECG signal provides the
following information of a human heart
[3]:
Heart position and its relative
chamber size
Impulse origin and propagation
Heart rhythm and conduction
disturbances
Extent and location of myocardial
ischemia
Changes in electrolyte
concentrations
Drug effects on the heart.
ECG does not afford data on cardiac
contraction or pumping function.
1.2 The heart anatomy
The heart contains four
chambers that is right atrium, left
atrium, right ventricle, left ventricle and
several atrioventricular and sinoatrial
node as shown in the fig1.1 [1]. The
two upper chambers are called the left
and right atria, while the lower two
chambers are called the left and right
ventricles. The atria are attached to the
ventricles by fibrous, non-conductive
tissue that keeps the ventricles
electrically isolated from the atria. The
right atrium and the right ventricle
together form a pump to the circulate
blood to the lungs. Oxygen-poor blood is
received through large veins called the
superior and inferior vena cava and
flows into the right atrium.
The right atrium contracts and
forces blood into the right ventricle,
stretching the ventricle and maximizing
its pumping (contraction) efficiency. The
right ventricle then pumps the blood to
the lungs where the blood is oxygenated.
Similarly, the left atrium and the left
ventricle together form a pump to
circulate oxygen-enriched blood
received from the lungs (via the
pulmonary veins) to the rest of the body
[4].
Figure 1.1 The Heart conduction
systems
In heart Sino-atrial (S-A) node
spontaneously generates regular
electrical impulses, which then spread
through the conduction system of the
heart and initiate contraction of the
myocardium. Propagation of an electrical
impulse through excitable tissue is
achieved through a process called
depolarization. Depolarization of the
Journal of Recent Research in Engineering and Technology S.Manjulambigai
35
heart muscles collectively generates a
strong ionic current [1]. This current
flows through the resistive body tissue
generating a voltage drop. The magnitude
of the voltage drop is sufficiently large to
be detected by electrodes attached to the
skin. ECGs are thus recordings of voltage
drops across the skin caused by ionic
current flow generated from myocardial
depolarisations[5]. Atrial depolarization
results in the spreading of the electrical
impulse through the atrial myocardium
and appears as the P-wave. Similarly,
ventricular depolarization results in the
spreading of the electrical impulse
throughout the ventricular myocardium.
1.3 Motivation
The state of cardiac heart is
generally reflected in the shape of ECG
waveform and heart rate. ECG, if properly
analyzed, can provide information
regarding various diseases related to
heart. However, ECG being a non-
stationary signal, the irregularities may
not be periodic and may not show up all
the time, but would manifest at certain
irregular intervals during the day.
Clinical observation of ECG can hence
take long hours and can be very
tedious. Moreover, visual analysis cannot
be relied upon and the possibility of the
analyst missing the vital information is
high. Hence, computer based analysis
and classification of diseases can be very
helpful in diagnosis. Various
contributions have been made in
literature regarding beat detection and
classification of ECG signal. Most of them
use either time or frequency domain
representation of the ECG waveforms,
on the basis of which many specific
features are defined, allowing the
recognition between the beats belonging
to different classes. The most difficult
problem faced by today’s automatic ECG
analysis is the large variation in the
morphologies of ECG waveforms.
Moreover, we have to consider the time
constraints as well. Thus our basic
objective is to come up with a simple
method having less computational time
without compromising with the
efficiency. This objective has motivated
me to search and experiment with various
techniques. In this project, R-peak
detection of ECG signal is implemented
using the properties of autocorrelation
and Hilbert transform and classification
has been done using multilayer
perceptron (MLP) and radial basis
function (RBF), taking the features as
temporal features, heart beat interval
features and ECG morphological features.
2. PROCESSORS FOR PROCESSING ECG
SIGNALS
This section discusses the methods that
have been used for implementing ECG.
2.1 TRADITIONAL METHOD
The traditional methods involve using
leads to detect heart rate. The
standard 12-lead electrocardiogram is a
representation of the heart's electrical
activity recorded from electrodes on the
body surface. The electrical signals then
get passed on to a data logger system that
performs all the necessary signal
S.Manjulambigai Journal of Recent Research in Engineering and Technology
40
processing and shows an ECG waveform
on the screen. This method is widely used
in diagnostic centers. [4,5]
2.2 PULSE OXIMETRY
This method uses the principle of light
absorbance to determine oxygenated
blood from deoxygenated. In doing so, it
then calculates the heart rate and an ECG.
Pulse oximetry uses a sensor which is
placed on a sensitive part of the body,
usually fingertip or earlobes. The basic
idea is to pass light of two different
wavelengths through the body. Typically,
light emitting diodes (LEDs) are used in
this process. One emits red light while the
other emits infrared light.
The absorption of light depends on the
wavelengths as well as the blood inside
the human body.
Absorption of radiation as a function of
wavelength is calculated. Absorption of
both the lights differs significantly for
oxygenated and deoxygenated blood as it
depends on the amount of oxygen
present. Based on it, the device can
determine a heartbeat or a pulse. In
smartphone apps, the camera is used to
emit light. Placing one’s fingertip on the
camera is same as placing it on a sensor of
a pulse oximetry device. The app triggers
the phone to emit light of certain
wavelengths and then calculates the heart
rate.
3. ECG SIGNAL PROCESSOR
Figure 3.1 ESP Architecture
3.1 ESP Architecture
The architecture includes the
modules of the three stages along with a
main FSM that controls the flow of the
data between the different stages. The
processing of the data is done using fixed
point representation. The digitized ECG
data are applied in series (from
testbench) at the input to the
preprocessing stage with a resolution of 8
bit, while a variable number of bits were
utilized in the different stages to enhance
the accuracy and avoid truncations
errors.
3.2 Stages in ESP
The system consists of three main
stages, which are the ECG preprocessing,
feature extraction, and classification, as
shown in Fig. 3.2. . In the first stage, the
ECG preprocessing is responsible for
three tasks: 1) ECG filtering; 2) QRS
complex detection; and 3) T and P wave
delineation. After that, the QRS complex is
Journal of Recent Research in Engineering and Technology S.Manjulambigai
35
detected using the Pan and Tompkins
(PAT) algorithm. In the final stage, naive
Bayes algorithm is used to identify the
signals that are susceptible to ventricular
arrhythmia.
Samples
( Input ROM)FIR Filter
Filtered samples in
RAM
Classifier
(Naive Bayes)
P-QRS-T
(PAT Algorithm)
Classifier
(Naive Bayes)
Figure 3.2 Stages in ECG Signal
Processor
3.2.1 Preprocessing Stage
In the first stage, the ECG
preprocessing is responsible for three
tasks: 1) ECG filtering; 2) QRS complex
detection; and 3) T and P wave
delineation. The ECG filtering removes
the noise coupled with the ECG signal and
prepares it for further analysis. 1) ECG
Filtering: The block diagram of the
preprocessing stage. FIR Band pass
filtering of the raw ECG signal is the first
step in which the filter isolates the
predominant QRS energy centered at 10
Hz, and attenuates the low frequencies
characteristic of the P and T waves,
baseline drift, and higher frequencies
associated with electromyographic noise
and power line interference. The main
important point is not to lose the
information carried by the ECG signal
after being filtered out.[6]
Figure 3.3 FIR Filter
FIR Equiripple filter, windowing
FIR filters with Kaiser, Rectangular,
Hamming, Hanning and Blackman
functions are designed. The basic
specifications for design of filter are:
1. Cut-off frequency 0.5Hz
2. Sampling frequency 360Hz (MIT/BIH
database sampled at 360 Hz )
[8]The other parameters are pass-
band ripples and stop-band ripples. In the
design of FIR equiripple design, pass-
band ripple is 1 dB, stop-band ripple is 30
dB and the order of the filter was found to
be 320. The transition band of this filter is
approximately 0.5 Hz. The phase delay is
2.8 rad/ Hz. In case of window filters, cut-
off frequency at the 3 dB point is 0.5 Hz.
The window length in case of rectangular
and Kaiser Window is 451 which is
selected according to filter order 450
(window length is order plus one). The
phase delay is 3.92 rad/Hz. But in other
windows, order becomes very high and
reaches up to 1500 and it increase the
phase delay to 13.08rad/Hz.
S.Manjulambigai Journal of Recent Research in Engineering and Technology
40
3.3.2 P-QRS-T (PAT Algorithm)
Figure 3.4 P-QRS-T detection using
PAT Algorithm
The delineation of T and P waves is
based on a novel technique proposed in
figure 3.4. The method is based on
adaptive search windows along with
adaptive thresholds to accurately
distinguish T and P peaks from noise
peak. In each heartbeat, the QRS complex
is used as a reference for the detection of
T and P waves in which two regions are
demarcated with respect to R peaks.
These regions are then used to form the
forward and backward search windows of
the T and P waves. A forward search
window is assumed to contain the T wave,
and the boundaries are extended from the
QRS offset to two third of the previously
detected RR interval. [9]
Similarly, a backward search
window for the P wave is identified and
extended from the QRS onset backwardly
to one third of the previous RR interval.
The position of T and P peaks is
demarcated in their respective search
windows by finding the local maximum
or/and local minimum that are above the
associated thresholds. The thresholds,
given and are modified in each heartbeat
based on the most recent detected values
in the last 3 s. The technique of computing
the thresholds. By comparing the local
maximum or/and the local minimum
points with the thresholds, the waveform
morphology of each wave is identified
[positive monophasic, inverted, or
biphasic (+, −)/(−, +)]. [10]
If the value of T or P peak is
greater than the associated threshold,
then the T or P wave has a positive
monophasic waveform, and the local
maximum is stored to give a probable
position of the peak. Otherwise, the
waveform is identified as inverted, and
the local minimum of the ECG signal
within the same window is the correct
peak. In case of biphasic wave, both the
local maximum and the absolute value of
the local minimum should be greater than
the threshold.[11]
The method traces the onset and
offset values of the P-QRS-T waves by
finding the sample corresponding to the
zero slope of the entitled ECG signal. The
sample point that has a zero slope and
former to the peak is identified as the
Journal of Recent Research in Engineering and Technology S.Manjulambigai
35
onset point. Similarly, the offset point is
determined at other side of the peak.
Sometimes, however, a derivative sign
change occurs, which reflects a false
indicator. To solve this, the method adds
another criterion for a correct delineation
of the wave boundaries based on the fact
that the fiducial points tend to merge
smoothly with the isoelectric line. The
isoelectric line is approximated as the
average value of the beat signal after
removing the QRS complex. This idea is
utilized and combined with the zero slope
for an accurate and reliable delineation of
the fiducial points. The general FSM
which illustrates the delineation process
of T and P waves.[12]
4. RESULTS AND DISCUSSION
The ECG Signal Processor is
designed using Verilog HDL and
implemented using Xilinx ISE and
simulated using Modelsim 6.5e. The Xilinx
tool procedure is as follows.[13]
4.1 Result Discussion
The memory for storing the ECG
samples is done using the ROM design.
The FIR filter is designed which takes the
input from the ROM. The FIR is a 4 tap
filter that has one input and four
coefficients is shown in the figure 4.1.
Figure 4.1 FIR Filter
The QRS complex is detected using
the Pan and Tompkins (PAT) algorithm.
Finally, T and P waves are delineated, and
the corresponding fiducial points (P
onset, P peak, P offset, T onset, T peak,
and T offset) are extracted.
Figure 4.2 PAT Algorithm
S.Manjulambigai Journal of Recent Research in Engineering and Technology
40
Figure 4.3 Naive Bayes classifier
The Naive Bayes classifier is used
to classify the ECG signal naive Bayes
algorithm is used to identify the signals
that are susceptible to ventricular
arrhythmia. There are many reasons for
choosing the naive Bayes. First, the ECG
features have shown strong potential in
the prediction of ventricular arrhythmia
with a p-value < 0.001. Second, it was
intended to investigate the performance
of the system without introducing the
strong biasing effect of a classifier. The
normal and abnormal signal indicates
that the sample is normal or
abnormal.[14,15]
Figure 4.4 Top Module
4.2 Simulation output
Initially the input ECG samples are
stored in the ROM. Then they are
processed by the FIR filter and the filtered
output is stored in the RAM. Then by
fetching the data from the RAM the data is
given to PAT algorithm for P-QRS-T
detection. The PAT algorithm gives the
proper ECG signal to the Naive Bayes
classifier. The Classification is done by
comparing the received ECG signal with
the normal and abnormal data base. The
simulation output for the ESP is shown in
the figure 4.5. The comparison part of the
Naive Bayes classifier is shown in the
figure 4.6. The classifier takes the
average of the input ECG values from the
PAT algorithm and compares it with the
average values of the normal and
abnormal values. If the data Naive Bayes
classifier is normal the output will assert
the normal flag or if it is the abnormal
values abnormal flag is asserted.
Journal of Recent Research in Engineering and Technology S.Manjulambigai
41
Figure 4.5 Simulation output of the ESP
Figure 4.6 Simulation output of the Naive Bayes classifier
S.Manjulambigai Journal of Recent Research in Engineering and Technology
40
The summary of the design is listed below.
Figure 4.7 Summary of the design
Detailed Summary
Macro Statistics
# RAMs
: 1
6x16-bit dual-port distributed
RAM : 1
# ROMs
: 3
16x16-bit ROM
: 2
16x8-bit ROM
: 1
# Multipliers
: 4
8x8-bit registered multiplier
: 4
# Adders/Subtractors
: 6
16-bit adder
: 6
# Counters
: 7
3-bit up counter
: 1
4-bit up counter
: 6
# Registers
: 251
Flip-Flop
: 251
# Comparators
: 8
16-bit comparator equal
: 2
16-bit comparator greater
: 2
4-bit comparator great equal
: 2
4-bit comparator less
: 2
# Multiplexers
: 3
Journal of Recent Research in Engineering and Technology S.Manjulambigai
41
16-bit 8-to-1 multiplexer
: 3
The design summary includes logic cell
utilization and area utilization This is
listed below.
Design Statistics
# IOs : 20
Cell Usage:
# BELS : 588
# GND : 1
# INV : 11
# LUT1 : 13
# LUT2 : 129
# LUT3 : 90
# LUT3_D : 1
# LUT3_L : 1
# LUT4 : 101
# MUXCY : 124
# MUXF5 : 20
# VCC : 1
# XORCY : 96
# FlipFlops/Latches : 265
# FDC : 9
# FDCE : 141
# FDE : 51
# FDR : 64
# RAMS : 16
# RAM16X1D : 16
# Clock Buffers : 1
# BUFGP : 1
# IO Buffers : 19
# IBUF : 1
# OBUF : 18
# MULTs : 4
# MULT18X18SIO : 4
AREA
Number of Slices: 219
out of 2448 8%
Number of Slice Flip Flops: 265
out of 4896 5%
Number of 4 input LUTs: 378
out of 4896 7%
Number used as logic: 346
Number used as RAMs: 32
Number of IOs: 20
Number of bonded IOBs: 20 out
of 158 12%
Number of MULT18X18SIOs: 4 out
of 12 33%
Number of GCLKs: 1 out
of 24 4%
Timing Summary:
Minimum period: 6.926ns (Maximum
Frequency: 144.387MHz)
Minimum input arrival time before
clock: 4.015ns
Maximum output required time after
clock: 4.063ns
Delay
Delay: 6.926ns (Levels of Logic =
4)
Frequency
Frequency: 144.387MHz
Chapter 5
Conclusion and Future Work
5.1 Conclusion
In this project, a fully integrated
digital ESP for the prediction of
ventricular arrhythmia that combines a
unique set of ECG features with naive
Bayes was proposed. Real-time and
S.Manjulambigai Journal of Recent Research in Engineering and Technology
40
adaptive techniques for the detection and
delineation of the P-QRS-T waves were
investigated and employed to extract the
fiducial points. The combination of these
features has never been used in any
previous detection or prediction system.
The processor is designed using Verilog
HDL and implemented using Xilinx ISE
14.2.
5.2 Future Work
The preprocessing stage in the
processor can be modified. In the
processor the stage has the FIR filter. In
the future the FIR filter can be replaced
using IIR filter. IIR filters are harder to
design than the FIR filters, but the
benefits are extraordinary: IIR filters are
an order of magnitude more efficient than
an equivalent FIR filter. Even though FIR
is easier to design, IIR will do the same
work with fewer components, and fewer
components translate directly to less
money.
References
[1] R. Acharya, J. S. Suri, J. A.E. Spaan and
S .M. Krishnan, Advances in Cardiac Signal
Processing, springer, pp. 1-50.
[2] W. J. Germann and C. L. Standield,
“Principles of Human Physiology,”
Benjamin Cummings, San Francisco, 2002.
[3] A. J. Moss and S. Stern., “Noninvasive
Electro cardiology,” Clinical Aspects of
Holter, London, Philadelphia, W.B.
Saunders, 1996.
[4] M. Gabriel Khan, “Rapid ECG
interpretation” Third edition, 2003.
[5] Francis Morris, June Edhouse,
William J Brady, John Camm, “ABC of
Clinical Electrocardiography,” BMJ
Books, 2003.
[6]
http://en.wikipedia.org/wiki/Electrocard
iography.
[7] Y.C. Yeha, and W. J. Wang, “QRS
complexes detection for ECG signal The
Difference Operation Method (DOM),”
Computer methods and programs in
biomedicine, vol. 9, pp. 245–254, 2008.
[8] R.M. Rangayyan, Biomedical Signal
Analysis: A Case-study Approach,
Wiley–Interscience, New York, pp. 18–
28, 2001.
[9] G.M. Friesen, T.C. Jannett, M.A.
Jadallah, S.L. Yates, S.R. Quint, and H.T.
Nagle, “A comparison of the noise
sensitivity of nine QRS detection
algorithm,” IEEE Trans. Biomed. Eng. Vol.
37, pp. 85–98, 1990.
[10] MIT-BIH Database distribution,
Massachusetts Institute of Technology, 77
Massachusetts Avenue, Cambridge, MA
02139,1998.http://www.physionet.org/p
hysiobank/database/mitdb/
[11] B.U. Kohler, C. Henning, and R.
Orglmeister, “The principles of software
QRS detection,” IEEE Eng. Med. Biol.
Vol. 21, pp. 42–57, 2002.
[12] T.Ince, S. Kiranyaz, and M.
Gabbouj, “A generaric and robust
system for automated patient-specific
classification of ECG signals,” IEEE Trans.
Biomed. Eng. vol. 56, pp. 1415-1426,
2009.
[13] American National Standard for
Ambulatory Electrocardiographs,
publication ANSI/AAMI EC38-1994,
Association for the Advancement of
Medical Instrumentation, 1994.
Journal of Recent Research in Engineering and Technology S.Manjulambigai
41
[14] Omern T. Inan. L. Giovangrandi, and
T. A. Kovacs, “Robust Neural network
based classification of Premature
Ventricular Contraction using wavelet
transform and time interval features,”
IEEE Trans. Biomed. Eng. vol. 53, pp.
2507-2515, 2006.
[15] P.de Chazal, M.O. Duyer, and R.B.
Reilly, “Automatic classification of
heartbeat using ECG morphology and
heart beat interval features,” IEEE Trans.
Biomed. Eng. vol. 51, pp. 1196-1206,
2004.