Final - Manuscript - Portable Heart Attack Alert System (PHAAS) - An Objective-Based Approach in Detecting ST-elevated Myocardial Infarction (S
Final - Manuscript - Portable Heart Attack Alert System (PHAAS) - An Objective-Based Approach in Detecting ST-elevated Myocardial Infarction (S
Final - Manuscript - Portable Heart Attack Alert System (PHAAS) - An Objective-Based Approach in Detecting ST-elevated Myocardial Infarction (S
by
BS Biomedical Engineering IV
Adviser
May 2, 2023
Ateneo de Zamboanga University
APPROVAL SHEET
This thesis hereto entitled:
ABSTRACT
Ischemic Heart Disease (IHD) is a cardiovascular disorder characterized by the
Statistics Authority (2022) and Khan et al. (2020), IHD is a significant contributor to
mortality rates globally and locally. Individuals diagnosed with IHD are at an increased
can be subjective and may lead to delayed diagnosis. Hospital equipment and tests,
such as chest X-rays, ECG, and blood tests, can also aid in detection, but accessibility
is limited outside of medical facilities. Additionally, some heart attacks occur silently,
with no symptoms, making them unpredictable. Given the potential for significant
cardiac damage and mortality, timely diagnosis, and rapid response are crucial.
Therefore, early detection and intervention are critical in managing heart attacks,
consequences.
With these in mind, the PHAAS (Portable Heart Attack Alert System) was
The device consists of six modules, including an acquisition and signal processing
unit, a data analysis module, a storage unit, an alert system module, a display system,
and a battery module. Mainly, it functions by using the elevation of the ST segment in
the ECG signal to detect heart attacks, and machine learning algorithms were trained
Ateneo de Zamboanga University
to enable automatic detection. The alert system, on the other hand, automatically
contacts the user and clinician upon detection, enabling prompt medical intervention
detecting STEMI heart attacks. Machine learning algorithms used in both system and
beta testing showed a relatively high accuracy of 87% and 83%, respectively, under
acceptable conditions. When the device's modules were integrated and tested as a
success rate of 95% in normal and STEMI classification. However, certain factors
such as motion artifacts, limited sensor sensitivity, and data mismatch were found to
these issues.
during testing, initiating alerts only when STEMI ECG was detected. The SMS and
call alerts were directed to the assigned contacts upon detection of a heart attack.
However, network connection and sim registration to promos may affect the device's
ability to initiate alerts, and these factors should be considered when using the device
in practical settings.
Lastly, results from the post-survey conducted during the beta testing phase of
the PHAAS device indicate that participants strongly agree with the device's portability
and comfortability. This suggests that the device is well-designed for ease of use and
In summary, a portable heart attack alert system for the automatic real-time
ACKNOWLEDGEMENTS
The success of this thesis would not have been possible without the support,
opportunity to express our deepest gratitude toward those who contributed to making
First and foremost, we would like to thank our thesis advisor, Niño Christon Y.
Lazarte, who provided us with constant assistance and direction in creating our
proposed device and writing this paper. This paper would not have been completed
without his aid and committed involvement at every stage of the process.
To Mr. Roel Rojas and the Zamboanga City Medical Center Biomedical
Unit, especially our BME seniors, we are grateful for the patience, understanding,
support, and motivation you continue to provide us. It has helped us tremendously in
We would also like to express our gratitude to the volunteers of our beta testing,
Hospital and Dr. Nurhaya A.Hadjail-Ismael from HRT Medical & Maternity Complex,
who took time off their day to help us further establish our paper. Without your
willingness to participate, especially with our doctors who gracefully provided us with
their expertise, we would not have been able to proceed in successfully completing
this paper.
Ateneo de Zamboanga University
We would also like to extend our deepest appreciation to our families, most
especially our parents, for their financial and emotional support. A special thanks goes
To our friends and fellow BME peers of this batch, we are deeply thankful for
the encouragement, support, struggle, cheers, and tears that we shared with one
another. Working and communicating with all of you has been uplifting. Everybody’s
success and grit to push through, despite the struggles, gave us the motivation to
of doubt and demotivation. We thank you for your presence and spiritual guidance.
We also thank you for the strength and wisdom you have bestowed upon us, enabling
TABLE OF CONTENTS
CHAPTER I ............................................................................................ 1
1.1 Background of the Study ......................................................................................... 1
1.2 Problem Statement .................................................................................................. 5
1.3 Conceptual Design ................................................................................................ 12
1.4 Objectives .............................................................................................................. 15
1.5 Scope and Delimitations ........................................................................................ 16
1.6 Significance of the Study ....................................................................................... 18
CHAPTER II ......................................................................................... 21
2.1 Current Preventive Methods for Myocardial Infarction ......................................... 21
2.2 Current Diagnostic Tests for Myocardial Infarction .............................................. 33
2.3 ECG Signal Acquisition Methods .......................................................................... 38
2.4 ECG Pre-processing Methods .............................................................................. 40
2.5 Machine Learning for Detection of Heart Attack ................................................... 42
2.6 Existing Real-Time Heart Attack Detection Device .............................................. 43
2.7 Existing Studies with Similar Approach ................................................................ 44
LIST OF FIGURES
Figure 1-1. Conceptual Design of Portable Heart Attack Alert System ..................... 13
Figure 3-1. Components of Normal ECG Reading (Biopac Systems, Inc., n.d.)....... 59
Figure 3-2. Comparison of ST segment variations (Chowdhury et al., 2019) ........... 59
Figure 3-3. Possible Hyperplanes in classifying data (Gandhi, 2018) ....................... 61
Figure 3-4. Optimal Hyperplane and Maximum Margin in SVM (Gandhi, 2018) ....... 61
Figure 3-5. Linearly separable data (MLMath.io, 2019) ............................................. 62
Figure 3-6. Non-linearly separable data (MLMath.io, 2019) ...................................... 62
Figure 3-7. Application of Kernel for non-linear classification (Sharma, 2019) ......... 63
Figure 3-8. Frequency Response of a Bandpass Filter (Electronics Tutorial, n.d.) .. 64
Figure 3-9. Sample of Simple Moving Average filter application (Salain, 2022) ....... 66
Figure 3-10. Variation of Power Spectral Density of normal, ST-elevation, and T-
wave inversion ECG traces (Chowdhury et al., 2019)................................................ 68
Figure 3-11. Wavelets with small and long scale factors (MathWorks, n.d.) ............. 71
Figure 3-12. Sparkfun Analog ECG Sensor Module Kit (Alibaba, n.d.) ..................... 73
Figure 3-13. iCare Disposable ECG Electrodes (iCare, n.d.) .................................... 73
Figure 3-14. Adafruit ADS1015 12-bit ADC (Makerlab Electronics, n.d.) .................. 74
Figure 3-15. Raspberry Pi 4 Model B (Raspberry Pi, n.d.)......................................... 75
Figure 3-16. 128 GB SanDisk Ultra Micro SD Card (Amazon, n.d.) .......................... 75
Figure 3-17. SIM800L V2 5V Wireless GSM GPRS Module (Maker-lab electronics,
n.d.) .............................................................................................................................. 76
Figure 3-18. 16x2 LCD Display (Maker-lab electronics, n.d.) .................................... 77
Figure 3-19. Digital Multimeter (Fluke, 2021) ............................................................. 78
Figure 3-20. Fluke Prosim8 Vital Signs Simulator (Fluke, n.d.) ................................. 79
Figure 3-21. ACER Predator Helios 300 Gaming Laptop (Carousel, n.d.) ................ 79
Figure 3-22. Block Diagram of PHAAS ....................................................................... 82
Figure 3-23. Preliminary Design of Portable Heart Attack Alert System ................... 83
Figure 3-24. Approximate Dimensions of Portable Heart Attack Alert System ......... 83
Figure 3-25. Chest Lead II Configuration (Sampson, 2018) ...................................... 84
Figure 3-26. Main flowchart of PHAAS ....................................................................... 89
Ateneo de Zamboanga University
Figure 3-27. Flow diagram of Acquisition and Signal Processing Unit ...................... 90
Figure 3-28. Flow Diagram of Data Analysis Module ................................................. 92
Figure 3-29. Flow Diagram of Training Machine Learning Process........................... 92
Figure 3-30. Flow Diagram of Alert System Module ................................................. 100
Figure 3-31. Flow Diagram of Storage Module ......................................................... 101
Figure 3-32. Flow diagram of Display System .......................................................... 101
Figure 4-1 Block Diagram of the Experimental Setup of the Proposed Device ....... 119
Figure 4-2. Complete Schematic Diagram of the Proposed Solution ...................... 121
Figure 4-3. Schematic diagram of Acquisition and Signal Processing Unit ............. 121
Figure 4-4. Schematic Diagram of the Storage Module ........................................... 123
Figure 4-5. Schematic Diagram of Alert System Module ......................................... 123
Figure 4-6. Schematic Diagram of Display Module .................................................. 124
Figure 4-7. ECG Plots of Different Window Sizes .................................................... 131
Figure 4-8. Frequency Response of Moving Average Filter with Window Size 7 ... 132
Figure 4-9. Frequency Response of Moving Average Filter with Window Size 11 . 132
Figure 4-10. Frequency Response of Moving Average Filter with Window Size 15 133
Figure 4-11. Application of Moving Average and Median Filters ............................. 136
Figure 4-12. Snippet of Manual Collection of Sample Ranges of Relevant Data ... 147
Figure 4-13. Actual Experimental Design of Prototype ............................................ 162
Figure 4-14. 3D Computer Aided Design of Prototype ............................................. 163
Figure 4-15. Interior of the Experimental Design of Prototype ................................. 163
Figure 4-16. Dimensions of Modules in the Interior of Enclosure ............................ 164
Figure 4-17. Prototype Connected to a User ............................................................ 164
Figure 4-18. Prototype Strapped on a User .............................................................. 165
Figure 5-1. Functional Test Trial 8 of ECG Acquisition ............................................ 167
Figure 5-2. Normal ECG with 100% Artifact Size Test Result ................................. 171
Figure 5-3. Frequency Spectrum of Normal ECG simulation and Filter Results ..... 172
Figure 5-4. Functional Test Trial 9 of Storage Unit .................................................. 180
Figure 5-5. Functional Test Trial 1-10 of Storage Unit ............................................. 182
Figure 5-6. Functional Test Trial of Storage Unit...................................................... 184
Figure 5-7. Functional Test Trial of Storage Unit...................................................... 185
Ateneo de Zamboanga University
Figure 5-8. System Testing, Case 1, Phase III, Trial 1............................................. 190
Figure 5-9. System Testing, Case 2, Phase III, Trial 4............................................. 192
Ateneo de Zamboanga University
LIST OF TABLES
Table 2-1. Comparison of Existing Studies ................................................................. 49
Table 2-2. Comparison of Features of Existing Studies, HeartBeam, and PHAAS .. 55
Table 3-1. Summary of functional testing ................................................................. 108
Table 3-2. Case 1 for System Testing ...................................................................... 113
Table 3-3. Case 2 for System Testing ...................................................................... 115
Table 3-4. Summary of Beta Testing ........................................................................ 118
Table 5-1. Acquisition Module Test Result Summary .............................................. 168
Table 5-2. Signal Processing Unit Test Result Summary ........................................ 170
Table 5-3. Confusion Matrix using Training Data ..................................................... 174
Table 5-4. Confusion Matrix using Testing Data ...................................................... 174
Table 5-5. Data Analysis Module Test Result Summary .......................................... 175
Table 5-6. Supporting Metric Results ........................................................................ 176
Table 5-7. Storage Module Test Result Summary ................................................... 179
Table 5-8. Alert System Module Test Result Summary ........................................... 180
Table 5-.9 Display System Test Result Summary .................................................... 183
Table 5-10. Battery Module Test Result Summary .................................................. 185
Table 5-11.ST-elevation Threshold Test Summary Result ...................................... 187
Table 5-12. Artifact Size Test Summary Result ........................................................ 188
Table 5-13. System Testing Case 1 Summary Result ............................................. 189
Table 5-14. System Testing Case 2 Summary Result ............................................. 191
Table 5-15. Model Performance Using System Testing Data .................................. 193
Table 5-16. Likert-Scale Result ................................................................................. 194
Table 5-17. Interpretation of Mean Score ................................................................. 195
Table 5-18. Model Performance Using Beta Testing Data....................................... 196
Ateneo de Zamboanga University
LIST OF LISTINGS
Listing 4-1. Set ADC Sampling Rate and Gain ......................................................... 126
Listing 4-2. Acquisition of 2500 samples................................................................... 126
Listing 4-3. Bandpass Filter Design using HeartPy .................................................. 128
Listing 4-4. Moving Average Filter Design using Pandas Library ............................ 129
Listing 4-5. Median Filter Design using Scipy Module.............................................. 135
Listing 4-6. Power Spectral Density Extraction using Scipy ..................................... 137
Listing 4-7. Continuous Wavelet Transform Extraction using pywt.......................... 138
Listing 4-8. Acquiring Synthetic Features using gplearn .......................................... 139
Listing 4-9. Accessing Annotations ........................................................................... 143
Listing 4-10. Accessing ECG records ....................................................................... 146
Listing 4-11. Collecting relevant data using sample ranges acquired ..................... 147
Listing 4-12. Overview of Pre-processing Data ........................................................ 150
Listing 4-13. Splitting data into a 70:30 ratio............................................................. 152
Listing 4-14. Finding Optimal Hyperparameter ......................................................... 153
Listing 4-15. Saving Scaling Model ........................................................................... 154
Listing 4-16. RFECV Feature Selection .................................................................... 155
Listing 4-17. Saving Model with a Minimum of 70% K-fold accuracy ...................... 156
Listing 4-18. Code for Predicting Class..................................................................... 157
Listing 4-19. Calculation of Evaluation Metrics ......................................................... 157
Listing 4-20. Function for saving data as CSV files .................................................. 159
Listing 4-21. Alert System Module ............................................................................ 160
Listing 4-22. Display System Code ........................................................................... 161
Ateneo de Zamboanga University
CHAPTER I
INTRODUCTION
condition that develops due to the narrowing of the heart arteries (American Heart
which is the build-up of plaque (such as fats and cholesterol) within the artery walls
(Institute of Medicine, 2010). Patients with this disease are at high risk of a heart
attack.
According to the Philippine Statistics Authority (2022), IHD is one of the leading
causes of death in the Philippines. From January to May 2022, there were around
38,707 cases recorded, accounting for 18.6 percent of the total deaths in the country.
Similarly, Philippine Statistics Authority (2021) also reported a total of 56.76 thousand
cases in the first half of 2021, representing 18.7 percent of all deaths in the country.
Both are relatively higher than the recorded data from 2020, which shows 48.34
This problem also extends globally. According to Khan et al. (2020), IHD is
internationally the leading cause of death, disability, and human suffering. In 2017,
their study estimated that IHD affected around 126 million individuals worldwide,
approximately 1.72% of the world population. Among those affected, 9 million is the
estimated record of deaths globally. Moreover, they stated that the global prevalence
1
Ateneo de Zamboanga University
As mentioned, patients diagnosed with IHD are at high risk of a heart attack.
According to the NHS (2019), IHD is the leading cause of its development. In the
United States, a heart attack occurs every 40 seconds, with an estimated yearly
occurrence of around 805,000 cases — 605,000 being first heart attacks and the
remaining 200,000 being recurrent (Centers for Disease and Control Prevention,
2022).
A heart attack, medically known as myocardial infarction, occurs when the heart
does not receive enough blood due to a partial or complete blockage of the arteries
(Mayo Clinic, 2021). It can cause significant damage to the heart muscles, resulting in
Numerous health advocates urge the prevention of heart attacks in light of their
(2019), the 2019 Primary Prevention of Cardiovascular Disease guidelines from the
American College of Cardiology and the American Heart Association states that the
key recommendations for prevention include the use of risk assessments, the
incorporation of healthy lifestyle changes, and the use of medications (see sections
2.1.1 to 2.1.3). Also, spreading public awareness is encouraged (see section 2.1.4),
especially regarding the known symptoms of heart attack, as it is the primary approach
for early detection. The common symptoms are aches and heaviness in the chest,
pain that spreads to the arms, neck, jaw, or back, heaviness in the chest, nausea,
2
Ateneo de Zamboanga University
Unfortunately, heart attacks may also occur with no pain or symptoms, known as
silent ischemia (American Heart Association, 2015). This type of heart attack is only
identifiable via diagnostic tests (Mayo Clinic, 2022). These diagnostic tests extend
troponin from a given blood sample (see section 2.2.1). The presence of troponin
within the blood is indicative of a heart attack as it is released by the body when
Chest X-ray, on the other hand, is an imaging procedure where organs within the
chest are scanned to produce an image with the use of an X-ray (see section 2.2.2).
This procedure is used for ruling out other possible causes of conditions that may
present similar symptoms of a heart attack such as a pocket of air trapped between
In this procedure, sound waves are used as its modality for generating images of the
heart. This procedure can help identify areas of the heart that have already been
2.2.4). It involves inserting a thin tube (catheter), into one of the blood vessels in the
groin or arm. A special fluid, called a contrast agent, is then pumped into the catheter
which is a form of material that is highly visible when viewed through an x-ray. With
3
Ateneo de Zamboanga University
this, the vision of the flow of the fluid along the blood vessel or arteries allows the
the heart which is shown as a signal (see section 2.2.5). Any abnormalities that occur
within the heart reflect upon its electrical activity or ECG. With this, confirmation of an
ECG also extends to ambulatory applications; the specific device used for this is
called a Holter monitor (Mayo Clinic, n.d.). This mainly functions as a recording device
that stores the ECG reading continuously from a patient extending from 24 to 48 hours
of use. Another similar ambulatory device is the cardiac event monitor. It works
similarly to the Holter device but is used for longer periods of time (Cleveland Clinic,
2022). Both the Holter and event monitors are mainly used for the detection and
monitoring of arrhythmias.
Overall, IHD remains a common problem up to this day, and heart attack is an
lifestyle changes, and using medication as the most common and only available
preventive measures against it. Furthermore, diagnostic tests for heart attacks can
only be accomplished while inside the hospital. Not to mention, heart attack detection
mainly uses known symptoms as indicators, which can be limited in cases such as
silent ischemia.
4
Ateneo de Zamboanga University
gap among the objective-based approaches in detecting heart attacks; First, none of
the mentioned methods offer portable real-time detection of heart attacks that can
extend services outside the vicinity of the hospital. Providing a real-time detection
approach that can be carried out during everyday activities is relatively important since
heart attacks can occur anywhere and anytime. Second, real-time detection can serve
opportunity for early diagnosis and treatment which in turn, decreases the chances of
death and complications presented by heart attack to the victim. Third, real-time
detection addresses the dependence on symptoms for heart attack detection by using
making assumptions about heart attack occurrences. Lastly, real-time detection can
help in reducing the response time in addressing heart attack victims. This can help
decrease the chances of further damaging the heart and increase the chances of
survival. The statements provided are further supported by the component problems
presented below.
such as chest pain, pain that spreads to the arms, neck, jaw, or back, heaviness
2021). Among the symptoms provided, chest pain is considered the hallmark
5
Ateneo de Zamboanga University
of an impending heart attack (Aref, 2022). In line with this, seeking medical
attack. However, according to the study by Mol et al. (2018), most patients who
related. They have noted that of the 1,239 patients, around 60% referred to
emergency rooms for chest discomfort were released with non-cardiac chest
pain (NCCP). They have also stated that NCCP patients consume considerable
On the other hand, SCAI (2015) states that conditions that mimic heart
pain. Broken heart syndrome induced chest pain due to a burst of stress
musculoskeletal aches can exhibit chest pain due to a simple pulled chest
among women. According to Feinglass and Sun (2021), in the first year after a
heart attack, women in the United States have lower survival chances than
men. Within five years, there is an expectation that 47% of women either die,
develop heart failure, or suffer from a stroke. They claim that for women under
6
Ateneo de Zamboanga University
55, doctors are more inclined to discount heart attack symptoms as unrelated
to the heart. In support of this, the study conducted by Maserejian et al. (2009)
the least amount of confidence. Their results suggest that most younger women
with coronary heart disease symptoms are taken as gastrointestinal and mental
(2016), among the analyzed 1,180 claims against their internal medicine
physicians that closed from 2007–2014, 39% account for incorrect, delayed,
and failure in diagnosis — the most allegations, accounting for 6%, were related
provides cardiac damage, as a non-silent heart attack does, but with little to no
awareness on the victim's part. According to Mayo Clinic (2022), silent heart
and ECG. Gul and Makaryus (2019) state that the absence of pain in this
condition increases the risk of death and morbidity, given that patients do not
seek treatment on time. They have also emphasized the need for a
infarction because they have a higher risk of developing new coronary events
than those without silent ischemia. One of the examples of coronary events
7
Ateneo de Zamboanga University
to Vähätalo et al. (2019), among the 5869 individuals who experienced sudden
cardiac death, the majority, around 42.4%, have experienced silent myocardial
infarction.
unstable plaque (Heart Research Institute, n.d.). From the name itself, stable
plaque stably builds over time, while unstable plaque builds over time but with
identified by their thin, inflamed, fibrous cap covering a huge lipid core
(Fishbein, 2010). Plaques of this type are considered dangerous because they
are prone to rupture and can happen suddenly. Upon rupture, it can lead to
plaque, 86 percent are due to vulnerable plaques that moments ago were
harmless but all of a sudden cause complete blockage upon rupture. That
means 86% of heart attack victims can pass their stress test the day before the
events are due to plaque developments, and the current clinical approach does
data, has shown that the sites at which vulnerable plaques have ruptured
it was found that more than 50% of the plaques considered had greater than
arteries takes place. A heart attack, on the other hand, occurs when 100%
narrowing of the artery has been acquired (Ahmed, 2014). In line with the
blockage, little to no oxygen-rich blood is supplied to the heart, which, when left
cardiogenic shock, and heart rupture are some of the complications post-heart-
attack presents in which the majority require extensive treatment (NHS, 2019).
Heart attacks are also considerably costly, not just in terms of health but
also financially and mentally. According to Pierce (2021) from the Preventive
Diagnostic Center, aside from the hospital stay, other treatments involve the
counseling, and regular bloodwork and monitoring, which can extend for
attack may not only cause depression but can also lead to an increased risk of
another possible occurrence of heart attack over the next few months or years.
Aside from depression, Hashim et al. (2022) also stated that victims who
Vogel et al. (2019) and Gong et al. (2020), early diagnosis of heart attack is an
Genesis Heart Institute (n.d.), the more time wasted, the more damage is
presented to the heart, and the more fatal it becomes — "During a heart attack,
With this, the 2013 ACCF/AHA Guideline for the Management of ST-
heart attacks called the door-to-balloon time (O'Gara et al., 2013). The door-to-
balloon time is the time between the arrival of a patient with STEMI in the
10
Ateneo de Zamboanga University
2020). Reperfusion therapy is any form of procedure used to restore blood flow
balloon time of 90 minutes or less had a lower unadjusted mortality rate than
those with longer wait times. Additionally, Alizadeh et al. (2020) state that
have also concluded that it can influence short-term and long-term mortality
rates.
time holds much more significance than door-to-balloon time. Total ischemic
time is represented by the time from the onset of the heart attack until treatment,
between infarct size and mortality concerning total ischemic time and much less
11
Ateneo de Zamboanga University
indicator of a heart attack. While diagnostic methods can also detect heart attacks,
they are only accessible upon hospital visitations. In both cases, silent ischemia is not
accounted for, and there are no methods that offer portable real-time heart attack
detection. With this, it can be said that there is a need for objective-based devices for
real-time heart attack detection that is portable. Hence, the proponents suggest the
device wherein users can carry it along with their day-to-day activities. A machine-
learning algorithm will be incorporated into the device which will provide the capability
ensures the early preliminary diagnosis of heart attack and will be supported by the
intermittent monitoring of clinicians who will access, review, and confirm diagnosis
silent heart attacks, detection will be done in real-time. Additionally, to further ensure
ECG, will serve as the basis for heart attack detection. The suggested PHAAS device
will also be incorporated with an alert system to allow fast response time in addressing
heart attack detected. Moreover, this can ensure the opportunity of providing early
Overall, this device will be composed of six modules: the acquisition and signal
processing unit, a data analysis module, a storage unit, a display system, an alert
12
Ateneo de Zamboanga University
system module, and lastly, a power source. The conceptual design of the suggested
The acquisition and signal processing unit will be responsible for the acquisition
and pre-processing of the acquired ECG data. In acquiring the ECG, three electrodes
following the chest lead II placement will be used. This setup provides the view of the
ECG reading within the angle of lead II, which observes the heart from an angle of 60
degrees (ACLS, n.d.). With this, STEMI is detectable when the ST-elevation is
displayed from the ECG. Additionally, an analog-to-digital converter will be used for
the conversion of analog ECG data into digital. Upon collection, 2500 samples are
13
Ateneo de Zamboanga University
On the other hand, the pre-processing techniques involve the use of digital
filters and feature extraction methods. For digital filters, a bandpass filter will be
applied to ensure that the frequency ranges involved in the signal is within frequency
range. In terms of random noises, a moving average filter will be used. And lastly, a
median filter will be provided for removing the baseline wander. Regarding feature
learning algorithm will be designed. The chosen model to be used is the support vector
machine which will be trained for classifying STEMI and normal ECG.
In terms of the storage unit, it will be responsible for storing ECG data which
are namely the raw and filtered data, features, and the predicted ECG class. These
data are stored locally within the device and will be used by clinicians to further review
and diagnose the involved user. This can be done by manually accessing the local
storage upon hospital visits which is advised to be done weekly. Furthermore, future
technicians, and currently, the proponents can utilize the records for the evaluation of
the pre-processing techniques. The data can also be used to further training and
The display module, on the other hand, mainly serves to provide the ECG
status for user awareness via text display. There will only be two ECG statuses that
can be presented, which will be displayed depending on the result of the data analysis
module. If the data analysis module detects STEMI within the ECG, “STEMI detected”
14
Ateneo de Zamboanga University
on the screen. The main purpose of this module is to provide user awareness,
automated notifications regarding the ECG status of the us er. This will be done
Communication means will be via SMS and voice calls wherein contacts include the
user and clinicians. In line with the notification, the clinician is expected to
communicate with the user and provide advice regarding what to do with their
situation. In terms of sending notifications to the user, this serves as a second layer in
Lastly, the battery module serves as the power source of the PHAAS. This will
mainly provide power to secure functionality for each of the modules involved. Utilizing
1.4 Objectives
In this section, the general and specific objectives of the study are provided.
15
Ateneo de Zamboanga University
1.4.2.3 Design and train with the use of European ST-T database, a
Support Vector Machine model that can classify STEMI and normal
via SMS and voice call to designated contacts such as clinicians and
1.4.2.5 Record and store acquired ECG data including filtered data and
features extracted.
1.4.2.6 Display the ECG status of the user using an LCD screen.
automatic, real-time, pre-diagnostic heart attack detection device for individuals with
16
Ateneo de Zamboanga University
The device will mainly use a trained machine learning model, namely Support
Vector Machine. This model is only capable of binary classification wherein it can only
classify ST-elevated and normal ECGs. Furthermore, in training and testing the SVM,
an online open-sourced database, namely the European ST-T Database, will be used.
electrodes following the chest lead II placement where ECG acquired is up to 2500
samples. In terms of the application of digital filters, a bandpass, moving average, and
notifications will only be done when STEMI is detected. Communication means are
via SMS and voice calls only, in which content only provides ECG status along with
date and time. The designated contacts considered are the user and an involved
clinician.
Regarding the storage of ECG data, it will be saved within the local storage of
the device which is the micro-SD card. It is where the data are accessed manually by
the clinicians which can be acquired during hospital visits by the user. There will be
specifically four types of data to be saved: raw data, filtered data, features, and the
For the display of ECG status via the LCD screen, only two outputs will be
displayed. These statuses will only be shown via text. Additionally, a power bank will
17
Ateneo de Zamboanga University
be used as the power source of all integrated components. It is estimated to last for
Moreover, this study excludes addressing other cardiac events and only
infarction only. Additionally, the device will mainly be used as a real-time, pre-
diagnostic device; the diagnosis is still yet to be conducted and confirmed by medical
professionals.
Regarding the application of beta testing, it must be noted that the participants
considered are in good health conditions. Testing the capability of the device in terms
of detecting STEMI will only be limited via the use of testing data acquired from online
databases and the use of an ECG simulator. The proponents opted for this given heart
Additionally, the sole purpose of beta testing is to only test the user acceptance of the
conducted. The evaluation will be done using the system and beta testing data. This
test is solely to determine the extent the machine learning model can perform
accordingly.
The results of the development of the Portable Heart Attack Alert System
18
Ateneo de Zamboanga University
The most who will benefit from this study are the people who are prone
disease. The device will serve as a safety net that will decrease the risk of
stress, given that a device can be relied upon to detect unpredictable heart
attacks objectively.
members would also greatly benefit from it. The device will provide ease and
reduce psychological stress knowing that the family member concerned has a
occurs.
Healthcare Providers
The study provides the development of a device that can lessen the
continuous remote monitoring. With this, fewer trips will be required when
visiting the hospital, and face-to-face contact for diagnosis is also limited, which
19
Ateneo de Zamboanga University
diagnoses with a medical professional can also be made online, given that the
This study allowed the proponents to study a topic of great interest. Not
to mention, doing this paper allowed the proponents to develop their critical
Future Researchers
study can also guide further improvements with the device developed, such as
20
Ateneo de Zamboanga University
CHAPTER II
REVIEW OF RELATED LITERATURE
This section lists and discusses the current prevention methods for IHD, and
Disease guidelines. A list of local and international programs that advocate for cardiac
given that blocked arteries can ultimately lead to a heart attack or stroke, which
can be fatal. The risks are determinable with the use of the tests listed below
Blood pressure is the force of blood that pushes against the walls
of the arteries each time the heart pumps blood (Medline Plus, 2020).
Accordingly, if the blood pressure remains high for a long time, it could
American Heart Association (2022), a heart attack occurs due to the tear
high blood pressure causes to the arteries. With this, LDL (bad)
21
Ateneo de Zamboanga University
systolic pressure exceeds the normal value of 120 and the diastolic
pressure of 80. The higher the blood pressure, the more dangerous it
high blood pressure, on the other side, includes healthy lifestyle changes
and medications.
digest food, the body needs cholesterol. It can either be produced by the
proper delivery of cholesterol, from other parts of the body to the liver.
The liver will be removing the cholesterol from the body. On the other
hand, LDL and VLDL are considered “bad” cholesterol because high
levels can lead to plaque build-up in arteries. The build-up of plaque can
level. Overall, the higher the LDL and VLDL level, and the lower the HDL
level, the more at risk the heart becomes. Healthy lifestyle changes such
22
Ateneo de Zamboanga University
energy for most of the cells in the body. While fasting, the normal blood
glucose ranges from 70 to 99 mg/dL (3.9 to 5.5 mmol/L), and cases that
high blood sugar concentration can damage blood vessels nerves that
control the heart and increase their risk of developing risk factors
(National Institute of Health, 2021). Such risk factors include high blood
pressure and high “bad” cholesterol levels that doubles the likelihood of
Prevention, 2022). Keeping the blood sugar level in check is one way of
keeping heart health in good condition which can be kept track via blood
23
Ateneo de Zamboanga University
CVD Risk Profile. The mentioned test calculators can either be used
the risk of heart disease development (Mayo Clinic, 2022). Eating foods
24
Ateneo de Zamboanga University
Regular physical activity can also help reduce the risk of having
a heart attack (Mayo Clinic, 2022). It can also reduce the risk of other
and type 2 diabetes (Mayo Clinic, 2022). The body mass index (BMI) or
25
Ateneo de Zamboanga University
the blood, lowering blood sugar, and reduce the risk of having type 2
diabetes.
chemicals used in cigarettes can cause blood to thicken and form clots
in veins and arteries, which may result in a heart attack and sudden
Diseases, 2022).
sugar, and blood pressure levels. Additionally, it may also cause poor
26
Ateneo de Zamboanga University
help reduce stress and improve one's health (Mayo Clinic, 2022).
attack. Sleeping less than six hours increases the chance of a heart
heart attack because both heart rate and blood pressure spikes abruptly
with at least seven hours of sleep every day is recommended for better
2.1.3 Medications
medications (Mayo Clinic, 2022). This section lists and discusses the common
medications used to lessen the risk of heart attack by targeting parameters that
risk its development. The indicated medications are acquired from the Heart
and Stroke Foundation of Canada (n.d). It is important to take note that while
most of these medications are similar in function, they come with their own use
cases, risks, and specific instructions that healthcare providers give to the
patient.
27
Ateneo de Zamboanga University
factor that can contribute to heart attack. The medications for addressing high
blood pressure include ACE inhibitors, which reduce the risk of heart attack by
opening blood vessels. Specifically, it will make the heart pump easier, lower
blood pressure, protect the heart and blood vessels, and protect the kidneys
treat high blood pressure and heart failure. Angiotensin Receptor Blockers
(ARB) treat blood pressure and heart failure by blocking the action of the
enzyme that narrows blood vessels, called Angiotensin II. Beta-blockers, also
blood pressure, heart failure, and arrhythmia and protect the heart from stress
and abnormal heartbeats. It does this by lowering the heart rate and blood
(CCBs), also known as calcium channel antagonists, are vasodilators that help
control high blood pressure and chest pain caused by heart disease and
attack. The following are the known medications that address it: Cholesterol
absorption inhibitors help lower the overall cholesterol level in the blood by
reducing the amount of cholesterol stored in the liver and improving how
28
Ateneo de Zamboanga University
cholesterol is cleared from the blood. Fibrates, also known as Fibric Acid
bad cholesterol, and increasing the good cholesterol in the body. Similarly,
Niacin, also known as nicotinic acid, treats high cholesterol by slowing down
the liver's production of bad cholesterol and increasing the good cholesterol in
the body as well. Resins treat high cholesterol by tricking the body into
producing more bile using cholesterol. With more cholesterol being used to
create more bile (which passes in stool), it results in less bad cholesterol in the
blood. Lastly, Statins help lower the long-term risk of having a heart attack by
attack. There are only two medications used in treating blood clots:
developing blood clots by preventing existing clots from getting bigger. When
taking this medication, patients should expect regular blood tests to check that
their blood is not too thin (which can cause bleeding) or too thick (which can
lead to clots). Antiplatelets can also be taken for anti-blood clotting. They are
taken mainly by patients who had a cardiac event. When platelets rush to a
wound when someone gets a cut, it makes the blood sticky as they bind
together and form a clump to help stop the bleeding. This leads to blood clots,
29
Ateneo de Zamboanga University
the blood less sticky, preventing arteries and stents from being plugged by
clots.
2.1.4.1 HEARTS
Hearts Initiative led by WHO and the US Centers for Disease Control
based care. With these six modules comes an implementation guide that
countries.
30
Ateneo de Zamboanga University
purpose of "saving more of the lives taken and protecting more of the
in the next five years (Million Hearts, n.d.). It is co-led by the Centers for
Disease Control and Prevention (CDC) and the Center for Medicare and
Medicaid Services (CVS). The main priorities of this initiative are to build
2.1.4.3 WISEWOMAN
risk for heart disease and stroke (Centers for Disease Control and
to 2013, this program served almost 150,000 women, with 91% having
at least one risk factor of heart disease or stroke, which led to almost
31
Ateneo de Zamboanga University
health. Advocating for healthier habits, the PHA released vibrant and
servings of fruits and vegetables, two hours of screen time, one hour of
tops and pants every Friday as a “dress down day.” A similar campaign
launched by the PHA called Fit Heart Minute, also advocates for physical
FhM, Doc Nannette, “It is a practical alternative for people who are not
Advocating for being CPR ready, the PHA launched Save a Life, Learn
advanced cardiac life support training program which comes in the form
32
Ateneo de Zamboanga University
STEMIConsult which is available for free in the Apple Play Store and
event about “The Heart Truth about Women,” World Heart Day which is
an event held every September 29, and the Angina Awareness Initiative
health (Mayo Clinic, n.d.). This section lists and discusses the current diagnostic tests
whether a person has experienced a heart attack through a blood test. This is
Troponin I and Troponin T, are released as early as 4 hours after a heart attack
note that doctors also perform other tests along with blood tests, as elevated
levels of troponin alone cannot solely indicate that a person had a heart attack.
33
Ateneo de Zamboanga University
This usually involves physical examination, asking for the patient's medical
history, and an evaluation of ECG. The level of troponin will indicate whether a
heart attack has occurred, along with its specific type; if there is an increase
from the normal range of 0–0.04 ng/ml, heart attack is considerable (Villines,
2022). Besides diagnosing a heart attack, other blood tests can be used to
diagnose and manage heart disease (Mayo Clinic, 2022). These blood tests
symptoms, such as a pocket of air trapped between the layers of the lungs
chest X-rays can be used to reveal the condition of the lungs, heart-related lung
problems, the size and outline of the heart, blood vessels, calcium deposits,
fractures, postoperative changes, and medical devices inside the body, such
2.2.3 Echocardiogram
that utilizes sound waves as its modality for creating images of the heart. This
34
Ateneo de Zamboanga University
procedure can help identify areas of the heart that have already been damaged
tests, each with its use cases and risks, and will be conducted depending on
chest, recording the sound wave echoes in the heart, resulting in moving
images displayed on a monitor. In the case that the doctor needs clearer
This test involves sending a flexible tube down the throat and into the tube
connecting the mouth to the stomach before viewing it on a monitor. In the case
the doctor needs to check for blood flow problems and blood pressure in the
check for coronary artery problems which only occur during physical activity.
This test is conducted by taking images of the heart before and immediately
after the start of the physical activity. In the case that physical activity is not an
option, medication delivered by injection will make the heart pump as hard as
with physical activity. The risk involved in this procedure is that it may cause an
35
Ateneo de Zamboanga University
the type), especially when the result is normal and further testing is not
required. On the other hand, doctors may require more tests if the results are
not normal.
vessels (Mayo Clinic, 2021). This is conducted with the use of a dye that is
visible via X-ray, and an X-ray machine. During the procedure, a catheter is
inserted into the patient's artery, and the dye is injected into the catheter. As
the dye flows through the blood vessels, corresponding blockages, and
constricted areas are identifiable when viewed using X-ray. After conducting
the procedure, it should show how many coronary arteries are blocked or
narrowed, the location of these blockages, and the amount of blood flow
blocked. Due to the risk of complications, angiograms are conducted only after
2.2.5 Electrocardiogram
the electrical activity of the heart. ECG can provide information about the
36
Ateneo de Zamboanga University
In general, the ECG is acquired through the use of sensors, which are
attached to the patient’s skin, and records the heart impulses with the use of
an ECG machine. There are three main methods in conducting ECG tests:
resting, stress, and ambulatory (NHS, 2021). Resting ECG is the acquisition of
ECG while the subject is at rest; no movement is involved. Stress ECG, on the
activity such as exercise. Lastly, ambulatory ECG, is acquiring ECG while the
devices used for this type of ECG are small portable machines such as Holter
electrical signals from the heart of the patient for one to two days. The patient
is expected to wear a Holter monitor for the entire duration of recording, even
while sleeping. They can do most of their daily activities unless their healthcare
provider tells otherwise. A form will also be given to record all daily activities
breath, chest pain, and lightheadedness. On the other hand, a cardiac event
monitor is for patients whose symptoms of arrhythmias do not happen that often
(Cleveland Clinic, 2022). There are four types of cardiac event recorders, each
with their own use cases and functionality: a patch recorder, symptom event
monitor, loop memory monitor, and implanted loop recorders. Cardiac event
monitors can be worn by a patient for up to a month which is ideal for recording
37
Ateneo de Zamboanga University
arrhythmias that do not happen every day. Just like the Holter monitor, the
patient is expected to keep track of their activities, the medications they are
taking, and symptoms that may occur when they are active for the entire
an artery, which can result in extensive damage to a large area of the heart.
NSTEMI heart attack, on the other hand, is a less serious condition than
partially developed, and a small section of the heart is damaged. When left
untreated, NSTEMI can progress to STEMI. Lastly, unstable angina is the least
damage has yet been developed. When left untreated, it can progress to
NSTEMI.
placements for acquiring ECG. The first most used electrode placement is the 3-
electrode system which uses three electrodes placed on the right arm (RA), left arm
38
Ateneo de Zamboanga University
(LA), and left leg (LL) with the monitor displaying the bipolar leads (I, II, and III)
(Cadogan, 2022). The second most used electrode placement, the 5-electrode
system, is similar to the previous electrode placement. It also has electrodes placed
in the right arm, left arm, and left leg with an additional two electrodes placed on the
right leg (RL), and the chest (C). This placement will also display the bipolar leads (I,
II, III) and a single unipolar lead depending on the position of the chest lead. Lastly,
the 12-lead ECG placement uses a total of 10 electrodes with four electrodes placed
on all four limbs (RA, LA, RL, LL) and six electrodes on the precordium (V1 - V6). This
placement will allow for interpretation of the inferior (II, III, aVF), lateral (I, aVL, V5,
V6), and anterior (V1-V4) areas of the heart. Other electrode placements such as the
right sided ECG electrode placement, the V4R ECG lead placement, posterior leads,
the Lewis lead configuration, and the fontaine bipolar precordial leads are used for
Chowdhury et al. (2022) uses dry electrodes as they are preferable in obtaining ECG
signals compared to wet electrodes because dry electrodes are reusable and non-
disposable. On the other hand, wet electrodes degrade over time since the gel present
dries as time passes which effectively increases the impedance and affects the overall
quality of the ECG signal derived. Additionally, regarding electrode placement, Chest
Lead II and Chest Straight Lead were suggested, given that they yielded a similar
quality comparable to clinical-grade ECG traces. In the study made by Gusev et al.
(2017), they used ECG clips to acquire the ECG signals. However, given that the
acquisition was made using an ECG simulation, it is not desirable for human
39
Ateneo de Zamboanga University
application. On the other hand, another method using a wireless, mobile, and
wearable ECG biosensor is another mode of ECG acquisition. Ahmed & El-Metwally
(2015) suggested this method to enable wireless transmission. The data transmission
between the wearable ECG sensor and the smartphone is via Bluetooth.
One of the many ways that can effectively remove noises from signals such as
ECG is digital filters. According to the method used by Chowdhury et al. (2019),
average moving filters and median filters are applicable. The average moving filter
removes the random noises and allows the smoothing of signals. On the other hand,
the median filter addresses the baseline wander — it fixes the ECG signal to be
accuracy for STEMI detection and 96.3% for NSTEMI detection using SVM machine
learning. In addition to the digital filters and feature extraction, biorthogonal wavelet
transformation was included for synthesizing ECG signals and labeling significant
Another method of noise filtering is the use of simple DSP filters. According to
the suggested approach by Ahmed & El-Metwally (2015), two DSP bandpass filters
are enough. The first DSP bandpass filter takes the ECG signal that ranges from 5-20
40
Ateneo de Zamboanga University
Hz to reduce feature space. The other one uses a frequency range from 0.5-30Hz to
eliminate noises. Regarding feature extraction, the method suggested is the adaptive
differential technique, which can detect the R peak in the ECG signals. Accordingly,
additional morphological processes can be applied to detect QRS length, PQ, and ST
segments.
wavelet transform is applicable for feature extraction and can be combined with
statistical parameters such as standard deviation and Shannon energy for additional
features. Six combinations of the statistical parameter with the continuous wavelet
transform have been tested. The result suggests that the continuous wavelet
transform with standard deviation taken for the third sub-signal had been the most
suitable.
applicable for extracting the ST segment from the ECG (You et al., 2015). In this
approach, the use of empirical mode decomposition (EMD) for denoising of the ECG
signal is incorporated. The method is tested with real exercise ECG data acquired
using a twelve-lead ECG recorder. The results showed the feasibility of the approach,
and it has been emphasized that it is effective in ECG recordings heavily affected by
noises.
41
Ateneo de Zamboanga University
specific frequency ranges, noises such as baseline wander and 60Hz line interference
(fCWT). According to Art & Broek (2022), fCWT provides an improved signal analysis
balance between speed and accuracy. With this, a real-time, wide-band, high-quality,
was tested, it was concluded that “fCWT is shown to have the accuracy of CWT, to
have 100 times higher spectral resolution than algorithms equal in speed, to be 122
times and 34 times faster than the reference and fastest state-of-the-art
implementations…”.
inferences from a set of data. The utilization of machine learning in addressing heart
approaches have been developed and tested in terms of detecting heart attacks.
algorithms are namely three decision trees, two discriminant analysis, six support
vector machines (SVM), six k-nearest neighbors (KNN), and five ensemble classifiers
ST Change Database. Among all those tested, the two best algorithms identified were
SVM and KNN. To further improve the application of the algorithm, time, frequency,
42
Ateneo de Zamboanga University
and time-frequency domains were extracted. The methods involved are Wigner–Ville
(EMBD). The best candidate that stands is the SVM algorithm with the EMBD method.
They showed the highest accuracies of 97.4% and 96.3% for detecting STEMI and
NSTEMI, respectively.
In another study conducted by Gupta et al. (2021), random forest, decision tree,
gradient boosting, and logistic regression machine learning algorithms were tested out
in detecting heart attacks. They utilized the datasets from the Framingham database
and UCI Heart repository. The most suitable algorithm was found to be gradient
boosting classifiers that yielded the highest accuracy, with an average percentage of
85.5%.
Logistic regression, naïve Bayes, decision tree, random forest, support vector
machine, and k-nearest neighbor were also tested by Aravindh et al. (2021). The
utilized dataset is from Kaggle, an online source also adopted by the World Health
Organization (WHO). The result shows that the logistic regression algorithm was the
most effective among all the algorithms tested, with an accuracy of 91.8 %.
Currently, only one existing device has been developed for objective-based
device that detects electrical signals from the heart (HeartBeam, 2022). Patients can
use this device anywhere to help physicians assess whether the chest pain
43
Ateneo de Zamboanga University
guided through the collection process with the help of a smartphone app allowing
communication between the physician and patient. It allows the signals recorded to
be sent to the HeartBeam cloud, where the signals are analyzed and compared to the
patient's asymptomatic baseline recording. Signal analysis, along with the patient's
history and reported symptoms, are combined into a proprietary algorithm that
physician determines whether a heart attack has occurred or not and informs the
patient.
is not provided since patients are only expected to use the device when heart attack
symptoms are observed, silent ischemia are not considered in this case. Additionally,
that this product is not cleared by the Food and Drug Administration (FDA) and is not
Since heart attack is a widely recognized concern in the medical field, various
methods, and approaches to addressing this issue have been explored. This section
discusses the existing designs of heart attack assistive devices with similar
approaches to the proposed device, the portable heart attack alert system. A summary
44
Ateneo de Zamboanga University
The first existing design is a wearable real-time heart attack detection and
warning system to reduce road accidents (Chowdhury, et al., 2019). The authors
aimed to design a real-time heart attack alert system device to avoid and reduce road
accidents related to heart attacks. While driving, the device strives to monitor the
driver, particularly their ECG signal. If the device detects a heart attack indicated by
the ECG, the driver would immediately be notified and suggested to seek medical
heart attack detector system. The wearable sensor is made using the RFduino
microcontroller. It acquires the ECG with dry electrodes, which are attached to the
driver's chest. Filters are incorporated with this subsystem, such as moving average
and median filters, for removing random noises and baseline wander. Biorthogonal
wavelet transformation was also used to detect the R peak and synthesize the ECG
signal.
On the other hand, the intelligent system, built using a Raspberry Pi 3, utilizes
Machine (SVM) algorithm was determined to be the most effective in the detection of
heart attack, with a 98.3% precision and 97.4% accuracy in identifying ST-elevation
Myocardial Infarction (STEMI) and 98.7% precision and 96.3% accuracy in identifying
used, and it serves as the alert system responsible for sending notifications to
designated contact persons and notifying the driver upon detection. Both subsystems
45
Ateneo de Zamboanga University
communicate via Bluetooth. In terms of power supply, the wearable sensor subsystem
socket splitter of the car. The recognized limitations of this device include the
following: the limit in portability (given that the device is limited for the use of drivers),
the bulkiness of the design, the limited power source for the wearable subsystem, and
lastly, the reliability of the power source of the intelligent subsystems in cars.
method for heart attack alert detection (Gusev et al., 2017). This device includes a
sensor is a wireless ECG electrode capable of acquiring and transmitting ECG signals
via Bluetooth. The receiving end of the data transmission is the smartphone which
serves as the storage where the ECG data is saved. The smartphone also partially
processes the signal, such as using DSP filters to remove noise. The data is then
transmitted to the cloud-based server via LAN/WAN. It is where the ECG can be
accessed for complete analysis and diagnosis of a heart attack. The cloud server is
reliability on local storage media of the patient’s smartphone for storing ECG data.
Another is the reliability of the internet connection for the analysis of data. Without an
internet connection, the analysis feature would be inaccessible, and heart attack
pre-processing can be done, such as filtering out the noises — data is fresh, and no
46
Ateneo de Zamboanga University
For a more integrated approach, the study of Ahmed and El-Metwally (2015)
receive alarms from a portable, low-cost heart attack detection system worn by the
patient. This system uses an Arduino shield kit coupled with ECG electrodes for data
acquisition from the patient. Once the data is acquired, it is processed to be classified
alarm transmitted via a ZigBee module connected to the Arduino kit. On the receiving
end is another ZigBee module that receives the alarm and starts contacting a list of
system, a heart attack simulator was used to produce abnormal ECG signals at
specific intervals. Results show that the receiver established at a range of 1.24 km
away from the transmitter could receive accurate alarm signals in short time delays
immediate intervention upon heart attack detection by contacting nearby hospitals and
readings for early analysis. Despite these advantages, there is no filtering of data
acquisition incorporated in the design, in which movement from the patient can
contribute to noise in the ECG. In identifying a heart attack, the device is limited to
intervals. Unlike the first previously mentioned study, the algorithm's accuracy in
determining whether a heart attack occurred was not provided. In terms of data
47
Ateneo de Zamboanga University
that will result in an error in data transmission. Lastly, the study does not mention how
the patient will be notified that a heart attack is indeed occurring, despite being able
to send an alarm to the receiving module in the hospital and alert the designated
The last approach is a minimally invasive solution that utilizes a biosensor that
can detect whether a heart attack has occurred by identifying two cardiac markers:
Myoglobin (Myo) and Myeloperoxidase (MPO) (Mondal et al., 2017). The device uses
and a homo-bi functional crosslinker before the covalent attachment of the antibodies
the filter paper allows detection when the target proteins are bound to the specific
mV in the frequency range of 100 Hz to 100 kHz. The biomarkers can be detected in
the buffer solution within the concentration range of 100 ng/mL to - 50 ug/mL. The
detection limit obtained for these biomarkers spiked in human serum is one ug/mL
and further blocking using human serum improves the detection limit to 500 ng/mL.
fabrication techniques that can detect the occurrence of heart attack with two
making this sensor more suitable for diagnostic applications. However, this method of
48
Ateneo de Zamboanga University
previously mentioned solutions that are noninvasive. It is also the only solution that
49
Ateneo de Zamboanga University
50
Ateneo de Zamboanga University
51
Ateneo de Zamboanga University
52
Ateneo de Zamboanga University
personnel (no
built-in alert
system to
notify patients
involved).
- in terms of
data
transmission,
the limit of
correct
transmission
begins at
around 1.2 km
distance
(particularly
with the 3-
second
transmission
of ECG
record);
greater than
1.2km results
in error in
data
transmission
53
Ateneo de Zamboanga University
determine - inexpensive
whether a heart materials and
attack has fabrication
occurred techniques are
-AC impedance used to make the
spectroscopy can biosensor
detect when the
target proteins
(Myo and MPO)
are bound to the
specific antibody
changes in the
impedance
between the
electrodes.
-Impedance is
measured using
a frequency
response
analyzer. The
biomarkers can
be detected in
the buffer
solution within
the concentration
range of 100
ng/mL to - 50
ug/mL
54
Ateneo de Zamboanga University
In relation to the comparison provided in Table 2-1, the existing studies are also
compared to PHAAS. Table 2-2 provides the summary and comparison in terms of
each study and PHAAS's available features. Each feature considered is incorporated
(Mondal et al.,
(Ahmed & El-
(Gusev et al.,
Metwally,
al., 2019)
PHAAS
Beam
2017)
2015)
2017)
Heart
Portability
(Can the device be
✗ ✓ ✓ ✓ ✓ ✓
carried around by
the subject?)
Continuous
Remote
Monitoring
(Is it capable of ✓ ✓ ✓ ✗ ✗ ✓
continuous and
remote
monitoring?)
Application of
Machine Learning
(Does it use
automatic ✓ ✗ ✗ ✗ ✓ ✓
detection,
specifically with the
use of ML?)
55
Ateneo de Zamboanga University
Utilization of ECG
as data
(Given its
✓ ✓ ✓ ✗ ✓ ✓
reliability, is ECG
the parameter
used?)
Non-Invasive
(Is it non- ✓ ✓ ✓ ✗ ✓ ✓
invasive?)
Alert System
(Is it incorporated
with an alert
system? Can it ✓ ✗ ✓ ✗ ✗ ✓
contact personnel
in cases of
emergency?)
Pre-processed
data
(Are there ✓ ✓ ✗ N/A N/A ✓
application of
filters?)
Independence to
Internet
Connection
✓ ✗ ✓ ✓ ✗ ✓
(Will the device still
function, in terms
of detection,
56
Ateneo de Zamboanga University
without internet
connection?)
Incorporated with
Storage
✓ ✓ ✓ N/A N/A ✓
(Can the device
save the results?)
57
Ateneo de Zamboanga University
CHAPTER III
METHODOLOGY
3.1 Requirements
This section discusses the theoretical considerations, and the hardware and
software requirements necessary for the development of the Portable Heart Attack
This section explains the theories and concepts in designing the PHAAS
3.1.1.1 Electrocardiogram
an indication of specific heart activity, which, when the reading does not
fall on the normal pattern can indicate heart problems such as heart
et al., 2019).
S wave's end and the T wave's start (Biopac Systems, Inc., n.d).
Typically, in a normal ECG reading, it lasts less than 0.20 seconds and
58
Ateneo de Zamboanga University
repolarization.
Figure 3-1. Components of Normal ECG Reading (Biopac Systems, Inc., n.d.)
The T wave, on the other hand, is the last waveform shown within
values fall less than 0.5 mV with a duration of 0.10 to 0.25 seconds.
59
Ateneo de Zamboanga University
type of heart attack. With this, the proponents chose to focus the PHAAS’
2019). The ST elevation shows the J point, which is the junction of the
(2021), the threshold for ST elevation is 0.25mV for adult males and
waveform.
60
Ateneo de Zamboanga University
the data classes into their respective groups, as shown in Figure 3-3.
Figure 3-4. Optimal Hyperplane and Maximum Margin in SVM (Gandhi, 2018)
margin is the maximum distance between the two classes of data points
61
Ateneo de Zamboanga University
62
Ateneo de Zamboanga University
intervals that composes the ECG signal. A bad-quality ECG, on the other
hand, provides the opposite — the waves, segments, and intervals are
are required.
63
Ateneo de Zamboanga University
Figure 3-8, any frequency below this given point will have higher
pass through the filter with little to no attenuation). The higher cut-
off frequency, on the other hand, works similar as the low cut-off
64
Ateneo de Zamboanga University
step response.
number of samples taken from the input for averaging (also called
window length), and lastly, the y[n] is the single average output
1
𝑦[𝑛 ] = (𝑥[𝑛 ] + 𝑥 [𝑛 − 1] + 𝑥 [𝑛 − 2] + 𝑥 [𝑛 − 3] + 𝑥 [𝑛 − 4]) (3.2)
5
the average value is also five. In calculating the average, the sum
65
Ateneo de Zamboanga University
After the first point, the filter moves to another set of samples and
outputs the average value until it is able to tackle all parts of the
larger the window length, the clearer the signal becomes or the
66
Ateneo de Zamboanga University
represented as
equation above (3.3) is five. Therefore, five values from the input
signal (x[n]) will be considered, and among all the chosen values,
after arranging them in the proper order, the median or the middle
67
Ateneo de Zamboanga University
shows a dense PSD from less than 5Hz. The peak is around 2Hz,
with a PSD of greater than 400V 2/Hz. Lastly, for the T-wave
inversion (C&F), the peaks are also around less than 5Hz, but
68
Ateneo de Zamboanga University
technique for data analysis (Alharbey et al., 2021; Arts & Broek,
2022).
the wavelet must have a zero mean; and second, it should have
sum of areas under the curve on both the positive and negative
On the other hand, for having finite energy, the area under
69
Ateneo de Zamboanga University
mathematically represented as
+∞
∫ |𝜓 (𝑡)|2 𝑑𝑡 < ∞ (3.5)
−∞
present from the input signal at specific times. There are two
translation.
1 +∞ 𝑡−𝑏
𝐶𝑊𝑇 (𝑎, 𝑏 ) = ∫ 𝑥(𝑡)𝜓 ( ) 𝑑𝑡 (3.6)
√𝑎 −∞ 𝑎
70
Ateneo de Zamboanga University
meant to collect rapidly changing fine details from the input signal.
When the scaling factor is low, on the other hand, the translation
domain.
Figure 3-11. Wavelets with small and long scale factors (MathWorks,
n.d.)
learning algorithms.
71
Ateneo de Zamboanga University
data.
also included.
a Power bank.
72
Ateneo de Zamboanga University
Figure 3-12. Sparkfun Analog ECG Sensor Module Kit (Alibaba, n.d.)
73
Ateneo de Zamboanga University
from the European ST-T database to train and test the machine
storage, 40 GPIO pins, and uses a USB C port for power delivery.
74
Ateneo de Zamboanga University
this study.
75
Ateneo de Zamboanga University
messages via SMS and make voice calls. This will enable the
this study.
necessary text the proponents require. This will enable the LCD
76
Ateneo de Zamboanga University
it.
the values to be read quickly by the user. This device will be used
77
Ateneo de Zamboanga University
monitor, which can take less than 5-minutes (Fluke, n.d.). It has
many more. Aside from that, this device can also simulate known
78
Ateneo de Zamboanga University
normal ECG, ECG with artifacts, and ECG with varying ST-
elevations.
3.1.2.2.3 Laptop
i5-9300H and has Nvidia GeForce RTX 2060 graphics. It also has
3.1.3.1 Raspberry Pi OS
running the function of the PHAAS device. Mainly it will allow the device
to run the software programs to process the signal acquired from the
subject, implement the machine learning algorithm, send the alert using
the GSM module in the occurrence of the heart attack, and display the
allow the reading, writing, and processing of signals from the mentioned
3.1.3.3 Python
n.d.).
learning. It has various tools at its disposal for model-fitting, data pre-
n.d.), which will help create the chosen machine learning algorithm for
this study.
signal.
the PHAAS, specifically in terms of the hardware and software components. The block
81
Ateneo de Zamboanga University
hardware components. The modules involved in the PHAAS device are the
acquisition and signal processing unit, data analysis module, alert system
module, storage unit, display system, and battery module. These components
are confined in a single enclosure that is portable enough for the subject to
signal processing unit is to allow the acquisition of ECG data from the
subject. Mainly, this is composed of the analog ECG sensor and analog-
to-digital converter.
82
Ateneo de Zamboanga University
clinical grade ECG traces when acquired and are suitable for
83
Ateneo de Zamboanga University
the negative electrode will be aligned along the left arm. The
neutral electrode, on the other hand, is aligned unto the left leg.
electrodes.
84
Ateneo de Zamboanga University
analog ECG signals measured using the ECG sensor into digital
point of the digitized ECG signal and is where the data analysis
85
Ateneo de Zamboanga University
the analysis of ECG data. It also serves as the access point where
diagnosis locally on the device. This module involves the use of a Micro-
SD card.
86
Ateneo de Zamboanga University
designated contacts, the user and involved clinician, when a heart attack
the GSM module will notify the designated contacts through SMS
87
Ateneo de Zamboanga University
was able to detect a heart attack or not. This module is mainly composed
of an LCD Display.
88
Ateneo de Zamboanga University
software aspect of the PHAAS device. The main flowchart of the functional
89
Ateneo de Zamboanga University
acquire the ECG data up to 2500 samples. Upon acquisition, the raw
data will then be pre-processed with the application of digital filters for
the removal of noise which are namely bandpass, moving average, and
median filters. Feature extraction methods, on the other hand, are also
data analysis module for further processing. The flow diagram of the
90
Ateneo de Zamboanga University
It must be taken note that the acquired raw data and the
access the user’s data for further review. The mentioned data that are
meant for storing are forwarded for the storage module to address.
the alert system module, saved in the storage module, and displayed by
storage and display modules. Figure 3-28 shows the flow diagram of the
91
Ateneo de Zamboanga University
92
Ateneo de Zamboanga University
Validation
which are the relevant data being considered in this study. This
93
Ateneo de Zamboanga University
94
Ateneo de Zamboanga University
3.1.1.4.
it will then be split into two groups: one set for training and another
70:30 where 70% of the data will be allotted for the training and
95
Ateneo de Zamboanga University
which in the case of this paper, is STEMI and normal ECG. For
Figure 3-29.
96
Ateneo de Zamboanga University
hand.
97
Ateneo de Zamboanga University
(Codecademy, n.d.).
deviation by 1.
max normalization has a set range to fit the data but does
98
Ateneo de Zamboanga University
the opposite.
The Storage Module is where the ECG data are saved. It is stored locally
wherein four types of data are considered: the raw data, filtered data, features,
and class label predicted. All the indicated data are to be saved as files in an
medical professionals can access the data for further review and diagnosis.
99
Ateneo de Zamboanga University
module. This module is only utilized when a STEMI is identified within the ECG
designated contacts, which are the user and the clinician. The notification will
mainly include the status of the subject along with the date and time and relayed
via SMS and voice call. The alert system module flow diagram is shown in
Figure 3-31.
100
Ateneo de Zamboanga University
The display system mainly displays the result presented by the data
analysis module via LCD. As shown in Figure 3-32, the message or text
displayed on the LCD screen mainly depends on the result. It will either display
101
Ateneo de Zamboanga University
This section describes the process of how the system would be tested which
should provide validation for the results in evaluating the PHAAS device.
This section explains the process involved in alpha testing. Alpha testing
PHAAS. Six modules are involved in the device: a signal acquisition unit, a data
modules are correctly implemented and operational. Table 3-1 shows the
The goals in testing the acquisition and signal processing unit are
to check if the sensor can acquire an ECG signal and if the digital filters
work effectively.
In testing the sensor, the proponents will serve as the subject for
the subject following the chest lead II setup, and the leads are attached
102
Ateneo de Zamboanga University
corresponding data will be digitally viewed via the terminal and visually
for testing the acquisition is around 95% after conducting ten test trials.
On the other hand, the Prosim8 Vital Signs simulator will be used
to test the digital filters. The ECG artifacts from the Prosim8 simulator
which are represented in terms of percentages namely 25, 50, and 100
percent. Given that there will be ten trials for this test, five of them will
use Normal ECG; the fifth noise for the fifth trial will be chosen randomly
from the four available noises. The remaining trials will use STEMI with
wherein the tenth trial also chooses a random artifact. Visual comparison
evaluate the results, the following scoring will be applied: 0 for not
effective, 0.5 for fairly effective, and 1 for most effective. A success rate
of at least 90% is expected after ten trials. Factors such as the quality
103
Ateneo de Zamboanga University
testing.
The initial test will include the use of 5-fold cross-validation for
model. With this, the average accuracy of the 5-fold cross-validation will
True positive rate (TPR) (3.8), false positive rate (FPR) (3.9),
shown below.
𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠
𝑇𝑃𝑅 = 𝑅𝑒𝑐𝑎𝑙𝑙 = (3.8)
𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠 + 𝐹𝑎𝑙𝑠𝑒 𝑁𝑒𝑔𝑎𝑡𝑖𝑣𝑒
𝐹𝑎𝑙𝑠𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠
𝐹𝑃𝑅 = (3.9)
𝐹𝑎𝑙𝑠𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠 + 𝑇𝑟𝑢𝑒 𝑁𝑒𝑔𝑎𝑡𝑖𝑣𝑒
𝑇𝑟𝑢𝑒 𝑁𝑒𝑔𝑎𝑡𝑖𝑣𝑒𝑠
𝑆𝑝𝑒𝑐𝑖𝑓𝑖𝑐𝑖𝑡𝑦 = (3.10)
𝑇𝑟𝑢𝑒 𝑁𝑒𝑔𝑎𝑡𝑖𝑣𝑒𝑠 + 𝐹𝑎𝑙𝑠𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠
𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 = (3.11)
𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠 + 𝐹𝑎𝑙𝑠𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠
2 𝑥 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 𝑥 𝑅𝑒𝑐𝑎𝑙𝑙
𝐹 − 𝑠𝑐𝑜𝑟𝑒 = (3.12)
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 + 𝑅𝑒𝑐𝑎𝑙𝑙
104
Ateneo de Zamboanga University
𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠 + 𝑇𝑟𝑢𝑒 𝑁𝑒𝑔𝑎𝑡𝑖𝑣𝑒𝑠
𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 = (3.13)
𝑇𝑜𝑡𝑎𝑙 𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝐸𝑥𝑎𝑚𝑝𝑙𝑒𝑠
occur by testing the model using the testing dataset. The main parameter
for evaluating the performance of the model in this setting is the general
accuracy (3.13). The rest of the parameters indicated above will be used
the rate of overall correct predictions among the provided sample. The
higher the value of the accuracy, the better the performance of the model
is. The same accuracy value is also expected with the final test using
the testing dataset. In setting the success rate, the variables such as the
availability and quality of datasets used, and the quality of filters were
considered.
precision, and f-score are preferable to yield high values. The true
positive rate (TPR), also known as recall and sensitivity, indicates the
correct predictions in the positive class. A high TPR value is, the
indicates that the model is good at correctly predicting the positive class,
which in this study is the STEMI ECG. On the other hand, specificity,
also known as the true negative rate (TNR), indicates the correct
true positives among the predicted positive class. It tells how consistent
105
Ateneo de Zamboanga University
the model can predict STEMI. Furthermore, the f-score is the harmonic
positive class. The lower the FPR is, the better the model is in classifying
STEMI.
accessed and viewed if the ECG data is present and saved within the
allotted folder within the SD card with an appropriate label or file name.
send a message via SMS and voice call using a python-coded algorithm.
interval when the message and call is received will also be considered.
106
Ateneo de Zamboanga University
ensured. Hence, the expected success rate is 100% for each of the ten
trials.
on the LCD. The output message shown in the LCD must match the
whether the power bank can power up the other modules involved in
between the modules and the power bank is required in doing this
ten times.
On the other hand, the length of time as to how long the battery
can support the modules will be tested; it will be done by recording the
time from when the battery module began to power up the other modules
until the time the power runs out. The estimated amount of time it can
support the modules is around six hours; the calculation of the estimated
107
Ateneo de Zamboanga University
be around the same value from the estimation, yet it may be different in
No. of Trials
Objective
Expected
Success
Method
Module
Output
Rate
Test
108
Ateneo de Zamboanga University
training
dataset
109
Ateneo de Zamboanga University
functions are tested as an integrated system. The test will be conducted using
generate range from +0.05 to +0.80mV. On the other hand, for the artifacts
provided, an option for controlling the size is provided. The artifact sizes are
110
Ateneo de Zamboanga University
and 100%.
testing, finding the ST-elevation threshold the machine learning model can
detect and the effect of various artifact size to the machine learning prediction
is needed. To conduct this test, five trials will be considered where each trial is
composed of a specific simulation. For each trial the following test cases are
considered:
For each trial, all the three available artifact cases and all available nine
ST-elevation, including normal ECG are considered. The results of this test will
rate of 90% is considered, the least values that passes the success indicated
success rate will be chosen. As for the artifact size, its influence on the
prediction of the machine learning algorithm will be determined via the accuracy
of prediction. The average accuracy, per each artifact size is calculated and
111
Ateneo de Zamboanga University
size that meets the expected success rate will be considered. Upon acquiring
Proceeding towards system testing, there will be two cases of test. The
first case includes the simulation and testing of ECG with ST-elevation. The
second case, on the other hand, tests and simulates normal ECG. In each
integrates the acquisition and signal processing unit along the data analysis
and battery modules. Phase 2 combines the modules involved in phase 1 with
the storage and display modules. Lastly, phase 3 is the integration of all the
cases. Factors such as type of electrode used, the electrode placement, quality
of dataset used in training the machine learning, and quality of filters and
feature extraction are considered in the estimation of the success rates. Per
module, five trials will be conducted where each follows the test cases from the
threshold.
their assigned simulated ECG. Each modules involved are expected to yield
appropriate outcomes, which are provided in tables 3-2 and 3-3. The
corresponding procedures in verifying the results per each module will adapt
the methods indicated in section 3.3.1; except for the data analysis module
wherein k-fold cross validation will not be included anymore given the input
112
Ateneo de Zamboanga University
signal will not be from the online database but from an ECG simulator. The
provides per trial. In addition to this, after the test, the data acquired will be
For the summary of details per each system testing, refer to Tables 3-2
and 3-3. The phase group, modules involved, number of trials to be conducted,
expected output, and expected success rate are included in the tables.
No. of Success
Phase Modules involved Expected output
Trials rate
113
Ateneo de Zamboanga University
114
Ateneo de Zamboanga University
Table 3-3. Case 2 for System Testing
Case 2: Normal ECG
115
Ateneo de Zamboanga University
testing involves a real user using the device. This test aims to expose the
everyday activities like walking and sitting. Moreover, five healthy volunteers
are expected to participate with a duration trial of three hours within their day.
116
Ateneo de Zamboanga University
The beta testing will be done in three phases: pre-test, during the test, and
post-test.
profile, and orientation about the test will be conducted. The consent form will
first be given where the participant must provide her consent in his/her
that the involved individual is in good health. This will be done by answering a
will inform the participants regarding the purpose of the test. Additionally, the
function of the device will also be explained and also what to expect during the
testing.
During the test, the proponents will guide the participants throughout the
process. The proponents will make the participants conduct a list of activities,
which in total are six namely sitting, standing, laying down, walking, running,
and jumping. For every activity, five trials are conducted. Results including the
raw data, filtered data and the ECG predictions are saved.
After the trial, the participants are expected to answer a survey regarding
their experience and assessment of the device. The post-survey will utilize a 5-
Likert scale and open-ended questions mainly revolving around the portability
the survey results, this will be done only in terms of the 5-Likert scale, wherein
117
Ateneo de Zamboanga University
correctly detect the type of ECG, collected data from the healthy volunteers are
used. Furthermore, the details regarding the beta testing are summarized in
118
Ateneo de Zamboanga University
CHAPTER IV
ENGINEERING DESIGN
This chapter discusses the implementation of the modules of the Portable Heart
Attack Alert System, including the hardware and software used and the integration of
each module.
Figure 4-1 Block Diagram of the Experimental Setup of the Proposed Device
Shown in Figure 4-1 is the block diagram of the experimental setup of the
proposed device. Before the acquisition of ECG data, ECG electrode patches are
attached to a user following the Chest Lead II set-up. Once the user is set-up,
acquiring and pre-processing ECG data will be done with the use of the acquisition
and signal processing unit which consists of the Analog ECG Sensor and the
ADS1015 Analog to Digital Converter. After data acquisition, filtering of data, and
119
Ateneo de Zamboanga University
extraction of features, the SVM machine learning algorithm will classify whether the
ECG acquired is Normal or STEMI. The storage unit, which consists of the 128GB
Micro-SD Card, is responsible for storing the ECG data. This data includes the raw
and filtered data, features, and the predicted ECG class; all are stored locally within
the device and can be used by the clinicians for further review and diagnosis of the
user. The display module, which consists of the 16x2 LCD Display, will display the
ECG status for the user’s situational awareness, especially for possible cases of silent
myocardial infarction. The ECG status that are to be displayed depending on the result
of the data analysis module is either Normal ECG or STEMI ECG. In the case that
Normal ECG is detected, the LCD Display will display “Normal ECG”. On the other
hand, in cases if a STEMI ECG has been detected, the LCD will display “STEMI ECG
Detected” and the alert system module which consists of the GSM Module, will be
activated. Once activated, the GSM Module will send a text message via SMS and
make a call to the designated contacts which includes the user and the involved
clinician before repeating the entire process once again. Lastly, the battery module
which consists of the power bank, is the power source of proposed device. This
each module. Figure 4-2 shows the complete wiring diagram of the proposed device.
120
Ateneo de Zamboanga University
unit include the ADS1015 12-bit ADC and Analog ECG Sensor. Shown in
Figure 4-3 is the schematic diagram of the acquisition and signal processing
unit.
121
Ateneo de Zamboanga University
In this study, the Analog ECG Sensor was used to acquire raw analog
ECG data from the user. The output pin of the sensor is connected to the
analog output channel of the ADC. This allows the analog signals to be fed to
In this study, the ADS1015 12-bit Analog to Digital Converter was used
to automatically convert the analog signals from the Analog ECG Sensor to
8GB of RAM, a micro-SD card slot for storage, has 40 GPIO pins to control or
interface with other hardware components, and uses a USB C power to power
the device.
Card placed in the micro-SD card slot of the Raspberry Pi 4. This micro-SD
card features a speed class of Class 10 and U1, and a capacity of 128 GB of
storage, all of which are compatible with the Raspberry Pi 4. Stored inside the
micro-SD card is the operating system, the necessary software, libraries, and
122
Ateneo de Zamboanga University
files to make the proposed solution run as a whole. Shown in Figure 4-5 is the
123
Ateneo de Zamboanga University
The hardware components used in the alert system module include the
GSM Module connected to the Raspberry Pi 4. This will notify the designated
contacts of the subject through SMS and call that STEMI ECG has been
detected. Shown in Figure 4-5 is the schematic diagram of the alert system.
The hardware component used in the display module includes the 16x2
LCD Display connected to the Raspberry Pi 4. This will display the ECG Status
124
Ateneo de Zamboanga University
In this study, the power bank utilized is power bank with a capacity of
10,000 mAh with an output voltage of 5V and a maximum output current of 3A,
each module.
filters and feature extraction methods. The indicated functions involved are
discussed as follows.
components which are namely the ECG sensor and ADC. The ECG
sensor is responsible for collecting the Analog ECG signal from either
Meanwhile, the ADC will be receiving the analog signal values directly
mainly the Python ran by the microprocessor. To access it, Listing 4-1
125
Ateneo de Zamboanga University
Line 54 initializes the I2C bus and specifies the pins used for I2C
communication; in this case, that is the SCL and SDA pins on the Raspberry
Pi 4. Line 55, on the other hand, initializes the ADS1015 12-bit ADC with the
argument “i2c” indicating that the ADC will use the I2C pins to interface with
the analog signals from the ADC. In this case, the arguments “ads” and
“ADS.P0” are indicated to specify that the analog input is to be taken from
Channel 0 of the ADS1015 12-bit ADC. Lines 57 and 58 set the data rate and
the gain of the ADC. The data rate, which specifies the sampling frequency of
the ADC is set to 250 while the gain which specifies the gain of the
to a digital signal is set to 16 or +/- 0.256 V. For choosing the stated data rate
and gain of the ADC, the values are based on acquisition parameters used
from the European ST-T database with the goal of inputting conditions that is
closest to what is provided. In this case, the provided sampling rate is 250Hz
and the gain in which the signal is amplified for every 1mV is 200 adu/mV.
126
Ateneo de Zamboanga University
correct number of samples were collected, unless met, the loop will not
stop.
The use of 2500 samples was mainly adapted from the 10-
data fed to the analysis module during application or use. This also
machine learning algorithm used to train it, which is also in terms of 2500
1
𝑓𝑠 = (4.1)
𝑇
127
Ateneo de Zamboanga University
the ECGs such as random spikes and baseline wander. To address the
Furthermore, the data from the European ST-T database were used to
128
Ateneo de Zamboanga University
On the other hand, for the moving average filter, the main
129
Ateneo de Zamboanga University
designing the filter is the window size as shown in code line 11.
From line 21, the data acquired was converted in a series format.
This allowed the window size to be set in motion (can move from
the values included within the window size; these are represented
along code line 30. To retain the 2500 samples length of the data,
conducted which was made possible by code lines 33, 36, and
39.
domain.
130
Ateneo de Zamboanga University
effects of the filter via random sample ECGs from the online
smoothing effect at around 7, 11, and 15; these values are then
applied. As can be seen, the first plot shows the randomly chosen
raw data and it shows that there are random noises present. The
the third plot, with a window size of 11, the ECG can smooth it
observed. Lastly, for the fourth plot, with a window size of 15,
131
Ateneo de Zamboanga University
the filter designed are both applied during training of the model,
application.
132
Ateneo de Zamboanga University
35Hz; for the filter with window size 11, attenuation are more
size 15, the frequencies attenuated are around 18 and 32Hz. This
amplitude.
133
Ateneo de Zamboanga University
amplitude local waves of the ECG signal. The factors that have
muscle noise, it can be said that the most suitable window size is
size.
134
Ateneo de Zamboanga University
such as, but not limited to signal processing and analysis (SciPy,
2023).
135
Ateneo de Zamboanga University
samples for the kernel sizes. The final application of both filters is
shown under code line 55 where the results of median filter were
designed median filter and the ECG sample aligns along zero
136
Ateneo de Zamboanga University
frequencies (f), and the power spectral density (S) from the input
137
Ateneo de Zamboanga University
features (2500 samples per each scale). The main code used for
138
Ateneo de Zamboanga University
in Listing 4-8.
features acquired from the training data (see code line 25). The
original features acquired are namely the filtered data, the power
139
Ateneo de Zamboanga University
of the parameters.
calculated was set to 100 as shown in code line 14, which is the
The main development conducted under this module is the training and
testing of the SVM machine learning in the binary classification of STEMI and
splitting of data. Mainly, the data used were acquired from the European ST-T
database.
data collection and analysis were required. With this, the following
140
Ateneo de Zamboanga University
from V1, V2, V3, V4, V5, and V6, down to modified lead
141
Ateneo de Zamboanga University
wave, QRS wave, and T-wave. Following the stated criteria, from
were the annotation file and ECG records which are in ‘. atr’ and
certain events that have occurred from the ECG such as ST-
MATLAB.
142
Ateneo de Zamboanga University
that provide labels for the start, peak, and end of events
143
Ateneo de Zamboanga University
as follows:
segments.
144
Ateneo de Zamboanga University
a potential STEMI.
ended.
4.2.2.1.2.3).
145
Ateneo de Zamboanga University
reading the file and saving the data stored as a ‘.csv’ file
normal ECGs.
146
Ateneo de Zamboanga University
data from the ECG records. The sample code used for
147
Ateneo de Zamboanga University
for the rest of the methods that comes after, python was
also used.
148
Ateneo de Zamboanga University
considerably balanced.
149
Ateneo de Zamboanga University
applied. As an overview, the raw data was first processed with the use
of filters in which noises were removed with the use of bandpass, moving
speed of training and testing of machine learning, the resulting data after
150
Ateneo de Zamboanga University
pre-processing the data. Given that all were designed as functions, the
codes were called upon application. For the filters, ‘bandpass’, ‘mov_av’,
lines 86 to 90. For the feature extraction, ‘psd’, ‘cwt_0’, ‘cwt_1’ were first
shown on code lines 96 to 99. Afterwards all the compiled filters were
used to generate the synthetic features which was conducted under line
101 to 102 and is appending along the other filters at line 105.
done following a 70:30 ratio for training and testing the machine learning
model. This means that 70% of the data were allocated for training the
model, while the remaining 30% of the data were for testing the trained
model. Listing 4-13 shows the code used for splitting the data into
151
Ateneo de Zamboanga University
from sklearn module as shown on lines 26 to 27. The test_size was set
to be at 0.3 which indicates 30% of the provided data were for testing.
The same goes for the train_size set to 0.7 which indicates 70% of the
illustrated in code lines 30 to 38, the training and testing data are saved
with labeled data that serves as the basis for self-education, enabling it
152
Ateneo de Zamboanga University
Listing 4-14 showcases the code used for finding the best
153
Ateneo de Zamboanga University
SVM models.
model using the training data, it can be saved as a '.sav' file using
the scaling model to be stored for future use. The saved model
applications.
154
Ateneo de Zamboanga University
proponents.
kernels.
155
Ateneo de Zamboanga University
compressed '.zip' file using the joblib library, but only for sets of
accuracies and sets of features. Among all the saved models, the
accuracy.
156
Ateneo de Zamboanga University
was already applied. The models and the selected features from
RFECV were also loaded prior to the codes provided, wherein the
features acquired from the data, from 8851, only 180 features
is simply the median given the set of inputs. Simply, the predicted
157
Ateneo de Zamboanga University
extracts the values for true positive (tp), true negative (tn), false
positive (fp), and false negative (fn) from the confusion matrix
Also, it's important to note that much of the code used for
testing the data were incorporated into the main algorithm (code
to be used when the device is ready for actual use) with slight
modifications.
The storage module simply involves saving the necessary data acquired
from the pre-processes and model prediction conducted. Mainly this module is
designed to save two ‘.csv’ files: one includes the filtered data along with the
raw data and the other includes the features extracted. Both files include the
158
Ateneo de Zamboanga University
Listing 4-20 showcases the code that enables the storage of data
acquired into a ‘.csv’ file. The main function used to make this possible is the
write function (code lines 49 to 52) and append function (code lines 55 to 58),
all of which were created using the CSV module. The module provides
functions that extend but are not limited to reading, appending, and writing data
The module responsible for alerting the designated contact person via
SMS and calls is called the alert system module. This module is only activated
when the data analysis module predicts a STEMI ECG. The code for the alert
the code inside this condition block will be executed. In this case, line 231
initializes a serial connection to the Raspberry Pi using the serial pin “serial0”
159
Ateneo de Zamboanga University
and a baud rate of 115200 with line 232 clearing any input data in the serial
buffer.
On the other hand, line 234 sets the phone number to which the SMS
message will be sent, line 235 sets the phone number to which the call will be
made to the designated contact, and line 237 contains the message to be sent
to the number set for SMS message. Included with the message is “STEMI
ECG Detected” is the variable “get_date” to get the date and time STEMI ECG
“AT+CMGF=1” which sets the GSM module to text mode while line 243
to send the SMS message to the number set to the variable “number_sms.”
The command ser.write in line 246 will insert the message set to the variable
“text_message” and line 247 will command the GSM module to finally send the
160
Ateneo de Zamboanga University
text message. The GSM module is given 10 seconds to send the SMS
Line 251 contains the AT command “ATD” to dial the phone number from the
variable “number_call,” referring to the number set in line 235. The GSM
module is given 30 seconds to call the designated contact before the next
acquisition of ECG data from the subject begins. The reason for giving the GSM
Module time delays using “time.sleep” is to give time for them to process the
command and execute it in case of network delay in sending the SMS message
and call.
It is crucial to ensure that the SIM card used for the alert system module
is subscribed to an unlimited call and text plan or has sufficient balance to allow
the module to send text messages and make calls. Moreover, it's important to
note that both the subject and designated contact must be in an area with good
reception to ensure that the alert system module can effectively send text
messages and make calls. Otherwise, the alert system may not function as
intended, and the designated contact may not receive the necessary
notifications.
The display system is responsible for providing a text display of the ECG
161
Ateneo de Zamboanga University
The code on line 66 calls the 'drivers.Lcd()' function, which initializes the
LCD and makes it ready for use. Once the LCD has been initialized, messages
However, it's important to note that the LCD can only display two lines of text,
erasing the previous text before displaying new text on the screen.
The actual experimental setup of the prototype is shown in Figure 4-13 which
consists of the modules of the prototype integrated into a recycled plastic enclosure
14, the enclosure is 18.2 cm long cm 8.9 cm wide, and 4.6 cm tall.
162
Ateneo de Zamboanga University
On the other hand, from Figure 4-15 the placements of the modules are shown
while Figure 4-16 shows the dimensions of each module in the interior of the
enclosure. The acquisition module is situated on the right side of the prototype, while
the alert system module is located at the bottom left corner, with its antenna extending
out the right side of the plastic enclosure. The microprocessor is positioned in the
middle of both modules while the battery module is situated below it and finally, the
163
Ateneo de Zamboanga University
wherein the prototype is connected to the user following the chest lead II set-up of
ECG electrode placement. Figure 4-18, on the other hand, shows the prototype
strapped on to a user.
164
Ateneo de Zamboanga University
165
Ateneo de Zamboanga University
CHAPTER V
RESULTS AND DISCUSSION
In this chapter, the proponents discuss the results obtained after conducting
The objective of this test is to verify the functionality of every module utilized in
the suggested device. The outcomes of this test are presented below.
ECG data. Its performance is evaluated by testing the main components - the
ECG sensor and the ADC - for their ability to acquire ECG data, as well as by
mainly composed of the ECG sensor, the ADC, and the Raspberry Pi.
In line with this, the ECG signal acquired was from the proponents
themselves following the chest lead II placement. The sampling rate was
set at 250 Hz and the samples acquired are equivalent to 2500 samples;
this was established using the code or algorithm to be ran by the Rpi.
166
Ateneo de Zamboanga University
For setting the sampling rate, it was done by programming the ADC as
shown in Listing 4-1. On the other hand, for acquiring the 2500 samples,
the terminal using the function ‘len()’ wherein consistently the acquired
acquire ECG, plotting of the acquired values from the proponents was
of a test trial is provided in Figure 5-1. As can be seen from the image,
167
Ateneo de Zamboanga University
Table 5-1. The expected success rate is set at 90%. The factors
considered.
Given that the determined success rate meets the set expectations, it
168
Ateneo de Zamboanga University
In testing the filter application, the ECG was acquired from Fluke
Chest Lead II placement, 250 Hz sampling rate, and 2500 samples were
Normal ECG, and the rest were STEMI. Each of the trials conducted
noise. Given that the total available noises were only eight, the fifth and
namely 25, 50, and 100 percent. In terms of representing STEMI, given
were chosen.
filter, 1 is for most effective, 0.5 for fairly effective, and 0 for not effective.
169
Ateneo de Zamboanga University
The set success rate for all artifact sizes was set to 90% wherein factors
artifact sizes were able to pass the success rate while only one was not
able to meet it which was the highest available artifact size from the
simulator, 100%. From this result, it suggests that the magnitude of the
been observed. Checking the plots, clippings were observed along 0mV
and 3mV (refer to Figure 5-2). This indicates a limitation in terms of the
amplitudes the sensor can cater to which is specifically only within the
170
Ateneo de Zamboanga University
range of 0 to 3 mV. The major cause of the clipping itself is due to the
noise present, which the artifact set was respiration). The noise along
the limitation of the sensor were mainly the reason why performance
Figure 5-2. Normal ECG with 100% Artifact Size Test Result
first glance, no other frequencies are present starting from 40Hz and
which indicates that some noises were removed. On the other hand, for
171
Ateneo de Zamboanga University
Lastly, for the median filter, the maximum amplitude had largely
Figure 5-3. Frequency Spectrum of Normal ECG simulation and Filter Results
distinct frequencies were observed that could suggest being the cause
of it.
172
Ateneo de Zamboanga University
using the datasets acquired from the online database as stated on section
4.2.2. Additionally, this test was followed in choosing the model to be applied
This test mainly had two phases; first is evaluating machine learning
model performance using the testing data, and second was also evaluating
machine learning model performance but in terms of using the testing data.
The main metric used for determining the trained model performance is
through the calculated k-fold accuracy during the training phase, and the overall
accuracy of the model calculated upon exposure to the unseen testing data. In
addition to this, additional evaluation metrics were also considered namely true
positive rate or recall, false positive rate, specificity, precision, F-score, and
general accuracy; all were used for providing additional perspectives and
evaluation in the performance of the model. For the main metrics, a success
rate of 90% was set; factors considered were mainly the effect of the filters
upon application. The quality of the data provided by the online database was
also considered.
acquired from both datasets. Table 5-3 and Table 5-4 provide the
The training dataset consists of a total of 398 samples while the testing dataset
173
Ateneo de Zamboanga University
has around 171 samples. Prior to calculating the metrics, the acquired true and
Predicted Positive TP = 70 FP = 8
Predicted Negative FN = 11 TN = 82
Upon the provided values in the confusion matrices, majority were high
for the true positive and true negative values, compared to false positive and
false negative values. An initial interpretation can be provided that the model,
for the majority part, can correctly classify normal and STEMI ECG.
training k-fold accuracy and testing accuracy are shown in Table 5-5. As a side
note, these were the main metrics used for evaluation of model given
prioritized. The k-fold acquired from the training data provides an estimation of
data, further proof if the estimation is correct using the accuracy acquired was
conducted. If the accuracies yielded are close, the model developed is more
174
Ateneo de Zamboanga University
the other hand, if accuracies are far from one other, an overfitted model might
be the case.
fold accuracy of the trained model is around 88%. When tested on the testing
data, the returned general accuracy of the model was around 89%. Despite not
being able to meet the set accuracies, the proponents deemed the results as
acceptable as the accuracies were very close to the set 90% accuracy; only 1
surpasses or meets the provided success rate. Other generated models that
low accuracy upon testing using testing dataset. This means that the models
3.3.1.2 further supports the idea that the chosen model displays good
score, and general accuracy. Among all the generated models, the 88%
175
Ateneo de Zamboanga University
accuracy model obtained the highest scores for TPR, specificity, precision, F-
score, and accuracy and the lowest for F-score. The following results are
True positive rate (TPR) is the rate of correct prediction on the positive
class. This entails how good the model is at correctly classifying STEMI. The
closer the value is to 1, the better and more reliable the model is at correctly
classifying STEMI. As can be seen in Table 5-6, with the calculated TPRs of
0.91 and 0.86 it can be said that the model has a high rate of correctly predicting
the positive class, hence the model performs well in correctly classifying
STEMI.
False positive rate (FPR), on the other hand, is the rate of incorrect
prediction on the positive class. The closer the value is to 0, the better the
model is at correctly predicting the positive class since the chances of incorrect
prediction on the stated class is low. With the calculated values of 0.03 and
0.08, it can be said that the model has low chances of incorrectly predicting the
176
Ateneo de Zamboanga University
probability of correct prediction on the negative class. This metric will tell how
good the model is at correctly predicting Normal ECG in which the closer the
value is to 1, the better. From the calculated values shown in the table, a score
of 0.97 and 0.91 entails that the model is reliable in correctly classifying normal
ECG.
For the precision, this metric provides how consistent the model is in
making correct predictions for the positive class. Similar to other metrics, the
closer the value is to 1, the better the performance of the model is in terms of
consistent correct prediction. From the values, which are 0.96 and 0.90, it can
Moving onto the F-score, this metric shows the model’s balanced ability
it is in its classification. The closer the value is to 1, the better the result is and
with values of 0.93 and 0.88, it can be said that the model has a good amount
Lastly, the accuracy provides the rate of overall correct prediction. With
calculated values of 0.94 and 0.89, it can be said that the model overall
177
Ateneo de Zamboanga University
of metric values, it can be said that the model displays good performance in its
despite not meeting the success rate indicated, the chosen model were able to
The goal of this test is to determine if the expected data was saved as
files and stored within the local storage. Given that an ECG source is required
in order to acquire the filtered data and the features, the Fluke Prosim8
Simulator was used as the source; Chest Lead II placement, 250 Hz sampling
After the pre-processing of the data, the relevant data were collected
and saved into two corresponding files: one for filtered data, and second for
features extracted. For both, the corresponding class label of the data were
included. As for the filenames, the data of the acquisition is included, and ‘.csv’
with the feature data also include in the filename, ‘feature’ for easy indication
of file content. Similar goes for the filtered data file, ‘filter’ is used along the file
name.
In checking if the storage process was conducted properly, each file was
checked to see if they were found in their corresponding folders which was
done through Python using the Raspberry Pi. To further confirm if those were
the right files, the filename and content of the file is checked: For the filename,
the following guide questions are followed: does it go along the indicated date
178
Ateneo de Zamboanga University
it was acquired? For the filtered data file, are there 10,001 columns saved
(2500 each for the three filters involved, a set of 2500 for raw data, and one
column for ECG status)? For the features extracted, are 8,852 columns (2500
for the final filtered data, 1251 for power spectral density, 5000 for continuous
wavelet transform, and 100 for synthetic features)? If yes, a score of 1 was
given from the 10 trials conducted, if the answer is no, a score of 0 is given. No
factors were considered that could affect storage performance, hence the
From the results provided under Table 5-7, out of the 10 trials, all the
relevant data were acquired and stored. This then provides proof that the
storage module is fully functional. The results also suggest that the storage
Figure 5-4 provides a screenshot of the feature files saved during functional
trial. All are found within the allotted folder named ‘feature_csv’.
179
Ateneo de Zamboanga University
The functional test of this module mainly involves testing if the GSM
module can send SMS messages and make a call towards the designated
contacts. A python code was developed to conduct this test which was ran by
the Raspberry Pi. The test was conducted following 10 trials, in which for each
trial, an SMS was sent where a random message was used followed up by a
call to the designated contact. The purpose for sending random messages is
to ensure that the GSM module can send the same set of messages inputted
by the proponents without any misspells, extra or missing characters at the end
of the receiver. Before conducting the test, the proponents first integrated the
GSM module to the Raspberry Pi and powered on the device with the use of
the power bank. Once powered up, the proponents checked the LED indicator
on the GSM module to see if it was able to connect to the network. When the
LED indicator on the GSM module blinks once every three seconds it means
180
Ateneo de Zamboanga University
that the network connection was established Faranux (n.d.), and the
proponents can proceed with conducting the test. In case the calls and text
were received, a score of 1 is provided for the trial; if none were received, a
score of 0 is given. In setting the success rate, factors such as sufficient power
supply, baud rate and AT commands set by the proponents, sim card
registration (promos for calling and testing), and network availability and
the factors considered can be made to ensure alert system functionality. With
this the proponents ensured upon conducting the test that the battery module
is fully charged, the sim is registered to an unli-call and text promo, and also
the location where the test is done has strong cellular signal – these are the
factors that can vary depending on location and time. For the baud rate and AT
commands, it can be set to a constant within the code – this is the only factor
that cannot vary. Given the factors that varies were set to fit in fully ensuring
The result of the test is provided under Table 5-8. As can be seen, the
the alert system module is fully functional given it reached the required value.
181
Ateneo de Zamboanga University
and the moment it was ready for sending, it was observed to be immediate; the
same can be said for initiating a call to a designated contact. On the contrary,
the time it takes for the message and call to be sent and received will depend
on the location of the device and the designated contact as it can have an effect
on the network connection and signal strength of the module. In cases where
the sim is not registered to a text and call promo, no expected call and text
occurs.
GSM module and the specific objective under section 1.4.2.4 is initially met.
the test.
182
Ateneo de Zamboanga University
Similar to the test conducted under the alert system module, random
the messages were also used to check if all pixels within the LCD are functional
and also to see if various characters are displayable. When conducting the test,
the input message from the python file ran by the microprocessor, should match
to the output of LCD. If it matches, a score of 1 should be given; if not, the score
interference in displaying texts on the LCD, the success rate is set to 100%.
From the provided results under Table 5-9, the display system was able
to display the message on the LCD in accordance with what was provided in
the code for all ten trials. This suggests that the LCD is fully functional and
ready for the integration of modules, particularly with the data analysis and alert
modules. Figure 5-6 shows a sample of a trial conducted during the functional
test.
183
Ateneo de Zamboanga University
This test aims to determine if the power bank can support the integration
of all modules and how long the power bank can support the device. The test
was conducted by first charging the power bank to full capacity and confirming
that the power bank is fully charged. After confirmation that the power bank is
fully charged, all modules were integrated. Afterwards, the power bank was
start-up the clock app is opened, and the stopwatch is initiated to check how
much time has passed since the powering on of the device. The device was
then left on until it surpasses 5 hours. This test was conducted ten times, which
were the considered number of trials. If the battery was able to surpass five
provided. Given that the battery inside the power bank is relatively new, the
expected success rate is set to 100%. However, the success rate may be
184
Ateneo de Zamboanga University
affected if the test was conducted with the power bank not fully charged or
The result, as shown in Table 5-10, shows that the power bank was
successful in supporting all the integrated modules and can last for up to 5
hours. It is important to note that the proponents performed each trial with the
System testing was conducted to ensure that the modules involved works after
stages of integration. In this testing, two cases were considered each with three
phases of integration. For this test, the Fluke Prosim8 Vital Signs simulator is used.
Regarding the acquisition of data, three electrode placements were followed with set
185
Ateneo de Zamboanga University
250Hz and sample length of 2500 to be collected. For the pre-processing applications,
threshold and artifact size. This was necessary before as this ensures consistency
and uniformity in the system testing procedure. The same conditions in the acquisition
learning model upon exposure to various ST-elevation values and artifact sizes.
This test aims to determine at what threshold can the model effectively detect
the ST-elevation and up to what degree of artifact size can affect the model’s
prediction.
detects was determined. There was a total of 5 trials, one of which had
Per noise involved, three artifact sizes and ten ST-elevation values were
which were namely 25, 50, and 100 percent. For the ST-elevation
186
Ateneo de Zamboanga University
Table 5-11.
which the success rate was met is along +0.30mV and above;
exceeding +0.30mV. From this, it can be said that the level of ST-
187
Ateneo de Zamboanga University
For this test, the degree of noise and its effect towards machine
were the same as indicated under ST-elevation threshold test but mainly
focusing on artifact sizes. The expected success rate of this test is also
Table 5-12. From the results provided, it must be taken note that trial 1
As can be seen from the table, only the 100% artifact size was
not able to pass the indicated success rate. From this, it can be said that
the degree of noise can influence the prediction the device’s model,
limitation stated under section 5.1.1.2. With this, it can be said that filter
188
Ateneo de Zamboanga University
artifact size that was able to meet the set success rate was chosen,
In this test, the integration of the device was tested in terms of STEMI
ECG where ST-elevation is at +0.30mV with 50% artifact. Aside from this, the
conditions indicated under section 5.2 were applied in this test. For phases
involved, the indicated success rate was around 80%. Factors such as chances
correctly perform due to the difference of elements from the inputted data and
elements that was used when training the model. Given that the signal fed to
the model was from a different data source, the simulated ECG may not match
to what is expected by the model, which was trained using the data acquired
from European ST-T Database. The results of the test are shown in Table 5-
13.
189
Ateneo de Zamboanga University
provided success rate. Hence, it can be said that the PHAAS device is
terms of the test conducted under phase III, the alert system and display
module were observed to function in accordance with the output of the data
corresponding status ‘Normal’ was displayed on the LCD and the alert system
was not initiated. On the other hand, in cases of correct STEMI ECG prediction,
the corresponding status ‘STEMI Detected!’ was also displayed on the LCD,
190
Ateneo de Zamboanga University
In this test, the integration of the device was tested in terms of Normal
ECG with 50% artifact. This case also follows the conditions, in terms of
success rate and corresponding considered factors from section 5.2.2. In terms
of acquisition method or conditions, what was stated under 5.2 was followed.
The results are shown in Table 5-14. As can be observed, all phases of
integration were also able to suffice the provided success rate. With this, it can
be also said that the PHAAS device is functional upon integration in terms of
Normal ECG. Similar to the test conducted with case 1, STEMI ECGs, it has
been observed that under phase III, the alert system and display module works
was displayed on the LCD and no initiation of the alert system occurred when
correct normal ECG prediction was provided. Similarly, ‘STEMI Detected!’ was
occurred.
191
Ateneo de Zamboanga University
With inclusion of the result presented in section 5.2.2, it can be said that
Overall, for the summary of results acquired from the system testing, most
especially under the integration of data analysis module, alert system, and display
module, it can be said the specific objectives 1.4.2.4 and 1.4.2.6 were satisfied. From
the results for both cases, the alert system and display module functioned accordingly
to the provided prediction of the model. If normal ECG was detected, alert system did
not initiate and a status indicating normal ECG was only displayed. On the other hand,
if STEMI was detected, the alert system was initiated to send call and SMS, which
were received by the assigned contacts and the ECG status displayed in the LCD
192
Ateneo de Zamboanga University
Before ending the system testing, the assessment of the performance of the
machine learning model using the simulated ECGs used during the system testing
was determined. The expected success rate was set at 80% due to several factors
The result of the model performance is provided in Table 5-15. With the use of
87 percent; exceeding the provided success rate by 7 percent. This then indicates that
the model performs relatively well when data were acquired from other source,
specifically the Fluke Prosim8 Simulator. It must be taken note that these data were
from system testing, wherein it is set to fit acceptable conditions (+0.30 ST-elevation
and 50% size) where machine learning is reliable. This entails then, that under
acceptable conditions, the machine learning performs relatively well. This result
193
Ateneo de Zamboanga University
further supports the indicated specific objective 1.4.2.3 regarding the capability of the
answers from the survey was utilized. Table 5-16 shows the results acquired from the
application of Likert-scale. Table 5-17, on the other hand, shows the range for
ECG, chest lead II placement was followed with 250 Hz sampling rate and a required
sample length of 2500. The pre-processing methods utilized were also the same from
what was used under system testing and functional testing of acquisition and signal
processing module. In this test, five volunteers were considered in which the model
performance was monitored as they conducted the provided activities. Prior to joining,
a consent was provided by the volunteer along with their health profile in which
specifically indicates that they do not have any heart related condition. After the test,
the volunteers answer a Likert survey which determined the user acceptance of the
device specifically in terms of portability and comfortability. Table 5-16 showcases the
194
Ateneo de Zamboanga University
As can be seen from Table 5-16, all the provided statement resulted with an
interpretation of ‘Strongly Agree’. This implies that participants found the PHAAS
device to not be restrictive while doing activities, comfortable upon use, malfunctions
were not common, and was usable without technical assistance. Overall, the level of
agreement the participants had leans toward strong agreement with the provided
The interpretation of the mean score is indicated under Table 5-17, following the
195
Ateneo de Zamboanga University
Using the data acquired from the beta testing, performance of the trained
machine learning model was determined. The results are provided in Table 5-18. Like
the evaluation of machine learning from the system testing, a success rate of 80%
was considered.
depending on the degree of movement the activity involves. From the table, the first
three activities showcase accuracies that were fairly high with 76% being the least
among them. On the other hand, for the last three activities, low accuracy values were
derived 16% being the lowest. Comparing the two set of activities, the most evident
difference is the degree of movement each activity requires. The greater the
movement the activity requires, the more prone the model becomes for
misclassification.
196
Ateneo de Zamboanga University
The model was not able to meet the indicated success rate due to this
decreases per activity with increasing movement is due to the motion artifact that it
interference resulting from the movement and rubbing of the body against the
electrode surface.
this noise involves the use of a high-end filter called adaptive filter. Compared to other
filters they have tested which are namely high pass finite impulse response (FIR) filter,
high pass infinite impulse response (IIR) filter, moving median filter, and wavelet
transform denoising, only the adaptive filter did not cause distortion while filtering the
ECGs especially those with abnormal waveforms. The most probable cause of the
distortion is due to the overlapping frequencies between the ECG and motion artifact.
The frequency range of ECG is around 0.5 to 100 Hz while motion artifact is around
0.4 to 15 Hz (Almalchy, 2021). This suggests that upon the application of filters,
of motion artifact. This discourages the use of improper denoising methods as it can
affect the waveform of the signal and contribute to misdiagnosis of heart related
conditions. In line with this, the application of adaptive filter is suggested. Despite the
stated effective application, the use of this filter falls outside the scope of the study
and has been decided to be stated under Chapter VII, the recommendation section
instead.
197
Ateneo de Zamboanga University
Other factors that may have contributed to the low success rate includes the
limitation of the sensor and filters at which were discussed under section 5.1.1.2 and
5.2.1.2.
198
Ateneo de Zamboanga University
CHAPTER VI
CONCLUSION
The purpose of this study is to develop an objective-based, portable, and real-
time heart attack detector that mainly addresses heart attack related concerns such
cruciality of early diagnosis, and cruciality of fast response time upon occurrence. The
proposed design in total, consist of six modules each serving a specific function. The
modules are namely the acquisition and signal processing unit, data analysis module,
Evaluation of the designed device was conducted via various tests, namely
alpha, system, and beta testing. Majority of the results under alpha testing suggests
that the individual modules were fully functional. For the case of application of filters
under the acquisition and signal processing unit, the filter was not able to meet the set
success rate of 90%, specifically under the case of 100% artifact size. Upon checking
the corresponding plots of the trials involved in the case, clippings were observed
around 0 to 3 millivolts. This mainly suggests that there is a limitation in the sensor,
specifically in the range of values it can cater. In the case of data analysis module, the
proponents were able to develop a good or acceptable model; considering all the
metrics used to evaluate its performance, majority of the results points out the model
Moving towards system testing, from the ST-elevation and artifact size test,
results pointed out that the ST-elevation threshold the model can begin to detect
STEMI is at +0.30mV. This entails that anything below the determined threshold, are
199
Ateneo de Zamboanga University
considered normal by the model; anything at and beyond are STEMI. Potential factors
could include the data used from the European ST-T database, and unprecedented
effects of the applied filters. In terms of the artifact size, among all the sizes included,
only test case of 100% magnitude failed to meet the set success rate. This result is
approximately the same from the functional testing of filters. This could suggest that
artifact sizes, specifically of great magnitude, along with the limitation of the sensor,
can affect machine learning model performance. Moving towards the system testing,
for both cases, results yielded were desirable in which all the determined success rate
surpasses what was indicated. This suggests that the integration of the modules is a
success.
Last but not the least, for the beta testing, in terms of the user acceptability of
the device, the participants had greatly shown their agreement in all the statement
provided on the Likert scale survey. Overall, this indicates that the designed device
In addition to the indicated test, the model performance in terms of the data
acquired from the system and beta testing is evaluated. For the system testing, the
generated accuracy is fairly well, with an accuracy of 87%, as it is able to surpass the
set success rate of 80%. The beta testing, on the other hand, is quite a different story.
The overall success rate that it was able to yield is only around 56% which is fairly
low. As provided in the discussion under section 5.3, the main factor that caused this
is due to the presence of motion artifacts. If only the activities considered are those
with low movements, the calculated accuracy is at 83%. On the other hand, if only the
activities that requires a lot of movement are considered, an accuracy of only 28% is
200
Ateneo de Zamboanga University
achieved. This entails that the motion artifact present greatly affects the machine
learning performance.
Overall, from the results acquired, it has been recognized that the presence of
the data analysis module. The artifact size, especially those of great magnitude and
the presence of motion artifact increases the misclassification of the machine learning
model. Furthermore, the sensor's limited capacity to capture certain values can also
play a role on the performance of the machine learning. Despite the indicated
acceptable conditions.
develop the proposed device: a portable, objective-based heart attack detector that is
applicable in real time. Every module performed its intended function, and upon
leans over to be in favor of the device; strong agreement is expressed towards the
sensor capacity. In regard to this, recommendations are provided under Chapter VII.
201
Ateneo de Zamboanga University
CHAPTER VII
RECOMMENDATION
The Portable Heart Attack Alert System (PHAAS) is an objective-based
application in handling high magnitude noises and the disruptive presence of motion
artifact.
In terms of the limitation of the sensor, the proponents suggest the use of
Python Heart Rate Analysis Toolkit, also known as HeartPy. The toolkit offers pre-
processing methods that specifically address clippings due to the limited sensitivity
range of the sensor. This process involves the detection of the clippings which
available. For the software approach, the use of a high-end filter, namely the adaptive
filter, is suggested. The adaptive filter is a time-variant filter, which takes two inputs:
one input for the signal and the other serves as the reference which acquires the noise
desired to be removed. The general idea in the application of this method is through
the subtraction of the reference input (noise reading) from the input signal in order to
acquire the clean one. According to An and Stylios (2020), the adaptive filter is an
effective method of removing artifact given upon application, it does not cause
significant distortion. The downside of using this method is that it requires an additional
202
Ateneo de Zamboanga University
input to take the noise measured, in cases that the approach is not suitable for the
For the hardware approach, the Analog ECG Sensor datasheet (n.d.) provides
the heart rate of patients engaging in moderate activity, such as with a Holter Monitor.
The circuit employs the AD8232 Single-Lead Heart Rate Monitor Front End and a
three-electrode patient interface with a two-pole high and low-pass filter, and a signal
gain of 400 in the pass band. The signal is sampled by a sigma-delta ADC integrated
signal is used to minimize patient motion artifacts and conserve battery power during
inactivity. It is important to note that the previously mentioned components are meant
to demonstrate the capabilities of the AD8232 with other system components and is
Aside from addressing the limitations encountered from the PHAAS, the
proponents also have several suggestions regarding the design of each module. First,
the proponents recommend adding a piezo buzzer as the primary component of the
alert system module to provide an audible method to warn the user upon STEMI ECG
detection. The implementation of this can decrease the delay in the delivery of STEMI
indication.
Second, the proponents recommend adding a button which enables the user
to manually trigger the GSM module to send text messages and make voice calls to
the designated contacts. This will provide user control over the system, potentially
increasing the battery life of the proposed device as it reduces power consumption by
203
Ateneo de Zamboanga University
the microprocessor, and lastly, minimizes false alarms in case of a false positive
result.
filter on simulated noises namely 60Hz power line interference, baseline wander,
respiration, and muscle noise; the proponents suggest further evaluating the filter
using a combination of the noises provided given the filters were only tested in terms
of isolated artifacts.
Lastly, for the machine learning model under data analysis module,
optimization of the recall rate is suggested rather than accuracy. This is to ensure that
204
Ateneo de Zamboanga University
BIBLIOGRAPHY
Ahmed, KS., El-Metwally2, SM., (2015, September). Portable Low-cost Heart Attack
Detection System using ZigBee Wireless Technology. ResearchGate.
https://doi.org/10.13140/RG.2.1.2865.4561
Ahmed, M. (2014, June 8). Heart Blockage: Explained with Pictures. MyHeart.
https://myheart.net/articles/heart-blockage-explained-with-pictures/
Al'Aref, S (2022, June 26). Chest Pain: Anatomic vs. Functional Evaluation.
https://qatar-weill.cornell.edu/continuing-professional-development/pearls-of-
grand-rounds/article/chest-pain-anatomic-vs-functional-evaluation
Alharbey, RA., Alsubhi, S., Daqrouq, K., Alkhateeb, A. (2022, March 28). The
continuous wavelet transforms using for natural ECG signal arrhythmias
detection by statistical parameters. ScienceDirect. Alexandria Engineering
Journal, 61(12), 9243-9248. https://doi.org/10.1016/j.aej.2022.03.016
Ali et al. (2019) A review on data preprocessing methods for class imbalance problem.
https://www.researchgate.net/profile/Ayaz-Ullah-2/publication/336305785_A_re
view_on_data_preprocessing_methods_for_class_imbalance_problem/links/5d
b13d15299bf111d4c08fb5/A-review-on-data-preprocessing-methods-for-class-
imbalance-problem.pdf
Alibaba (n.d.). Okystar OEM ODM ECG Module AD822 ECG Measurement Pulse
Heart ECG Monitoring Sensor Module Kit. https://www.alibaba.com/product-
detail/Ad8232-Okystar-OEM-ODM-ECGModule62520278559.html?
spm=a2700.galleryofferlist. normal_offer.3.7d8d4d61JAdPuY&s=p
Alizadeh, R., Aghsaeifard, Z., Sadeghi, M., Hassani, P., & Saberian, P. (2020,
September 4). Effects of Prehospital Traige and Diagnosis of ST Segment
Elevation Myocardial Infarction on Mortality Rate. PubMed Central (PMC), 13,
569–575, https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7481285/
Amazon.com (n.d.). SanDisk 128GB Ultra MicroSDXC UHS-I Memory Card with
Adapter - 100MB/s, C10, U1, Full HD, A1, Micro SD Card - SDSQUAR-128G-
GN6MA: Everything Else.https://www.amazon.com/SanDisk-128GB-
microSDXC-Memory-Adapter/dp/B073JYC4XM
American College of Cardiology (2019, March 17). ACC/AHA Guidance for Preventing
Heart Disease, Stroke Released. https://www.acc.org/about-acc/press-
releases/2019/03/17/09/49/acc-aha-guidance-for-preventing-heart-disease-
stroke-released
American Heart Association (2022, February 10). Silent Ischemia and Ischemic Heart
Disease. https://www.heart.org/en/health-topics/heart-attack/about-heart-
attacks/silent-ischemia-and-ischemic-heart-disease
American Heart Association. (2020, February 4). Chronic stress can cause heart
trouble. https://www.heart.org/en/news/2020/02/04/chronic-stress-can-cause-
heart-trouble
American Heart Association. (2022, June 2). Chronic stress can cause heart trouble.
www.heart.org.https://www.heart.org/en/news/2020/02/04/chronic-stress-can-
cause-heart-trouble
American Heart Association. (2022, March 4). Health Threats from High Blood
Pressure. www.heart.org.https://www.heart.org/en/health-topics/high-blood-
pressure/health-threats-from-high-blood-pressure
Arora, S. (2020, February 4). SVM: Difference between Linear and Non-Linear
Models. AITUDE.https://www.aitude.com/svm-difference-between-linear-and-
non-linear-models/
206
Ateneo de Zamboanga University
Arts, LP., & Broek, EL. (2022, January 27). The fast continuous wavelet transformation
(fCWT) for real-time, high-quality, noise-resistant time–frequency analysis.
Nature Computational Science, 2, 47–58.
https://www.nature.com/articles/s43588-021-00183-z
Boateng, KO., Asubam BW., Laar, DS. (2012). Improving the Effectiveness of the
Median Filter. International Journal of Electronics and Communication
Engineering, 5(01), 85-97.
https://www.ripublication.com/irph/ijece/ijecev5n1__9.pdf
Butt, T. S., Bashtawi, E., Bououn, B., Wagley, B., Albarrak, B., Sergani, H. E., Mujtaba,
S. I., & Buraiki, J. (2020, August 6). Door-to-balloon time in the treatment of ST
segment elevation myocardial infarction in a tertiary care center in Saudi Arabia.
PubMed Central (PMC), 40(4), 281-289.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7410222/
Center and Disease Control and Prevention. (2022, June 20). Diabetes and Your
Heart. https://www.cdc.gov/diabetes/library/features/diabetes-and-heart.html
Centers for Disease and Control and Diseases. (n.d.). Smoking and Cardiovascular
System. https://www.cdc.gov/tobacco/data_statistics/sgr/50th-
anniversary/pdfs/fs_smoking_CVD_508.pdf
207
Ateneo de Zamboanga University
Centers for Disease Control and Diseases. (2022, September 8). Heart Disease and
Stroke.https://www.cdc.gov/chronicdisease/resources/publications/factsheets/h
eart-disease-stroke.htm
Centers for Disease Control and Prevention (2022, October 14). Heart Disease Facts.
https://www.cdc.gov/heartdisease/facts.htm
Centers for Disease Control and Prevention. (2022, April 18). About Million Hearts®
2027 | Million Hearts®. https://millionhearts.hhs.gov/about-million-
hearts/index.html
Chatterjee, S., Thakur, RS., Yadav, RN., Gupta L., Raghuvanshi, DK. (2020,
December 1). Review of noise removal techniques in ECG signals. The
Institution of Engineering and Technology, 14(09), 569-590.
https://doi.org/10.1049/iet-spr.2020.0104
Chong (2020) What is Feature Scaling & Why is it Important in Machine Learning?
.Retrieved from https://towardsdatascience.com/what-is-feature-scaling-why-
is-it-important-in-machine-learning-2854ae877048
Chowdhury, M., Alzoubi, K., Khandakar, A., Khallifa, R., Abouhasera, R., Koubaa, S.,
Ahmed, R., & Hasan, M. A. (2019, June 20). Wearable Real-Time Heart Attack
Detection and Warning System to Reduce Road Accidents. Sensors (Basel,
Switzerland), 19(12), 2780. https://doi.org/10.3390/s19122780
Cleveland Clinic. (2018, February 21). Blood Glucose Test: Levels & What They
Mean. https://my.clevelandclinic.org/health/diagnostics/12363-blood-glucose-
test
Coursera (2022, September 23). What Is Python Used For? A Beginner’s Guide.
Coursera. https://www.coursera.org/articles/what-is-python-used-for-a-
beginners-guide-to-using-python
D’Angelo, D. (2018, May 25). PHA Launches Sneakers Friday. Travel Philippines
Today. https://www.travelphilippines.today/pha-launches-sneakers-friday/
208
Ateneo de Zamboanga University
Daghlas I., Dashti, H.S., Lane, J., Aragram, K.G., Rutter, M.K., Saxena, R., Vetter, C.
(2019, September 10). Sleep Duration and Myocardial Infarction
https://pubmed.ncbi.nlm.nih.gov/31488267/
Denktas, AE., Anderson, HV., McCarthy, J., Smalling, RW. (2011, June). Total
ischemic time: the correct focus of attention for optimal ST-segment elevation
myocardial infarction care. JACC Cardiovasc Interv. National Library of
Medicine, 4(6), 599-604. https://pubmed.ncbi.nlm.nih.gov/21700244/
Feinglass S. & Sun L. (2021, June). How labs can help clinicians diagnose myocardial
infarctions in women? https://cdn.mlo-
online.com/files/base/ebm/mlo/document/2021/05/MLO202106_CEStory_Test.
609d54f7c9380.pdf
Felicity (2022, September 26). The Median Filter: An Effective Solution for Removing
Noise From Images. Picozu. https://www.picozu.com/the-median-filter-an-
effective-solution-for-removing-noise-from-images
Fishbein, M. (2010, February 1). The vulnerable and unstable atherosclerotic plaque.
PubMed, 19(1), 6-11, https://pubmed.ncbi.nlm.nih.gov/18835793/
Fluke Biomedical. (n.d.). ProSim 8 Vital Sign and ECG Patient Simulator.
https://www.flukebiomedical.com/products/biomedical-test-equipment/patient-
monitor-simulators/prosim-8-vital-signs-patient-simulator
Gandhi, R. (2018, June 8). Support Vector Machine: Introduction to Machine Learning
Algorithms SVM model from scratch. Towards Data Science.
https://towardsdatascience.com/support-vector-machine-introduction-to-
machine-learning-algorithms-934a444fca47
General Health Institute (n.d.). Fast Response to Heart Attacks. Genesis Health
System. https://www.genesishealth.com/ghi/healthy_living/patient-stories/fast-
response/
209
Ateneo de Zamboanga University
Ginghina, C., Ungureanu, C., Vladaia, A., Popescu B.A., Jurcut, R. (2009). The
electrocardiographic profile of patients with angina pectoris. The Journal of
Medicine and Life, 2(01), 80-91. https://medandlife.org/all-issues/2009/issue-1-
2009/case-presentations-issue-1-2009/the-electrocardiographic-profile-of-
patients-with-angina-pectoris/
Gong, F. F., Vaitenas, I., Malaisrie, S. C., & Maganti, K. (2020, December 9).
Mechanical Complications of Acute Myocardial Infarction. JAMA Cardiology.
JAMA Network, 6(3), 341-349.
https://jamanetwork.com/journals/jamacardiology/fullarticle/2773641
Gul Z. & Makaryus AN. (2019, February 7). Silent Myocardial Ischemia. StatPearls
Publishing. https://europepmc.org/article/NBK/nbk536915
Gupta, S., Shrivastava, A., Upadhyay, SP., Chaurasia, P. (2021, August). A Machine
Learning Approach for Heart Attack Prediction. International Journal of
Engineering and Advanced Technology, 10(6), 124-134.
https://www.researchgate.net/publication/354221694_A_Machine_Learning_Ap
proach_for_Heart_Attack_Prediction
Gusev, M., Stojmenski, A., Guseva, A. (2017, September 7). ECGalert: A Heart Attack
Alerting System. Springer International Publishing AG, 778.
https://doi.org/10.1007/978-3-319-67597-8_3
Haddadi, R., Abdelmounim, E., El Hanine, M., & Belaguid, A. (2017, September). ST
Segment Analysis Using Wavelet Transform. International Journal of Computer
Science and Network Security, 17(9), 102–107.
http://paper.ijcsns.org/07_book/201709/20170915.pdf
Hashim, M., Azim, W., Hussain, W., Rehman F., Salam A., Rafique M.(2022). Quality
of Life, Perceived Social Support and Death Anxiety Among People Having
Cardiovascular Disorders: A Cross-Sectional Study. Pakistan Journal of Medical
& Health Sciences, 16(04), https://doi.org/10.53350/pjmhs22164460
210
Ateneo de Zamboanga University
Jerushaa, J., Kasthuri, J., Buvana, M., Dharshan Kumaar, S., & Kailash, U. (2021,
May 5). Machine Learning Algorithms in Prediction of Heart Attack. International
Journal of Creative Research Thoughts, 9(5).
https://www.researchgate.net/publication/359841950_MACHINE_LEARNING_
ALGORITHMS_IN_PREDICTION_OF_HEART_ATTACK
Kashou, A. H., Basit, H., & Malik, A. (2022, August 8). ST Segment. NCBI Bookshelf.
https://www.ncbi.nlm.nih.gov/books/NBK459364/
211
Ateneo de Zamboanga University
Khan Academy. (n.d.). Statistics intro: Mean, median, & mode. Khan Academy.
https://www.khanacademy.org/math/cc-sixth-grade-math/cc-6th-data-
statistics/mean-and-median/v/statistics-intro-mean-median-and-mode
Khan, M. A., Hashim, M. J., Mustafa, H., Baniyas, M. Y., Buti Mohamad Al Suwaidi,
S. K., AlKatheeri, R., Khalfan Alblooshi, F. M., Ali Hassan Almatrooshi, M. E.,
Hazeem Alzaabi, M. E., Al Darmaki, R. S., & Ali Hussain Lootah, S. N. (2020,
July 23). Global Epidemiology of Ischemic Heart Disease: Results from the
Global Burden of Disease Study. PubMed Central (PMC).
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7384703/
Khowaja, S., Ahmed, S., Kumar, R., Shah, J. A., Khan, K. A., Khan, N. U., Saghir, T.,
Hasan Rizvi, S. N., Qamar, N., & Karim, M. (2021, October 29). Time to think
beyond door to balloon time: significance of total ischemic time in STEMI. The
Egyptian Heart Journal. https://doi.org/10.1186/s43044-021-00221-1
Kumar, P., & Sharma, V. (2020). Detection and classification of ECG noises using
decomposition on mixed codebook for quality analysis. Healthcare Technology
Letters, 7(1), 18–24. https://doi.org/10.1049/htl.2019.0096
Lazada PH (n.d.). ADC ADS1015 12-Bit 4 Channel with Programmable Gain Amplifier.
https://www.lazada.com.ph/products/i161720874-
s197829685.html?spm=a2o4l.mywishlist.items.18.b2353e17U0Cqw7
Lyn (n.d.) Understanding Cutoff Frequency: What it is and How it Affects Your Audio.
https://www.hifireport.com/understanding-cutoff-frequency/
212
Ateneo de Zamboanga University
Mary Ann Valentino. (2021, May 25). HOW TO INTERPRET LIKERT SCALE
RESULTS [Video]. YouTube.
https://www.youtube.com/watch?v=w7kttWTtcBM
Maserejian, N. N., Link, C. L., Lutfey, K. L., Marceau, L. D., & McKinlay, J. B. (2009,
October.). Disparities in Physicians’ Interpretations of Heart Disease Symptoms
by Patient Gender: Results of a Video Vignette Factorial Experiment. PubMed
Central (PMC). https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2825679/
Mathuranathan (2010, November 23). Understand Moving Average Filter with Python
& Matlab. GaussianWaves.https://www.gaussianwaves.com/2010/11/moving-
average-filter-ma-filter-2/
Mayo Clinic (2021, May 5). Myocardial ischemia - Symptoms and causes. Retrieved
from https://www.mayoclinic.org/diseases-conditions/myocardial-
ischemia/symptoms-causes/syc-20375417
Mayo Clinic (2022, January 15). Blood tests for heart disease.
https://www.mayoclinic.org/diseases-conditions/heart-disease/in-depth/heart-
disease/art-20049357
213
Ateneo de Zamboanga University
Mayo Clinic (2022, May 21). Heart attack - Diagnosis and treatment.
https://www.mayoclinic.org/diseases-conditions/heart-attack/diagnosis-
treatment/drc-20373112
Mayo Clinic (2022, May 21). Heart attack - Symptoms and causes.
https://www.mayoclinic.org/diseases-conditions/heart-attack/symptoms-
causes/syc-20373106
Mayo Clinic (2022, May 25). Silent heart attack: What are the risks?
https://www.mayoclinic.org/diseases-conditions/heart-attack/expert-
answers/silent-heart-attack/faq-20057777
Mayo Clinic. (2022, May 21). Heart attack: Diagnosis and treatment.
https://www.mayoclinic.org/diseases-conditions/heart-attack/diagnosis-
treatment/drc-20373112
Menees, D., Peterson, E., Wang, Y., Curtis, J., Messenger, J., Rumsfeld, J., Gurm, H.
(2013, September 5). Door-to-Balloon Time and Mortality among Patients
214
Ateneo de Zamboanga University
Undergoing Primary PCI. The New England Journal of Medicine, 369, 901-909.
https://www.nejm.org/doi/full/10.1056/NEJMoa1208200
MLMath.io. (2021, December 7). Math Behind SVM (Kernel Trick) Medium.
https://ankitnitjsr13.medium.com/math-behind-svm-kernel-trick-5a82aa04ab04
Mol, K. A., Smoczynska, A., Rahel, B. M., Meeder, J. G., Janssen, L., Doevendans,
P. A., & Cramer, M. J. (2018, October 1). Non-cardiac chest pain: prognosis and
secondary healthcare utilisation. Open Heart.
https://openheart.bmj.com/content/5/2/e000859
Monalakis, D. and Ingle, V. (2011). Applied Digital Signal Processing: Theory and
Practice. Cambridge University Press.
Mondal, D., Paul, D., Mukherji, S. (2017, August 15). Impedance Spectroscopy-Based
Detection of Cardiac Biomarkers on Polyaniline Coated Filter Paper. IEEE
Sensors Journal, 17(16), 5021-5029.
https://doi.org/10.1109/JSEN.2017.2717701
National Institute of Health (2021, April). Diabetes, Heart Disease, & Stroke.
https://www.niddk.nih.gov/health-information/diabetes/overview/preventing-
problems/heart-disease-stroke
National Nutrition Council. (2022, February 23). Use Pinggang Pinoy for a Healthier
You! Republika Ng Pilipinas. https://www.nnc.gov.ph/regional-
offices/mindanao/region-ix-zamboanga-peninsula/7135-use-pinggang-pinoy-
for-a-healthier-you
215
Ateneo de Zamboanga University
O'Gara, P., Kushner, F., Ascheim, D., Casey, D., Chung, M., Lemos, J., Ettinger, S.,
Fang, J., Fesmire, F., Franklin, B., Granger, C., Krumholz, H., Linderbaum J.,
Morrow, D., Newby, K., Ornato, J., Ou, N., Radford, M., Tamis-Holland, J.,
Tommaso, C., Tracy, C., Woo, J., Zhao, D. (2013, January). 2013 ACCF/AHA
Guideline for the Management of ST-Elevation Myocardial Infarction: A Report
of the American College of Cardiology Foundation/American Heart Association
Task Force on Practice Guidelines. Journal of the American College of
Cardiology, 61(4). https://www.jacc.org/doi/full/10.1016/j.jacc.2012.11.019
216
Ateneo de Zamboanga University
Philippine Statistics Authority. (2021, August 20). Causes of Deaths in the Philippines
(Preliminary): January to June 2021. https://psa.gov.ph/content/causes-deaths-
philippines-preliminary-january-june-2021
Pierce, J. (2021, September 24). The Cost of a Heart Attack. Preventative Diagnostic
Center. https://www.pdcenterlv.com/blog/the-cost-of-a-heart-attack/
Poynton, C., (2012). Digital Video and HD: Algorithms and Interfaces. ScienceDirect.
https://doi.org/10.1016/C2010-0-68987-5
217
Ateneo de Zamboanga University
Rajiv, J. (2022, April 1). Low Pass, High Pass and Band Pass Filters - Simple
Explanation. https://www.rfpage.com/low-pass-high-pass-and-band-pass-filters-
simple-explanation/
Read the Docs (n.d.) Python Heart Rate Analysis Toolkit https://python-heart-rate-
analysis-toolkit.readthedocs.io/en/latest/quickstart.html
Roland, J. (2020, February 19). Types of Heart Attacks: What You Should Know.
Healthline. https://www.healthline.com/health/heart-disease/types-of-heart-
attacks
Ross J., Ranum D., Diamond R., Troxel D., (2016). Internal Medicines Closed Claims
Study: An Expert Analysis of Medical Malpractice Allegations.
TheDoctorsCompany. https://www.thedoctors.com/siteassets/pdfs/risk-
management/closed-claims-studies/10579_ccs-internalmed_nomarks_fr.pdf
Sadowsky, J. (n.d.). The continuous wavelet transforms: A tool for signal investigation
and understanding.https://www.jhuapl.edu/Content/techdigest/pdf/V15-N04/15-
04-Sadowsky.pdf
218
Ateneo de Zamboanga University
Salian, A. (2022, May 31). Moving Average Filter: Towards Signal Noise Reduction.
Codemonk: Product Design & Engineering. https://codemonk.in/blog/moving-
average-filter/
Shah, R. (2023). What is Synthetic Data in Machine Learning and How to Generate
It. V7Labs. Retrieved from https://www.v7labs.com/blog/synthetic-data-guide
Sharma, S. (2021, December 12). Kernel Trick in SVM - Analytics Vidhya. Medium.
https://medium.com/analytics-vidhya/how-to-classify-non-linear-data-to-linear-
data-bb2df1a6b781
Silva, I & Moody, G.B. (2014). An Open-source Toolbox for Analysing and Processing
PhysioNet Databases in MATLAB and Octave.
https://pubmed.ncbi.nlm.nih.gov/26525081/
Singh, M. (2021). Synthetic Data — key benefits, types, generation methods, and
challenges. https://towardsdatascience.com/synthetic-data-key-benefits-
types-generation-methods-and-challenges-11b0ad304b55
219
Ateneo de Zamboanga University
Single-lead, Heart Rate Monitor Front End Data sheet AD8232. (n.d.). Retrieved April
18, 2023, from
https://cdn.sparkfun.com/datasheets/Sensors/Biometric/AD8232.pdf.
Suni, E. (2022, September 22). How Sleep Deprivation Affects Your Heart.
https://www.sleepfoundation.org/sleep-deprivation/how-sleep-deprivation-
affects-your-heart
University of Rochester Medical Center. (n.d.). Stress Can Increase Your Risk for
Heart Disease
https://www.urmc.rochester.edu/encyclopedia/content.aspx?ContentTypeID=1
&ContentID=2171
Vähätalo, J. H., Huikuri, H. V., A. Holmström, L. T., Kenttä, T. V., E. Haukilahti, M. A.,
Pakanen, L., Kaikkonen, K. S., Tikkanen, J., Perkiömäki, J. S., Myerburg, R. J.,
& Junttila, M. J. (2020, January 1). Association of Silent Myocardial Infarction
and Sudden Cardiac Death. JAMA Cardiology. JAMA
Network. https://jamanetwork.com/journals/jamacardiology/fullarticle/2737873
Villines, Z. (2022, September 20). What is the normal range for troponin levels?
MedicalNewsToday. https://www.medicalnewstoday.com/articles/normal-
troponin-levels
Vogel, B., Claessen, B. E., Arnold, S. V., Chan, D., Cohen, D. J., Giannitsis, E.,
Gibson, C. M., Goto, S., Katus, H. A., Kerneis, M., Kimura, T., Kunadian, V.,
Pinto, D. S., Shiomi, H., Spertus, J. A., Steg, P. G., & Mehran, R. (2019, June
6). ST-segment elevation myocardial infarction - Nature Reviews Disease
Primers. Nature. https://www.nature.com/articles/s41572-019-0090-3
220
Ateneo de Zamboanga University
Williams, R. (2011, June 28). Depression After Heart Attack: Why Should I Be
Concerned About Depression After a Heart Attack? AHA Journal.
https://www.ahajournals.org/doi/10.1161/CIRCULATIONAHA.110.017285
World Health Organization. (2020, July 13). HEARTS: technical package for
cardiovascular disease management in primary health care: Risk-based CVD
management. https://www.who.int/publications/i/item/9789240001367
You, J., Jiang, K., Chen, H., & Wen, H. (2015). ST Segment Extraction from Exercise
ECG Signal Based on EMD and Wavelet Transform. MATEC Web of
Conferences, 22, 01039. https://doi.org/10.1051/matecconf/20152201039
221
Ateneo de Zamboanga University
APPENDICES
APPENDIX A
ZCMC LETTER OF REQUEST
222
Ateneo de Zamboanga University
APPENDIX B
HANDS-ON OF THE PRO SIM 8 SIMULATOR
223
Ateneo de Zamboanga University
APPENDIX C
ZCMC’S MEDICAL TECHNICIAN IV INTERVIEW
Suggestions provided:
- Talked about hardware noise typically present in medical devices and its
filtered-out hardware base but only applicable if the device is connected to AC.
Since the battery will be utilized for PHAAS, there is no need to worry about it.
- Suggested taking note of electromagnetic interference (EMI) from electronics
such as cellphones, televisions, microwaves, aircon, monitors, etc. It can affect
data acquisition; therefore, it should be noted when the user uses the device.
- Suggested the use of double insulated lead
- Suggested the use of electro-gel for ECG acquisition (make sure it is meant for
ECG, not ultrasound - available on the market and any brand will do)
- Introduced reusable and non-reusable electrodes which are readily available in
the market
- Agreed on the use of the strap for electrode placement to lessen the effects of
movement noise in the ECG
- When testing, compare the proposed device to the industry standard a.k.a
devices in the hospital
224
Ateneo de Zamboanga University
APPENDIX D
CONSENT FORM
225
Ateneo de Zamboanga University
APPENDIX E
BETA TESTING PRE-TEST QUESTIONAIRRE
226
Ateneo de Zamboanga University
227
Ateneo de Zamboanga University
APPENDIX F
BETA TESTING POST-TEST SURVEY
228
Ateneo de Zamboanga University
229
Ateneo de Zamboanga University
APPENDIX G
ESTIMATION OF CURRENT CONSUMPTION OF PHAAS
230
Ateneo de Zamboanga University
APPENDIX H
INITIAL BILL OF HARDWARE MATERIALS
Total 9,355.65
231
Ateneo de Zamboanga University
APPENDIX I
SUMMARY OF DR. ULANGHUTAN’S INTERVIEW
Q: How many cardiac cycles are needed to confirm that STEMI is occurring?
A: More than one cardiac cycle is needed to confirm and should be consistent. Once
ST-elevation is detected due to a myocardial infarction, the rest of the ECG will be ST-
elevated. The STEMI usually lasts for 24 hours and evolves (ST elevation could
increase is one example)
232
Ateneo de Zamboanga University
APPENDIX J
SUMMARY OF DR. ISMAEL’S INTERVIEW
Q: How long does it take for the symptoms to appear from the onset of STEMI?
A: It varies. Via ECG, there are changes occurring in the micro-level. It depends on
the size and depth of the infarction and the risk factors from the patient (age and health
conditions like diabetes). Also, the bigger the damage (to the heart), the easier it is to
notice physical symptoms on the onset of a heart attack. Additionally, silent
myocardial infarction is possible with a certain population (heart attacks with no
symptoms)
Q: How many cardiac cycles are needed in order to confirm STEMI from the
ECG reading? Does it require consistency?
A: Yes, it needs to be consistent. It cannot be determined with just one or a couple
of cardiac cycles – will be considered as artifact.
Q: How long will the ST-elevation and T-wave inversion last when STEMI has
occurred?
A: When the infarction is complete (STEMI has occurred), it will not go back to
normal unless the heart is revascularized.
Q: What are your suggestions in acquiring a good ECG reading upon context?
A: Proper placement must be observed to get proper reading as there is a possibility
of misinterpretation.
Q: Would you recommend we have an actual person with IHD test the device?
A: It is not advisable.
233
Ateneo de Zamboanga University
APPENDIX K
FUNCTIONAL TESTING RAW RESULTS
234
Ateneo de Zamboanga University
235
Ateneo de Zamboanga University
APPENDIX L
SYSTEM TESTING RAW RESULTS ST-ELEVATION AND ARTIFACT SIZE TEST
236
Ateneo de Zamboanga University
APPENDIX M
SYSTEM TESTING RAW RESULTS CASE 1: STEMI ECG
237
Ateneo de Zamboanga University
APPENDIX N
SYSTEM TESTING RAW RESULTS CASE 2: NORMAL ECG
238
Ateneo de Zamboanga University
APPENDIX O
MACHINE LEARNING PERFORMANCE USING SYSTEM TESTING DATA RAW
RESULTS
239
Ateneo de Zamboanga University
APPENDIX P
BETA TESTING RAW RESULTS: MACHINE LEARNING PERFORMANCE
240
Ateneo de Zamboanga University
241
Ateneo de Zamboanga University
APPENDIX Q
MACHINE LEARNING PERFORMANCE USING BETA TESTING DATA RAW
RESULTS
242
Ateneo de Zamboanga University
APPENDIX R
PIN CONFIGURATIONS OF HARDWARE COMPONENTS
243
Ateneo de Zamboanga University
244
Ateneo de Zamboanga University
Pin configuration of 16x2 LCD Display
16x2 LCD Display Raspberry Pi 4 Pins Description
Pins
245
Ateneo de Zamboanga University
APPENDIX S
USER’S MANUAL
General Information:
----------------------------------------------------------------------------------------------------------------
Disclaimer:
The Portable Heart Attack Alert System is configured for one user only. This
includes remote access to the device with a personal VNC account, and the subject
name and designated contacts specified in the device’s python code. Reconfiguration
of the device is necessary for another user to use the device. It is also important to
note that all configurations are done by a qualified technician, ensuring the device is
set up correctly and functions properly.
----------------------------------------------------------------------------------------------------------------
The following instructions show how to enable the VNC Server in the Raspberry Pi:
1. Turn on Raspberry Pi and open the terminal. Enter the command “sudo raspi-
config” as shown in the figure below. This will open a menu-based interface
which allows for certain configurations to be made including the enabling of the
VNC Server in the Raspberry Pi.
246
Ateneo de Zamboanga University
2. A window will pop up showing various options. To enable VNC server, use
arrow keys to select “Interfacing Options” and press Enter as shown in Figure
2. Afterwards another window will pop-up, choose VNC, as shown in Figure 3
to enable remote access of Rpi via VNC server.
3. A prompt will appear asking for confirmation of enabling VNC Server as shown
in Figure 4, select and press Enter. Another prompt will then appear saying that
VNC Server is enabled as shown in Figure 5. Press Enter to exit the prompt
and return to the terminal.
247
Ateneo de Zamboanga University
4. After returning to the terminal, exit it and click the VNC Server icon shown in
Figure 6. This icon is located on the right side of the taskbar on the desktop.
Once clicked, a user interface will pop up as shown in Figure 7. This interface
will show information such as the I.P. Address of the server along with the
Signature, and Catchphrase which users should check for when connecting to
the server.
248
Ateneo de Zamboanga University
5. While it is possible to remote access the Raspberry Pi with the I.P. Address
alone, it is subject to change depending on which wifi-network the Raspberry
Pi is connected to. For easier access to the VNC Server, create a RealVNC
account online and sign in by clicking on the VNC Server icon in the desktop of
the Raspberry Pi, clicking on the status menu icon, and pressing “Licensing…”
as shown in Figure 8. This allows for remote access no matter what network
the Raspberry Pi is connected to.
6. After following the instructions given and signing in the RealVNC account,
remote access can be achieved through the VNC Viewer application after
signing in the RealVNC account used for the VNC Server.
249
Ateneo de Zamboanga University
----------------------------------------------------------------------------------------------------------------
After setting up the VNC Server and creating a RealVNC to remote access the
Raspberry Pi as long as it has a wifi connection, remote access can be established by
the user, allowing them to start data acquisition.
1. To establish remote access to PHAAS, first ensure that the device to be used
for remote access has the VNC Viewer application installed. The devices can
either be a smartphone, tablet, laptop, or PC. It must be taken note that an
internet connection is required to establish the connection.
3. Once signed in, power on Raspberry Pi and select the corresponding name of
the server in the address book or input the I.P. Address to establish a
connection.
250
Ateneo de Zamboanga University
4. Enter the username and password of the VNC Server to be granted remote
access.
----------------------------------------------------------------------------------------------------------------
251
Ateneo de Zamboanga University
In the case the python code is not available upon opening of the
application, press the “Open Existing File” icon as shown in Figure 14 and
access the following directories to access the python code
/home/phaas/PHAAS_FINAL/phaas_final_code.py as shown in Figure 15.
252
Ateneo de Zamboanga University
3. Once the PHAAS code has been opened, set the name of the user in line 36
of the python code under the subject variable as shown in Figure 16.
4. Also, set the number of the designated contacts under lines 234 and 235 which
is for the first designated contact, lines 262 and 263 for second designated
contact as shown in Figure 17.
----------------------------------------------------------------------------------------------------------------
1. Place three electrode patches following the chest lead II placement provided
in the list and figure shown below:
• Right Arm (RA) - anywhere between the right shoulder and right elbow
• Left Arm (LA) - anywhere between the left shoulder and left elbow
253
Ateneo de Zamboanga University
• Left Leg (LL) - anywhere below the left torso and above the left ankle;
the most preferable location is around one inch below the leftmost part
of the left rib.
3. Connect the lead connectors to the device and the electrode patches. The
placement should follow the following:
• Red Snap-on connected to RA electrode patch.
• Yellow Snap-on connected to LA electrode patch.
• Green Snap-on connected to LL electrode patch.
5. Remotely access the PHAAS through VNC Viewer once it is booted up. Run
the code by entering the following in the terminal:
“python3/home/phaas/PHAAS_FINAL/phaas_final_code.py”
6. After executing the code, PHAAS is now working and can be left to function
independently. The LCD display module will display texts regarding what
phase of the process is the device in which is as follows:
7. If the user desires to remove the device, simply turn off the power bank or shut
it down via VNC server. Then, remove the connection between electrodes and
lead, and remove and discard the electrode patches used.
----------------------------------------------------------------------------------------------------------------
IMPORTANT NOTES:
• After every use of electrode patches, a new set is expected to be used for the
next application.
• Delays are expected between the acquisition and detection of STEMI mainly
due to processing and saving data time.
• A network connection is established when the GSM Module LED Indicator
blinks once every 3 seconds. This allows messages to be sent and calls to be
made.
254
Ateneo de Zamboanga University
• In the case of STEMI detection, the alert system is initiated and designated
personnel will be contacted. It will be indicated on the LCD screen as follows:
• ‘CONTACTING CONTACT 1’ - sending SMS and initiating calls to
assigned contact no.1
• ‘CONTACTING CONTACT 2’ - sending SMS and initiating calls to
assigned contact no.2
• The device can be charged by plugging in a charger and a USB C cable to
the USB C port of the power bank.
• If device was removed or turned off, upon using again, configuration via VNC
server is required in order to run the PHAAS code.
• To access saved filter CSV filters, follow the directory:
“/home/phaas/PHAAS_FINAL/filter_csv”.
• To access saved feature CSV filters, follow the directory:
“/home/phaas/PHAAS_FINAL/feature_csv”.
• To check and confirm ECG events and acquisitions, ECG plots are available at
“/home/phaas/PHAAS_FINAL/filter_plots”.
----------------------------------------------------------------------------------------------------------------
TROUBLESHOOTING
255