Professional Documents
Culture Documents
Early Myocardial Infarction Detection by Joshi Etal BMD
Early Myocardial Infarction Detection by Joshi Etal BMD
By
Kasturi Joshi
Edward Labrador
(Team # 17)
A Project Report
Presented to
The Faculty of Department of General Engineering
San Jose State University
In Partial Fulfillment
Of the Requirements for the Degree
Master of Science in Engineering
May 2009
2009
Kasturi Joshi
Edward Labrador
We would like to express our gratitude to Prof. Dr. Mallika Keralapura, Dept of Electrical
Engineering, San Jose State University and Dr. Sudhi Gautam for their generous guidance,
encouragement, direction and support in completing this project.
We would like extend our sincere gratitude to Prof. Leonard P. Wesley, Dept. of Computer
Engineering for an opportunity to pursue ENGR 298 course under his guidance, precious
suggestions, and advice.
We would also like to extend our special thanks to the members of our family. Without their
support and encouragement this project would not be complete.
- Kasturi Joshi
- Edward Labrador
I.
Objective
The objective of this project is to create a smart algorithm that can detect the elements of
an electrocardiogram (ECG) and determine if symptoms of myocardial infarction are present.
The algorithm is written in MATLAB, but when coupled with a portable ECG machine, can
provide greater protection against mortality and morbidity associated to myocardial infarction.
II.
Introduction
Right Atrium: This chamber consists of de-oxygenated blood that returns from the body,
this de-oxygenated blood is then passed on to the Right Ventricle through the tricuspid
valve.
Tricuspid Valve: It is a one-way valve that controls the flow of blood from the Right
Atrium to the Right Ventricle.
Right Ventricle: It is a chamber that consists of de-oxygenated blood which is passed into
the lungs for oxygenation via the pulmonary valve.
Pulmonary Valve: It is a one-way valve that controls the flow of blood from Right
Ventricle to the pulmonary arteries.
Pulmonary Arteries: These arteries supply de-oxygenated blood to the lungs where the
blood gets oxygenated.
Pulmonary Veins: After the blood passes to the lungs from the pulmonary arteries, the
blood gets oxygenated and flows from the lungs to the pulmonary veins, the pulmonary
veins supply the oxygenated blood from the lungs to the Left Atrium.
Left Atrium: This is the chamber where the oxygenated blood enters from the pulmonary
vein. The blood from the left atrium is then forced into the left ventricle via the mitral
valve.
Mitral Valve: It is a one-way valve that controls the flow of blood from the left atrium to
the left ventricle.
Left Ventricle: The oxygenated blood enters the left ventricle through the mitral valve
and is then forced from the left ventricle into the aorta through the aortic valve.
Aortic Valve: It is a one-way valve that controls the flow of blood from the left ventricle
to the aorta.
Aorta: It is largest artery in the body and the aorta branches into smaller arteries. The
aorta carries the oxygenated blood from the heart to the other parts of the body.
The Texas Heart Institute gives some interesting and fun facts about heart and they are
listed below:
Heart Weighs between 7 and 15 ounces (200 to 425 grams) and is little larger than the
size of the fist
In a day, heart pumps 2,000 gallons (7,571 liters) of blood and the heart beats 100,000
times
Figure 2: Electrical Conduction System of the Heart Bundle Branch Block of Heart [Source:
Heart Information Center (2006)]
The ventricular contraction is brought about by the bundle of His which receives the
triggering impulse from the AV node. The bundle of His then divides the impulse into the left
bundle branch and the right bundle branch, which in turn contracts the left and right ventricles.
The contraction and the relaxation of the heart muscles thus brought about by the SA and the AV
nodes is wavelike and in rhythm. The rhythmic wavelike activity can be heard by the doctors
using the stethoscope. It can also be imaged using echocardiography that uses the principle of
ultrasound or heart imaging. Electrocardiography is another diagnostic tool for monitoring the
rhythmic electrical activity of the heart. Subsequent sections will introduce the principle behind
electrocardiography along with its advantages and disadvantages.
This rhythmic electrical activity of the heart sometimes is lost and the electrical impulse
cannot travel throughout the heart because part of the hearts conduction system is blocked
(Heart Information Center, 2006) due build of plaque, cholesterol deposits in the arteries that
supply blood to the heart. This is one of the reasons that lead to the arrhythmic electrical activity
of the heart. There are several ways to diagnose the cause of loss of rhythm in the conduction of
V.
Myocardial Infarction
Emboli - from left sided mural thrombosis, vegetative endocarditis, or paradoxic emboli
from the right side of heart through a patent foramen ovale (Klatt E.C, 2008).
Narrowing and hardening of heart muscles is process that is known in the medical terms
as Atherosclerosis. Atherosclerosis when happens in the arteries that supply blood to the heart,
Figure 4: Resulting zones from Myocardial Infarction [Source: Myocardial Infarction (2009)]
There are patterns that are observed by the cardiologists in prognosis of myocardial
infarction cases, they are as follows:
Transmural infarct - involving the entire thickness of the left ventricular wall from
endocardium to epicardium, usually the anterior free wall and posterior free wall and
Subendocardial infarct - multifocal areas of necrosis confined to the inner 1/3-1/2 of the
left ventricular wall. These do not show the same evolution of changes seen in a
transmural MI (Klatt E.C, 2008).
When myocardial infarction occurs there is gradual necrosis of heart tissue. The necrosis
of the heart tissue happens over a period of time and may vary with depending on the size of the
infarct. Table 1 gives the pathologic findings in terms of timeline for the necrosis of heart tissue.
It is well known that first myocardial infarction may not be fatal but subsequent infarcts
may prove fatal depending on the damage done by the previous infarcts. This also would change
the timeline for the necrosis of heart tissue and may result in sudden death. Sudden death is
defined as death occurring within an hour of onset of symptoms (Klatt E.C, 2008). Some preexisting conditions that may prove dangerous for subsequent infarcts are as follows:
Arrhythmias and conduction defects, with possible sudden death (Klatt E.C, 2008).
Papillary muscle ruptures, with possible valvular insufficiency (Klatt E.C, 2008).
because Troponin I and T are structural components of cardiac muscle (Klatt E.C., 2008). The
level of troponins can be found in the bloodstream as early as 3 to 12 hours in myocardial
infarction. The levels of this enzyme will also remain elevated in the bloodstream for up to 2
weeks into myocardial infarction. The reason for troponin not being considered as the only blood
analysis enzyme is because another account of myocardial infarction happening in the time
period of already elevated levels of troponins will go unnoticed and may prove fatal.
Time of Onset
1-3 Hours
2-3 Hours
4-12 Hours
18-24 Hours
24-72 Hours
3-7 Days
Total loss of nuclei and striations along with heavy nuetrophilic infiltrate
Macrophage and monoclear infiltration begin, fibrovascular response
begins
10-21 Days
7 Weeks
part of the body. creatine kinase with muscle subunits (CK-MM), which is found mainly in
skeletal muscle; creatine kinase with brain subunits (CK-BB), predominantly found in the brain;
and myocardial muscle creatine kinase (CK-MB), which is found mainly in the heart (Samer
Garas et al.,2008). Creatine kinase (CK-MB) along with troponin is usually obtained together to
provide better diagnosis of myocardial infarction. The sensitivity of creatine kinase is
approximately 95%.
function of myoglobin is to bind oxygen. This makes the identifying level of myoglobin in the
bloodstream important as it would help in determining the amount of injury made to the heart
muscle in myocardial infarction. Rise in the level of myoglobin is present even before creatine
kinase-MB, but the rise may or may not be related to myocardial infarction alone.
enzymes does not help in diagnosis of myocardial infarction alone. When used in conjunction
with the other types of enzymes, the blood analysis for these enzymes gives excellent myocardial
Chemistry Profile
These above mentioned blood analysis types are not specifically related in diagnosis of
myocardial infarction alone and are utilized as diagnostic methods for other types of conditions
and diseases as well.
ii. Imaging
There are several Imaging diagnostic tools available for diagnosis of myocardial
infarction. The imaging diagnostic tools are as follows:
provide results that are specific to myocardial infarction detection, but is usually done as one of
the first step towards assessing any patient admitted in an emergency room with a heart
condition. A chest Radiograph is used for assessing the size of the heart and also conditions such
as pneumonia that might be one of the reasons for certain types of heart conditions. The details
the infarction and assesses overall left ventricle (LV) and right ventricle (RV) function (Samer
Garas et al., 2008). It also helps in diagnosis of different complications of the heart valves.
Echocardiography is an imaging tool is generally required by the physicians when all the other
tests are questionable or inconclusive.
damage done to the heart muscle tissue by previous infarctions. This tool is also used for
prognosis of patients entering the emergency room with serious heart conditions.
opaque dye is inserted in the blood stream via the femoral artery and then a chest X-ray of the
patient is obtained to diagnose blockages in the coronary arteries. This type of imaging technique
has become very common in the recent years. The process through which is radio opaque dye is
inserted is called cardiac catherization. It is an imaging technique which is minimally invasive
and requires local anesthesia.
To rule out the Right Ventricular infarct, ECG recording on the right-sided setting for
patients with inferior Myocardial Infarction (Samer Garas et al., 2008).
Obtain daily serial ECGs for the first 2-3 days and additionally as needed (Samer Garas
et al., 2008).
ST depression and T-wave changes may also indicate evolution of NSTEMI (Samer
Garas et al., 2008).
A more detailed description of what electrocardiography is and how it is used as a
diagnostic tool for monitoring electrical activity of the heart is given in the following section.
VI. Electrocardiography
Patients suffering from S-T elevated myocardial infarction can be diagnosed with
several type of diagnostic methodology. One of which is by using electrocardiography. The
recorded trace of electrocardiography is called an electrocardiogram (ECG).
Figure 5: An ECG with the major peaks and intervals. (Vibes Electrocardiogram, n.d.)
+
Lead I
Lead II
Lead III
Figure 8: Axial representation of Lead I, II, III, aVR, aVL, and aVF. (O'Grady, M.R., n.d.)
Precordial leads, V1, V2, V3, V4, V5, and V6, are also called chest leads because they
are strategically placed on the chest overlying the heart or its vicinity. Unlike leads I, II, III, aVR,
aVL and aVF, the precordial leads records ECG in the horizontal plane. The precordial leads are
V1, V2, and V3 are called thee right precordial leads; while V4, V5, and V6 are called left
precordial leads and all precordial leads are unipolar, which means it can be a positive lead or a
negative lead. The precordial leads provide different view of the electrical activity of the heart
and they are very useful in identifying the P
P-wave of an ECG recording.
The ECG waveform follows a pattern that describes the physiological meaning of the
conduction of heart. Figure 9 shows such a typical waveform. The description for the typical
waveform
veform with its analogous conduction activity is as follows:
The first deflection, termed the P-wave is due to the depolarization of the atria
(Jouck. P.P.H., 2004).
The large QRS-complex is due to the depolarization of the ventricles. This is the
complex with the highest amplitude (Jouck. P.P.H., 2004).
The last and most significant part for this report is the T-wave. It corresponds to
the ventricular repolarization of the heart (Jouck. P.P.H., 2004).
Fourier Transform
Wigner Distribution
Laplace Transform
Z-Transform
Wavelet Transform
Hilbert Transform
Radon Transform
Type of application
reason for choosing this type of mathematical signal transformation was done methodologically.
For most of the engineering applications, Fourier transform is popular (Polikar Robi, 2001).
Fourier transforms can provide signal representation either in time domain or the frequency
domain. The equation 1 for Fourier Transform is given as follows:
..(1)
What Fourier transforms fails to provide is the time instant at which the frequency value
is present and hence is not a transform of choice for non-stationary signal. Since ECG signal is
non-stationary signal Fourier transform was not a favored choice for doing ECG signal analysis
in this project.
The next suitable mathematical transformation is the Short Time Fourier Transformation.
As the name suggests, short time Fourier transform is similar to Fourier transform but there is a
#
!"#
$ (2)
Short Time Fourier Transform does overcome the limitation of signal representation with
known time instant of frequency. But there is a limitation to using Short Time Fourier Transform
too, which is the segments of the signal called window have fixed width and it may not be useful
for a signal that has multiple frequencies varying rapidly throughout the signal. If the width of
the segment or the window is chosen such that it narrow, then the signal transformation obtained
has good time resolution but poor frequency resolution, on the other hand, if the width of the
window is chosen such that it is wide, then the signal transformation obtained has poor time
resolution but good frequency resolution. For getting both good time resolution as well as good
frequency resolution, the width of the window should be varied across the signal during the
signal transformation such that both time and frequency component of the signal does not get
compromised. Due to this limitation of Short Time Fourier Transform, Wavelet Transform was
originally developed. For this project, the signal under measurement ECG that is non-stationary
signal that has varying frequency levels throughout the signal, and with addition of noise, it
would be difficult to use short time Fourier transform for this project, hence Wavelet Transform
was chosen.
Like short time Fourier transform, wavelet transform are similar in the sense that the
signal is multiplied with a function, similar to the window function in the STFT, and the
transform is computed separately for different segments of the time-domain signal (Polikar
The Fourier transforms of the windowed signals are not taken, and therefore single peak
will be seen corresponding to a sinusoid, i.e., negative frequencies are not computed
(Polikar Robi, 2001).
The width of the window is changed as the transform is computed for every single
spectral component, which is probably the most significant characteristic of the wavelet
transform (Polikar Robi, 2001).
The continuous wavelet transform has a time scaling and a time shifting function (t)
called as the mother wavelet. The time scaling and the time shifting function given by equation 3
and the continuous wavelet transform are given by equation 4 and 5.
% &
'
()%)
+
%
,-(3)
.- / -0-1-
Where
2& $ 3
)56)7
-$6
)6)
45
8 -9
The conditions above state that (t) is bandpass and sufficiently smooth. Assuming that
|| (t) || = 1, the definition above ensures that ||2%: &||=1 for all .-and 0 ( Schniter Phil,2005).
CCCCCCCCC
;<= > ? @
>A B -..(4)
Haar
Morlet
Mexican Hat
Meyer
Quadratic Spline
Debauchies
Biorthogonal
Gaussian
There are several other types of wavelets and each type of wavelet is different from one
to the other by properties such as symmetry, singularity etc. The selection of wavelets for ECG
signal processing is done based on the following parameters:
Width of the wavelet function: this directly acts on the analysis resolution that is
for wavelet the result of balance between the length of analysis of samples
window in time frequency axes (Bhatia et al, 2006).
Shape of the mother wavelet: wavelet filtering can be viewed as an adapted filter
looking for the highest correlation between the ECG signal to analyze and the
considered wavelet (Bhatia et al, 2006).
For ECG parameter estimation, it is desirable that the basis function (wavelets) be
symmetric/antisymmetric (Sivannarayana et al. 1999). It is also desirable that the basis have a
minimum number of sign changes which will simplify the steps in the parameters estimation
algorithm (Sivannarayana et al. 1999). Out of the wavelets listed above Biorthogonal Wavelet
was the choice of wavelet for this project because it satisfies the properties that are required for
ECG signal analysis. To understand Biorthogonal Wavelets, it is important to understand the
concepts of dual basis. Consider a two-dimensional coordinate space. Any two vectors {e1, e2}
that are not parallel can form a basis for the space. If the angle between the two vectors happens
to be 90 degrees, we have an orthogonal basis (Wolfram Research, 2009).
Any vector F in this space can be written uniquely as a superposition of the two basis
E
vectors: F G' ' H G . If the basis is orthogonal,I JI- and the component GI alongI is
E
given by the inner productI F G' I ' H G I GI . However, if the basis is not
E
orthogonal, GI is no longer given by the inner product of Fand I . In order to calculate the
E
componentGI , we introduce another set of basis vectorsK'L L M, called the dual of {e1, e2}. The
nonorthogonal basis KPI M of a function space, we can introduce dual basis KPIL M
L
CCCCCCCC
byQPIL P R - P
S -P $ - JI- . A function f(t) can be decomposed as a superposition
of the nonorthogonal basisKPI M using a set of dual basis functionsKPIL M:
OI I PI OIPIL PI . We will tacitly assume that the function space and its dual
are the same, a condition satisfied by L2. Therefore, the roles of dual basis and the original basis
can be interchanged and we obtain OIPI -PIL . When KPI M is orthogonal, we have
the obvious relation P L P (Wolfram Research, 2009).
The dilations and translations of the scaling function KP TM constitute a basis for Vj and,
similarly, KU TM for Wj. To define a dual multiresolution analysis with dual subspacesKVL M
and KWL M generated from a dual scaling function P L and a dual mother waveletU L , respectively.
In terms of subspaces, the above biorthogonality conditions can be expressed as
VX Y - WL VL Y WX-.Z$-WX Y WL [\-X ] X L (Wolfram Research, 2009).
By definition, a scaling function and a mother wavelet satisfy the dilation equation and the
wavelet equation, respectively. So we have
^ - _ Oa `a ^ a>b-c _ Oa da ^ a-(6)
and
The roles of the two functions-P andP L or U and-U L can be interchanged. Or if we "take the
dual" of the above equations (define .e .), we obtain the following relations,
L
f
CCCCCCCCCCCCC
QP'f P L R - _g Pg
TP L $-.Z$-hfL - QP'f U L R - _g Pg
and
j
f
Ifn_
The biorthogonality conditions can be translated into conditions on the filter coefficients using
the dilation and wavelet equations. These conditions are
CCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCC H m L H pm
CCCCCCC H o L H po
m L m
H p q-.Z$-o L o
H p q-CCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCC H m L H po
CCCCCCC H o L H pm
H p 3-.Z$--m L o
H p 3-o L m
Using P r T Os
a
Ot `t a-t >b-a
Ot dt a-t -.(10)
Figure 11: Types of Biorthogonal Wavelets available in Wavelet Toolbox 3.0 of Matlab 7.1
R 14[Source: Matlab7.1R14 Help]
gives the typical wave durations and amplitudes that are present in ECG signal which is the
physiological signal under measurement for this project. Figure 12 shows the normal ECG
Figure 12: Normal ECG waveform on Strip Chart [Source: Barron Jon, 2007]
The detection of the ECG waveform is based on the on the duration and amplitude
measurements given in the table 2 and figure 10. Matlab 7.1 was used for the programming of
the code for ST-elevation detection. The signal processing for the ECG waveform was done by
using Biorthogonal Wavelets. For using Wavelets Wavelet Toolbox3.0 from the Matlab software
was used. The use of Biorthogonal Wavelet was based on the symmetry, and the fact that the
shape of the biorthogonal wavelets is closest to that of the ECG Waveform, giving precision
accuracy to the time-scale conversion. By using Biorthogonal wavelets it is possible to get
complete reconstruction of the signal.
The ST-segment represents the period of the ECG just after depolarization, the QRS
complex, and just before the repolarization, the T- wave(Tompkins, Willis, 2000). The ST-
0.25 mV
R-Wave
1.60 mV
Q-Wave
25% of R-Wave
T-Wave
0.1 to 0.5 mV
Duration
P-R Interval
0.12 to 0.20 s
Q-T Interval
0.35 to 044 s
S-T Interval
0.05 to 0.15 s
P-Wave Interval
0.11 s
QRS Interval
0.09 s
The most important function of early myocardial infarction detection is that it warns the
patient of the imminent attack as early as 20 minutes before the actual attack. In typical cases, a
patient would only go to the emergency room when the heart attack has already happened. This
reduces the time for the doctors to treat it. If the patient and the doctor are warned early of the
imminent attack, the doctor gets the much needed time to curb the intensity of the attack by
providing medication faster. By having the ST-elevation detection program installed on a
Figure 13: Dyadic Wavelet Transform of ECG signal [Source: Jouck. P.P.H. (2004)]
It can be interpreted from Figure 13 that wavelet transform at small scales reflects the
high frequency components of the signal and, at large scales, the low frequency components. The
energy contained at certain scales depends on the center frequency of the used wavelet (Jouck.
P.P.H., 2004).
Figure 14: Biorthogonal Wavelet Transform of ECG Signal from 21 to24 level
The R-peak detection was followed by detecting point S and Q. (Pam, Tompkins, 1985)
method was utilized for detection of the R-peaks. After finding R-peaks (Tompkins, 2000)
method was used for detecting points S, Q, T-peak, T-point, J-point as seen in figure 15.
Figure 15: Method for ECG Parameters Detection [Source: Tompkins, 2000]
The first inflection point before Q point was chosen as point K and P point was found, the
distance between point P and point K is the isoelectric line. The isoelectric line was then
compared to the ST-segment for checking the elevation or depression of the ST-segment in all
the ECG waveforms. The algorithm for the ST-change detection program is divided in several
subsections and is as follows:
1. Signal Filtering and Baseline Wander Correction
After getting the ECG dataset, the first step was to remove the inherent noise from the
ECG signal. The typical noises that affect the ECG signal are electric or power line interference
of 60Hz, EMG or the muscle activity that gets captured along with the ECG measuring
electrodes, bowel movements also called EGG movement; EEG sometimes may interfere with
ECG signal and constitute noise. Electromagnetic interference is also seen in the ECG signal. It
thus becomes important to remove the noise from the signal for accurate and precise ECG
Figure 16: Filter expressed in Direct Form II transposed structure [Source: Matlab7.1R14 Help]
Figure 16 can also be expressed as:
y(n)=(1)*x(n)+b(2)*x(n-1)++b(nb+1)*x(n-nb)-a(2)*y(n-1)--a(na+1)*y(n-na).(11)
After filtering the signal using the FIR filter, the filtered signal was passed through
median filters to correct for the baseline wander correction. The process followed included
passing the filtered signal through a 200ms median filter that eliminates the QRS complex from
the signal. This median filtered signal was again passed through a 600ms median filter to
eliminate the T-wave from the signal. This final filtered signal is the signal that consists of the
noise that changes the baseline through the signal. The difference between the FIR filtered signal
and the final median filtered signal thus gives the baseline wander eliminated signal. The
baseline wander elimination process in shown in figure 17, where the first plot if of the FIR
filtered signal, the second plot is of the first median filtered signal, while the third plot is of the
second median filtered signal, the final plot shows the baseline wander eliminated signal.
R-Peak Detection
The R-peak detection was carried out by using the Pan, Tompkins 1985 method of Rpeak detection. The method uses the threshold level to calculate the maximum amplitude in the
ECG waveform. The threshold level set for the R-peak detection in the ST-change program is
approximately 0.6. The R-peak detection was done in the time-scale domain at level 24. Same
level was utilized to estimate the other key points in the ECG waveform. Figure 18 shows the
final ECG waveform with all the detected points along with its legend.
3.
It is essential to calculate the heart rate of the patient in order to determine accurate
measurement and approximation of the PQSTJK points on the ECG waveform; hence heart rate
was calculated from the datasets after for every minute of data scanned. The heart is calculated
by taking the difference in time between consecutive R-peaks.
Figure 18: R-peak Detection and PQSTJK extraction of ECG wave at level 24
4.
Tompkins method for ST-segment analyzer was followed to compute J, T-peak, and Tpoint (Tompkins, 2000). The algorithm for estimating the Q and S point was derived from
Tompkins method of ST-segment analyzer. After detecting R-peak, knowing the QRS complex
duration to be 60ms, points Q and S were estimated as the first inflection points to the left and
the right of R-peak respectively. After estimating the S-point, J-point was estimated to be first
inflection point after S-point to the right of R-peak. T-peak was estimated to between R-peak+
400ms to J-point+80ms. T-point was later on estimated from T-peak to T-point duration of 35ms
to the R-peak side. Similarly K-point was estimated to be the first inflection point after Q on the
left side of the R-peak, and P-point was estimated to be the first inflection point after K-point on
the P-peak side. The detection of point is depicted in figure 18 above.
Figure 19: Shows an intuitive GUI result for an ECG data with no MI detected
Figure 20: Shows an intuitive GUI result for an ECG data with an MI detected.
Start
Is
ST>ISO
YES
NO
Go to the next minutes signal
End
Show MI Warning
Diagnostic
Levels
90%
80%
70%
50%
40%
Total
Observed Frequencies
Cumulative Rates
False
True
False
True
Postive
Positive
Positive
Positive
4
26
0.3077
0.6341
1
4
0.3846
0.7317
2
4
0.5385
0.8293
1
4
0.6154
0.9248
5
3
1
1
13
41
A more detailed version of the database testing is available in Appendix C part of this report. The
cumulative rates were calculated using the mathematical formulae developed by Lowry, Richard
2008. Table 4 shows the plotted point for ROC curve followed by the ROC curve in Figure 22.
b. Discussion
Based on the results it can be said with confidence that the ST- change detection program
produces overall better results that many available method for ST measurement. Unlike many
other ST detection algorithms, this ST-change detection program also takes into consideration
the change in the Heart Rate, which if ignored might not give precise ECG parameters estimation
and result wrong ST-change predictions. Using Biorthogonal wavelets gives precise
transformation points due to the similarity of shape between the ECG signal and that of the
biorthogonal wavelets.
X. Economic Justification
a. Executive Summary
SMART Medical Devices Company is an established medical device company that
design and sells medical diagnostic devices. It currently does not have a portable ECG device in
the market. SMART Medical Device Company wants to develop a portable ECG device that can
analyze physiological signals to detect the onset of myocardial infarction.
Myocardial infarction is defined by the American Heart Association as the damaging or
death of the heart muscles due to the blockage of blood supply. Diagnosing patients and
detecting the symptoms, before the onset of myocardial infarction, is important to increase the
mortality rate of patients. There are several ways to diagnose myocardial infarction and one of
which is by using electrocardiogram (ECG) devices. Most of the ECG devices in the market are
bulky and are not suitable for everyday use. In addition, most ECG devices are installed in
hospitals where doctors or nurse can readily give diagnosis to patients. But, time is of the
essence for doctors and nurses and they cannot be with the patients all the time. Furthermore,
Figure 23: An estimate of myocardial infarction prevalence in the United States (Heart Disease
and Stroke Statistics - 2003 Update, Heart Disease and Stroke Statistics - 204 Update, Heart
Disease and Stroke Statistics - 2005 Update, Heart Disease and Stroke Statistics - 2006 Update,
Heart Disease and Stroke Statistics - 2007 Update, Heart Disease and Stroke Statistics - 2008
Update, Heart Disease and Stroke Statistics - 2009 Update)
And from the same period, there was an increase of 8.09% of new and recurrent attacks
of myocardial infarction in the United St
States (Seen in figure 24).
The 2009 estimated direct and indirect cost of myocardial infarction was estimated to be $165
billion compared to $133 billion in 2004, a 24% increase (Seen in figure 25).
Figure 24: An estimate of new and recurrent incidence of myocardial infarction in the United
States(Heart
Heart Disease and Stroke Statistics - 204 Update, Heart Disease and Stroke Statistics 2005 Update, Heart Disease and Stroke Statistics - 2006 Update, Heart Disease and Stroke
Statistics - 2007 Update, Heart Disease and Stroke Statistics - 2008 Update, Heart Disease and
Stroke Statistics - 2009 Update)
Variable Costs
Variable costs are cost drivers that are associated with the activity from developing to
servicing the MI Detector device. It varies from time to time due to the number of volume of
producing and selling the device. Since an OEM vendor manufactures the MI Detector device,
there is no associated cost with manufacturing. Logistics and manufacturing contracts are major
cost drivers for this device, which consists of contracting the manufacturing to an OEM
manufacturer, receiving and delivery of the device from the OEM manufacturer to the sales
channel, and keeping the inventory in order. Other cost drivers are sales and marketing, the
support staff and the initial regulatory and legal requirements to manufacture and sell the device.
Table 6 illustrates the variable costs of MI Detector device.
Table 5: Fixed cost of MI Detector device
Fixed Cost
2009
2010
2011
2012
2013
$6,000.00
$1,000.00
$1,000.00
$1,000.00
$1,000.00
$100,000.00
$105,000.00
$110,250.00
$115,762.50
$121,550.63
$300,000.00
$315,000.00
$330,750.00
$347,287.50
$364,651.88
Department Manager
$120,000.00
$126,000.00
$132,300.00
$138,915.00
$145,860.75
$520,000.00
$546,000.00
$573,300.00
$601,965.00
$632,063.26
Development Cost
$50,000.00
$0.00
$0.00
$0.00
$0.00
Business Expense
$100,000.00
$100,000.00
$100,000.00
$100,000.00
$100,000.00
$647,000.00
$674,300.00
$702,965.00
$733,063.26
2009
2010
2011
Marketing Salary
$150,000.00
$157,500.00
$165,375.00
$173,643.75
$182,325.94
Support Staff
$150,000.00
$157,500.00
$165,375.00
$173,643.75
$182,325.94
Logistics and
Contracts
$500,000.00
$500,000.00
$500,000.00
$500,000.00
$500,000.00
$50,000.00
$5,000.00
$5,000.00
$5,000.00
$5,000.00
$820,000.00
$835,750.00
$852,287.50
$869,651.88
2012
2013
i. SWOT Assessment
The device itself has much strength and some weaknesses. The SWOT assessment of the
MI Detector device is shown in table 7.
Weaknesses
Threats
Other medical device companies
might develop similar products
with similar price point
Initial Investment
$1,800,000
$1,600,000
$1,400,000
Costs
$1,200,000
$1,000,000
$800,000
$600,000
$400,000
$200,000
$0
Fixed Cost
Variable Cost
Investment
Yearly Model
Revenue
Total Cost
$5,000,000
$4,000,000
Sales
$3,000,000
$2,000,000
$1,000,000
$0
-$1,000,000
Year
Figure 27
27: Yearly Model of MI Detector device
Having a price point of $2,000 and an estimate of 500 units sold on the first year, the
company will have a loss of $500,000 on the first year. With an estimated sales increase of 20%
every year or 5% every quarter, the company is estimated to gain profit of almost $2.5 million on
the fifth year. (Shown in table 8)
k. Personnel
This project only justifies the requirements of the software development team of SMART
Medical Devices. This project is required to develop the smart analytical software of the MI
Detector device. The software development team of the company consists of five software
engineers with varying levels, and a department manager. The members of the development
team are currently employed at SMART Medical Devices.
A department manager will oversee the development of the project and needs to have
skills and knowledge to drive the project forward. The department manager should have an
experience in project management and can deal well with different levels of the company.
There are three level 4 to 5 software engineers with the following minimum
qualifications to develop the project:
An annual incidence of 610,000 and 325,000 new and recurrent attacks of myocardial
infarction
Q3 2009
250
Q4 2009
265
Q1 2010
275
Q2 2010
290
Q3 2010
305
Q4 2010
320
$2,000.00
$0.00
$225,000.00
$285,000.00
$2,000.00
$500,000.00
$225,000.00
$285,000.00
$2,000.00
$530,000.00
$225,000.00
$285,000.00
$2,000.00
$550,000.00
$225,000.00
$205,000.00
$2,000.00
$580,000.00
$225,000.00
$205,000.00
$2,000.00
$609,000.00
$225,000.00
$205,000.00
$2,000.00
$639,450.00
$225,000.00
$205,000.00
$510,000.00
-$510,000.00
$510,000.00
-$10,000.00
$10,000.00
$510,000.00
$20,000.00
$430,000.00
$120,000.00
$430,000.00
$150,000.00
$430,000.00
$179,000.00
$430,000.00
$209,450.00
Total Cost
$800.00
$ Thousands
$600.00
$400.00
$200.00
$0.00
-$200.00
-$400.00
-$600.00
Quarterly
XII. Conclusion
The algorithm created in MATLAB was successful in detecting the different segments of
ECG signal from the Physiobank database. The QRS complex was detected and was used to
identify the ST-segment. The code was able to detect the abnormalities in the ST segment with
high accuracy. It was also successful in eliminating noises and baseline drifts that can degrade
the accuracy of the algorithm.
With the use of biorthogonal wavelets the ECG signal processing was made faster so that
when real time ECG signal is fed to the algorithm, the processing of the ECG signal and the
resultant warning in the case of abnormality will be close to the actual signal. The algorithm was
successful in identifying ST-segment changes/abnormalities for single lead ECG signal.
Moody GB, Muldrow WE, Mark RG. A noise stress test for arrhythmia detectors. Computers in
Cardiology 1984; 11:381-384.
Myocardial Infarction (2009). Myocardial Infarction. The Free Dictionary by Farlex.
Retrieved on 29th March 2009 from http://medicaldictionary.thefreedictionary.com/Myocaridal+infarction">myocardial infarction</a>
O'Grady, M. R., & O'Sullivan, M. L. (n.d.). VetGo Cardiology. Retrieved April 4, 2009, from
http://www.vetgo.com/cardio/concepts/concsect.php?conceptkey=165
Pan Jiapu., Tompkins Willis. J. (1985). A Real-Time QRS Detection Algorithm. IEEE
Transactions on Biomedical Engineering, Vol. BME-32, Issue #3, March 1985,
Pages:230-236.
Polikar Robi (2001). The Engineers ultimate guide to wavelet analysis. The Wavelet Tutorial.
College of Engineering, Rowan University (2001). Retrieved on 5th April 2009 from
http://users.rowan.edu/~polikar/WAVELETS/WTtutorial.html
Poul-Erik Paulev(2000). Textbook in Medical Physiology and Pathophysiology Essentials and
Clinical Problems- Chapter 10: Cardiac Performances and Disorders. Copenhagen Medical
Publishers 1999-2000. Retrieved on 29th March 2009 from
http://www.mfi.ku.dk/ppaulev/chapter10/chap_10.htm
Samer Garas, Maziar Zafari (2008). Myocardial Infarction. EMedicine from WebMD (August
2008). Retrieved on 27th March 2009 from http://emedicine.medscape.com/article/155919overview
Saritha.C., Sukanya. V., Murthy. Narasimha. Y. (2008) . ECG Signal Analysis using Wavelet
Transforms. Journal of Bulg. J. Physics(2008). Issue 35. Pages: 68-77.
Schniter Phil (2005). Continous Wavelet Transform. Creative Commons Attribution License.
Connexious module: m10418. Version: 2:13. June 9th, 2005. Retrieved on April 5th 2009
from http://cnx.org/content/m10418/latest/
Sivannarayana N., Reddy D.C. (1999). Biorthogonal Wavelet Transforms for ECG Parameters
Estimation. Journal Medical Engineering and Physics (1999) Issue: 21Pages: 167-174.
Taddei, A., Distante, G., Emdin, M., Pisani, P., Moody, G.B., Zeelenberg, C., and Marchesi, C.
The European ST-T Database: standard for evaluating systems for the analysis of ST-T
changes in ambulatory electrocardiography. European Heart Journal 13: 1164-1172
(1992).
The Myocardial Infarction Heart Attack (2006). The Causes: The Myocardial Infarction: The
Cardiovascular Diseases. Heart and Vessels (July 2006). Retrieved on 29th March 2009
from http://www.heart-vessels.com/cardiovascular-diseases/heart-attack-myocardialinfarction6.php
Tompkins Willis. J. (2000). Biomedical Digital Signal Processing. Chapter 13: ECG Analysis
System. Prentice Hall (2000). Pages: 271-272.
VIBES Electrocardiogram Mosaic. (n.d.). Retrieved April 4, 2009, from
http://www.vanth.org/vibes/electro.html
Wenli Chen., Zhiwen Mo., Wen Guo. (2007) Detection of QRS Complexes Using Wavelet
Transforms and Golden Section Search Advances in Intelligent Systems Research ISKE2007 Proceedings. Retrieved on March 18th 2009 from http://www.atlantispress.com/php/download_paper.php?id=1195.
Wolfram Research (2009) . Biorthogonal Wavelets. Documentation: Wavelet Explorer:
Fundamentals of Wavletes. Retrieved on April 8th 2009 from
http://documents.wolfram.com/applications/wavelet/FundamentalsofWavelets/1.6.1.html
World Heart Federation (2009). Cardiovascular Diseases.
http://www.world-heart-federation.org/cardiovascular-health/heart-disease/different-heartdiseases/#c434
Yanowitz G.Frank (2006). IX. Myocardial Infarction. The Alan E. Lindsay ECG Learning
Center in Cyberspace. Spencer S. Eccles Health Sciences Library University of Utah
Health Services Center (2006). Retrieved on November 6th 2008 from
http://library.med.utah.edu/kw/ecg/ecg_outline/Lesson9/index.html#Intro
% Header In TXT
Format
load (Filename);
%***************************************************************
% Load Header Data
%***************************************************************
fprintf(1,'\nK> Loading Data from Header File %s ...\n',
Headerfile);
signalh = fullfile(Fileloc, Headerfile);
fid1 = fopen(signalh,'r');
z = fgetl(fid1);
A = sscanf(z, '%*s %d %d',[1,2]);
% Number Of Signals
nosig = A(1);
sfreq = A(2);
clear A;
z = fgetl(fid1);
A = sscanf(z, '%*s %*d %d %d %d %d',[1,4]);
gain = A(1);
clear A;
% Integers Per mV
%***************************************************************
% Manipulate Data So We Only Look At What The User Wants
%***************************************************************
D = transpose (D);
= t(maxloc);
R_amp = maxval;
%***************************************************************
% Heart Rate Calculation
%***************************************************************
for j = 2:length (R_t)
HR(j)= R_t(j)-R_t(j-1);
end
H_R = 60/(mean (HR));
fprintf (1,'\nK> Heart Rate is %d \n',H_R);
%***************************************************************
% S-Point Detection
%***************************************************************
R_len= length (R_index);
for j = 1:R_len
IR1 = R_index(j);
for i = IR1:IR1+ (round(sfreq*0.03)*(H_R/72))
if i == length (x)|i==0
S_index(j)= 1;
S_amp(j) = x(1,1);
S_t(j) = t(1,1);
break
end
%***************************************************************
% T-Point (T onset) Detection via T-peak
%***************************************************************
T_len = length (T_peak_index);
for j = 1:T_len
IT1 = T_peak_index(j);
for i = IT1:-1:IT1-(round(sfreq*0.035) *(H_R/72))
TP_index(j)=i;
TP_amp(j)=x(i,1);
TP_t(j)=t(1,i);
end
end
end
%***************************************************************
% P-Point Detection via K+80ms
%***************************************************************
K_len = length (K_index);
for j = 1:K_len
IK1 = K_index(j);
for i=IK1:-1:IK1- (round(sfreq*0.08) *(H_R/72))
if i ==0
P_index(j) = 1;
P_amp(j)= x(1,1);
P_t(j)=t(1,1);
break
end
P_index(j) = i;
P_amp(j)= x(i,1);
P_t(j)=t(1,i);
end
end
if a<b
for j=1:a
counter1=counter1+1;
if ISO(j)>=ST(j)+0.0001 && ISO(j)>=ST(j)0.0001|ISO(j)==ST(j)
counter2=counter2+1;
else
counter3=counter3+1;
end
end
end
if a>b
for j=1:b
counter1=counter1+1;
if ISO(j)>=ST(j)+0.0001 && ISO(j)>=ST(j)0.0001|ISO(j)==ST(j)
counter2=counter2+1;
else
counter3=counter3+1;
end
mfilename, ...
gui_Singleton, ...
'gui_OpeningFcn', @GUISTchange_OpeningFcn,
...
'gui_OutputFcn',
@GUISTchange_OutputFcn, ...
'gui_LayoutFcn',
[] , ...
'gui_Callback',
[]);
% Header
%***************************************************************
% Load Header Data
%***************************************************************
signalh = fullfile(Fileloc, Headerfile);
fid1 = fopen(signalh,'r');
z = fgetl(fid1);
A = sscanf(z, '%*s %d %d',[1,2]);
nosig = A(1);
% Number Of Signals
sfreq = A(2);
clear A;
z = fgetl(fid1);
A = sscanf(z, '%*s %*d %d %d %d %d',[1,4]);
gain = A(1);
clear A;
S = sfreq*60;
counter1=0;
counter2=0;
% Integers Per mV
start
right = find(diff([poss_reg' 0])==-1); % remember to zero pad at
end
for(i=1:length(left))
[maxval(i) maxloc(i)] = max( x(left(i):right(i)) );
[minval(i) minloc(i)] = min( x(left(i):right(i)) );
maxloc(i) = maxloc(i)-1+left(i); % add offset of present
location
minloc(i) = minloc(i)-1+left(i); % add offset of present
location
end
R_index = maxloc;
= t(maxloc);
R_amp = maxval;
%***************************************************************
% Heart Rate Calculation
%***************************************************************
for j = 2:length (R_t)
HR(j)= R_t(j)-R_t(j-1);
end
H_R = 60/(mean (HR));
%***************************************************************
% S-Point Detection
%***************************************************************
R_len= length (R_index);
for j = 1:R_len
IR1 = R_index(j);
for i = IR1:IR1+ (round(sfreq*0.03*(H_R/72)))
if i == length (x)|i==0
S_index(j)= 1;
S_amp(j) = x(1,1);
%***************************************************************
% T-Point (T onset) Detection via T-peak
%***************************************************************
T_len = length (T_peak_index);
for j = 1:T_len
IT1 = T_peak_index(j);
for i = IT1:-1:IT1-(round(sfreq*0.035*(H_R/72)))
if a>b
for j=1:b
counter1=counter1+1;
Sample #
327m
325m
324m
323m
322m
321m
320m
319m
318m
317m
316m
315m
314m
313m
312m
311m
310m
e0103m
e0105m
e0107m
e0113m
e0111m
e0119m
e0121m
e0123m
e0125m
e0127m
e0133m
e0139m
e0147m
e0155m
118e00m
118e06m
118e12m
118e18m
118e24m
s20021m
s20111m
European ST Database
5 minutes of data tested
Longterm ST Database
5 minutes of data tested
MI
No MI
268
375
248
375
254
378
0
133
565
144
115
379
181
105
375
83
0
60
0
0
305
310
240
302
299
349
293
265
156
265
203
0
0
0
0
0
431
456
0
0
62
85
241
0
411
407
169
213
425
0
252
345
0
308
514
245
273
330
0
0
60
77
71
0
74
0
234
0
148
361
361
361
361
361
0
0
Total # of
Signals
268
375
319
460
495
378
411
540
734
357
540
379
433
450
375
391
514
305
273
330
305
310
300
379
370
349
367
265
390
265
351
361
361
361
361
361
431
456
590
530
511
429
0
0
0
89
590
530
511
518
16265m
298
298
16272m
18184m
19093m
19140m
19830m
16273m
16420m
16483m
16773m
16786m
17453m
18177m
0
292
234
196
0
0
273
290
88
0
171
0
328
179
68
248
156
279
180
57
324
318
248
175
328
471
302
444
156
279
453
347
412
318
419
175
MI
NMI
268
375
248
375
254
378
0
133
565
144
115
379
181
105
375
83
0
60
0
0
305
310
240
302
299
349
293
265
156
265
203
0
0
62
85
241
0
411
407
169
213
425
0
252
345
0
308
514
245
273
330
0
0
60
77
71
0
74
0
234
0
148
0
0
0
0
0
361
361
361
361
361
Percentage
Percentage
Total
Correct
Wrong
Databse Name
268
100
0 MIT-BIH ST Change
375
100
0
319
77.74294671
19.43573668
460
81.52173913
18.47826087
495
51.31313131
48.68686869
378
100
0
411
0
100
540
24.62962963
75.37037037
734
76.97547684
23.02452316
357
40.33613445
59.66386555
540
21.2962963
78.7037037
379
100
0
433
41.80138568
58.19861432
450
23.33333333
76.66666667
375
100
0
391
21.22762148
78.77237852
514
0
100
305
19.67213115
80.32786885 European ST
273
0
100
330
0
100
305
100
0
310
100
0
300
80
20
379
79.68337731
20.31662269
370
80.81081081
19.18918919
349
100
0
367
79.83651226
20.16348774
265
100
0
390
40
60
265
100
0
351
57.83475783
42.16524217
MIT-BIH Noise Stress
361
0
100 Test
361
0
100
361
0
100
361
0
100
361
0
100
431
456
590
530
511
429
0
0
292
234
196
0
0
273
290
88
0
171
0
Diagnostic Level
90%
80%
70%
50%
40%
0
0
0
0
0
89
298
328
179
68
248
156
279
180
57
324
318
248
175
431
456
590
530
511
518
298
328
471
302
444
156
279
453
347
412
318
419
175
100
100
100
100
100
82.81853282
0
0
61.99575372
77.48344371
44.14414414
0
0
60.26490066
83.57348703
21.3592233
0
40.81145585
0
0 Longterm ST change
0
0
0
0
17.18146718
100 Normal Sinus Rhythm
100
38.00424628
22.51655629
55.85585586
100
100
39.73509934
16.42651297
78.6407767
100
59.18854415
100