ECG Project
ECG Project
ECG Project
CHAPTER ONE........................................................................................................................................ 5
CHAPTER ONE....................................................................................................................................... 6
1.1 INTRODUCTION...........................................................................................................................................................6
1.2 LITERATURE REVIEW....................................................................................................................................................6
1.3 CONDITIONS OF THE ARTERIES.......................................................................................................................................7
1.4 AIM OF THE WORK.....................................................................................................................................................9
1.5 PROJECT OUTLINES...................................................................................................................................................10
CHAPTER TWO...................................................................................................................................... 9
2.1 INTRODUCTION...........................................................................................................................................................9
2.2 ELECTROCARDIOGRAM.................................................................................................................................................9
2.3 SCALE AND CALIBRATION OF TIME................................................................................................................................11
FIGURE(2-4)................................................................................................................................................................. 15
2.4 NORMAL VOLTAGE ON THE ELECTROCARDIOGRAM...........................................................................................................15
2.5 GENERATIONS OF ECG DEVICES...................................................................................................................................18
CHAPTER THREE................................................................................................................................... 20
RESEARCH METHODOLOGY.................................................................................................................. 20
CHAPTER THREE.................................................................................................................................... 9
RESEARCH METHODOLOGY.................................................................................................................... 9
3.1 INTRODUCTION...........................................................................................................................................................9
3.2 CERTAIN HEART DISEASES ABNORMAL ATRIAL RHYTHMS.....................................................................................................9
3.3 MYOCARDIAL INFARCTION (HEART ATTACK)....................................................................................................................12
FIGURE(3-2)................................................................................................................................................................. 14
3.4 DIZZINESS AND SYNCOPE............................................................................................................................................14
3.5 POSSIBLE TACHYCARDIA PATIENTS................................................................................................................................18
3.6 ATRIAL FLUTTER........................................................................................................................................................19
1
CHAPTER FOUR................................................................................................................................... 22
4.1 INTRODUCTION...........................................................................................................................................................9
4.2 THE SIMPLIFIED EXPLANATION OF THE MATLAB PROGRAM: -...............................................................................................9
4.3 DATABASE:..............................................................................................................................................................10
4.4 EXPLANATION OF THE PROGRAM STEPS:........................................................................................................................10
4.5 FACADE BUILD:.........................................................................................................................................................17
4.6 FUTURE PROSPECTS:-.................................................................................................................................................25
REFERENCES....................................................................................................................................... 27
2
List Of Figures
3
Figure 4-1 :Start Matlab.......................................................................................31
Figure 4-2 :The blue main EEGLAB window....................................................31
Figure 4-3 :Biosemi format data..........................................................................32
Figure 4-4 :Load Data...........................................................................................32
Figure 4-5 :channel locations................................................................................33
Figure 4-6 :Filter the Data....................................................................................34
Figure 4-7 :Extract Data.......................................................................................34
Figure 4-8 :Run ICA.............................................................................................35
Figure 4-9 :Creating a STUDY............................................................................36
4
Chapter One
5
1 Chapter One
1.1 Introduction
History and a short review of the Anatomy of the human body and heart will
be introduced in this chapter. However, more details will be shown deeper than
others since this project will deal with reading the heart wives using the MATLAB
package and designing an interface inside the MATLAB environment to simplify
the process of reding, this chapter shows outlines of the whole project as well as
the aim of the project.
The arteries are the blood vessels that deliver oxygen-rich blood from the
heart to the tissues of the body Each artery is a muscular tube lined by smooth
tissue and has three layers. The inner layer is lined by a smooth tissue called the
endothelium [1]. The media is a layer of muscle that lets arteries handle the high
pressures from the heart [2] . The adventitia connective tissue anchoring arteries to
nearby tissues
The largest artery is the aorta, the main high-pressure pipeline connected to
the heart's left ventricle . The aorta branches into a network of smaller arteries that
extend throughout the body. The arteries' smaller branches are called arterioles and
capillaries. The pulmonary arteries carry oxygen-poor blood from the heart to the
lungs under low pressure, making these arteries unique [3].
6
1.3 Conditions of the Arteries
7
Coronary artery disease: Atherosclerosis with narrowing of the arteries
supplying blood to the heart muscle. Coronary artery disease makes a heart attack
more likely Carotid artery disease: Atherosclerosis with narrowing of one or both
of the carotid arteries in the neck. The disease of the carotid arteries makes stroke
more likely. Tests of the Arteries
Angiogram angiography: [6] A thin, flexible tube is inserted into the arteries,
a special dye is injected, and an X-ray shows blood flow through the arteries.
Areas of narrowing or bleeding in the arteries can often be identified through
angiography. Computed tomographic angiography (CT-A scan): A CT scanner
takes multiple X-rays, and a computer compiles them into detailed images of the
arteries. A CT-A scan can often show narrowing or other problems in the arteries
with less risk than regular angiography.
Stress test: Either with exercise or medicines, the heart is stimulated to beat
rapidly. As this stress increases blood flow through the heart's narrowings, the
coronary arteries may be identified through various testing techniques. Magnetic
resonance angiography (MRA scan): An MRI scanner uses a high-powered magnet
and a computer to create highly detailed images of structures inside the body.
MRA is a setting that allows an MRI scanner to best display images of the arteries.
[6]
9
1.4 Aim of the Work
10
Chapter Two
2.1 Introduction
2.2 Electrocardiogram
Are there any side effects of an electrocardiogram .There are no side effects
of this examination, and it does not cause any harm at all during or after it. An
electrocardiogram helps a doctor learn many things about a person's heart, such as:
If you have had or are having a heart attack in the pas [9] the patient has a heart
rhythm disturbance ,If the heart is not getting enough blood and oxygen If the
muscular wall of the heart is too thick ,If there are bulges in weak areas of the
walls of the heart (called an aneurysm . Are the electrical connections to the
device ?They are the electrodes or electrical sensors that are connected to wires
and connected to the device and are divided into the terminal connections that
connect to the four ends and the chest connections [10]. The colors of the terminal
connections have been agreed upon as follows. The white colour , which is
connected to the right hand and written on it (RA). The black color, which is
connected to the left hand and written on it (LA) . The green colour, which is
attached to the right foot and is written on it (RL . The red color that connects to
the left foot and writes (LL) on it ,It is connected to the chest and its colour is
brown and written on it [11](c) In addition to the bipolar terminal connections
BIPOLAR . They are I, II, III and it is called EINTHOVEN TRIANGLE It is
connected as shown in (Fig 2-1)
Figure(2-1)
As for the chest connections, they are divided into:
V 1 ,V 2 ,V 3 , V 4 , V 5 ,V 6
Figure(2-2)
EcCE if you have any of the following indicators and symptoms . The pulse
of the pulse Dumping speed Diffuser The weight of the exercise does not
recommend the American heart Society using an ECA to evaluate the adult case
and do not have any symptoms and have risk rates have low. But if you have a
family history of heart disease, your doctor may propose a cardiac planning test as
testing, even though you do not feel any symptoms. If your symptoms tend to
appear and disappear, it may not pick up the heart card in the standard recording.
In this case, your doctor may recommend using the power-or-heart-wide network
organs. There are several different types of her.
Holter device. The Holler device is a small wearable device that recorded the
steady electrophilic chart continuously, usually for 24 to 48 hours. Monitoring of
heart attack events. This mobile device is similar to the Holter device, but it is only
recorded at certain times for a few minutes at a time. As you can wear it longer
than the Holter device, usually for 30 days. In general, you must click the button
when you feel symmetries. Some devices are automatically recorded at a time-out
of a ridiculous rhythm of the hearts. Risk The action of the heat capacity is a safe
action. There is no risk of electric shock during the test because the electrical
electrodes used do not produce electricity. Electrical electrodes recorded the
electrical activity in your heart only. You may feel slightly disturbed, such as the
disturbance you feel during the removal of the bandage when removing the
electrodes. Some people get a slight skin surface in the place of leisure leather. The
results may discuss your doctor with the results in the same day on which the heart
card is planned or on the next date. If the results of the heart card is a natural heart,
the f does not need to make more tests. If the results show the presence of a
heartfelt, you may need to make a cardiac card planning again or undergo other
diagnostic tests such as an echo scheme. The treatment method depends on the
cause of indicators and symptoms you show. Your doctor will record the
information recorded by the heart card planning and will search for any in-heart
problems, including * Heart of heartbeat. The heart rate can not be measured by
losing the pulse. Early heart planning can help if the feeling of mankind is difficult,
or the pulse was very fast or irregularly largely prevented its account accurately.
Lack of heart supply blood and oxygen. Action cardiac cardio during the
symmetrical feeling can help your doctor to determine whether chest pain is about
the low blood flow of the heart attack, as with the chest pain due to unstable action.
Brownian distortions. The heart card show may show evidence of the heart or
walls, as well as the hearts of the heart and other problems. If your doctor finds any
problem in the heart of the heart you have made, you may be required to take
additional tests to determine whether the necessary treatment is necessary (Fig 2-
3).
Figure(2-4)
[7][6] . Uses edit Having chest pai, In the event of an irregular heartbeat
Shortness of breath. Constant fatigue and stressHaving an abnormal heartbeat.
Diagnosis of some heart diseases Routine cardiac examination if there is a family
history Monitor the efficacy of heart medications
The means of quoting the heart signal have multiplied and evolved
significantly. They generally relied on ordinary galvanic scales in the beginning,
but did not provide the desired purpose, until transistors appeared and recorded on
paper and even process amplifiers, as these signals could be amplified and filtered
on the screens of the signal pars. With the advent of the computer, the mechanism
of the display, storage and processing developed, where it became possible to
compare several references and know the dysfunction more accurately. The latest
conclusion of science is to quote the heart signal by small mobile devices that the
patient puts in his pocket and they are in direct contact with him, where they store
the information first and show it and then transfer it to the computer if he wants.
(Fig 2-5)
Figure(2-6)
Research Methodology
3 Chapter Three
Research Methodology
3.1 Introduction
Chart at rest or during the shift Justice It is a chart that is drawn in the clinic
in a state of rest, and it shows the current rhythm of the heart, and it can also detect
many arrhythmias that appear during the resting period of the heart, and the chart
can be drawn in moments when the patient feels arrhythmia, then the drawing is
called an attack chart, given that it was drawn during the show's frenzy.
Paroxysmal arrhythmias vary with each other in the frequency of the disturbance,
there are disturbances that the patient feels daily, here it is sufficient to record for
24 hours, but in cases where arrhythmias occur varying by weeks or months, it is
necessary to analyze the electrocardiogram for periods ranging according to the
frequency of attacks From weeks to years. There are several devices developed to
diagnose such cases, including the "Holter examination" or electrocardiogram over
24 hours, and is used by planning a three-electrode electrocardiogram to analyze
the electrocardiogram over an entire day, and note the disturbances in the rhythm
during that period. “Spider ECG”: It is called so because the device is fixed on the
patient’s chest, and then the wires are attached to the patient’s chest in a spider-like
or spider web. Such devices record the electrocardiogram for periods of up to
several weeks. The Event Recorder: This is a hand-sized device that the patient
carries with him, and when he feels arrhythmia, he places the device on his chest to
record an electrocardiogram for 30 seconds, for example. Implanted Loop
Recorder or Implanted Event Recorder:
These devices are the size of a USB flash drive, which is implanted under
the skin, and they analyze the ECG and record any disturbances that the device
notices. Some of these devices enable the patient to record the disturbances
believed to be occurring in minutes retrospectively, and the measurements are
analyzed periodically.
The right and left coronary arteries feed the same heart muscle for the heart
to function. A drawing shows myocardial infarction, and blood not reaching part of
the heart muscle through the left coronary artery, while the right coronary artery is
properly indicated in the diagram above. Zone 1 has a black-shown blockage inside
a branch of the left coronary artery that feeds the lower part of the heart muscle.
The zone is the anterior wall of the heart muscle, which is not reached by blood
after the blockage in the area. The artery can be seen after the and changed color
due to the lack of blood flow, as well as the color of the area below the heart
affected by the blockage of the artery is variable as a result of ischemia and
therefore lack of oxygen snugly (Fig 3-2)
Figure(3-2)
POTS generally appears in young women. After excluding other causes, the
diagnosis is made on physical examination, medical history, and tilt-table test.
Treatment usually consists of increased salt and fluid intake, recumbent exercise
not standing upright, and education in avoiding triggers. POTS does not usually get
worse with age How is syncope diagnosed? It's important to identify the cause of
syncope, if possible, to rule out a dangerous heart condition. Depending on your
symptoms and circumstances, the following tests may be used to find the
cause: On-site Diagnostic Tests. Electrocardiogram (ECG or EKG): wires taped to
various parts of your body to create a graph of your heart’s electrical rhythm
Exercise: ECG recorded while strenuously exercise sing .
Echocardiogram or transesophageal echocardiogram: ultrasound of the
heart Physical examination, including orthostatic vital signs and carotid sinus
massage.
Tilt table test measurement of heart rate and blood pressure in response to
upright tilt, which simulates prolonged standing Electrophysiology (EP): test that
examines the heart’s electrical activity from the inside; used to diagnose many
heart rhythm disorders In-home Diagnostic Monitors Holter: a portable ECG you
wear continuously for one to seven days to record your heart rhythms over time
Event: a portable ECG you wear for one or two months, which records only when
triggered by an abnormal heart rhythm or when you manually activate it.How is
syncope treated? The treatment for syncope will depend upon the underlying
condition but may include: Catheter: a procedure to cauterize the specific heart
cells that cause abnormal heart rhythms Pacemakers: device inserted under the skin
below the collarbone to deliver regular electrical pulses through thin, highly
durable wires attached to the heart; used to treat bradycardia, heart block and some
types of heart failure Implantable: a small implanted device that delivers an
electrical pulse to the heart to reset a dangerously irregular heartbeat; often used to
treat ventricular tachycardia or heart failure Avoiding known triggers
If the heart beats very quickly over a long time, it may lead
to cardiomyopathy, a weakening of the heart muscle. How is atrial flutter
diagnosed Atrial flutter is normally diagnosed in your physician's office using
an electrocardiogram (ECG or EKG). If the diagnosis is still in question, your
doctor may recommend a Holter monitor, an event monitor, or
an electrophysiological study, during which a narrow, flexible tube called a
catheter is threaded through a vein to your heart under light sedation. Fine wires
inside the catheter can help pinpoint the abnormal signal. How is atrial flutter
treated?
Sometimes, atrial flutter goes away by itself and no further action is needed.
If it persists, your doctor may pursue any of the following treatments: Treatment of
any underlying conditions Catheter ablation — procedure to destroy the errant
electrical pathways; performed together with an electrophysiological study
In this chapter, we will talk about the practical application of the proposed
algorithm and explain the database The method used, how to read it on the Matlab
program and display the resulting practical results of the application algorithm.
9
Figure(4_1)Letters, letters, answers, letters, letters, texts, letters, alphabets
4.3 Database:
1-The first part is a database reading that was previously stored as an excel file
with a graphic
10
[FileName,PathName] = uigetfile('*.xls','Select the Excel file');
x = x'; x1 = x;
t = 0:0.004:0.004*(length(x1) - 1);
2-We start by analyzing the signal by calculating the highest value of the derivative
and reserving the initial values for all the variables -ECG signals first compound
that can be determined is (R - ) by the maximum value of the derivative. Figure (4-
2) The position of R and the values of the derivative before and after it
11
3- Then we define (-Q), which is the minimum value of the derivative before (R),
which we take before (R) on the inverse axis. Time in the same window as
searching for the minimum value of the derivative and its location, and when the
derivative is absentee have obtained QRS_start
4- Then we define (S), which is the minimum value of the derivative after (R),
where we take the dimension (R) with an axis with timeIn the same window,
search for the minimum value of the derivative and its location,and when the
derivative is absent, we areWe got QRS_end .Thus, we have obtained whereabouts
(QRS_top, Q,S, QRS_start, QRS_end,) for eachsignal and store it.))
y_diff = gradient(x1);
figure
subplot(2,1,1),plot(x1);
subplot(2,1,2),plot(y_diff);
y_max = zeros(1,length(y_diff)/200);
y_min = zeros(1,length(y_diff)/200);
fori = 1:length(y_max),
end
qrs_top = zeros(1,length(y_max));
qrs_start = zeros(1,length(y_max));
12
qrs_end = zeros(1,length(y_max));
Q = zeros(1,length(y_max));
S = zeros(1,length(y_max));
beat_begin = zeros(1,length(y_max));
fori = 1:length(y_max),
temp = find(y_diff(qrs_top(i)-30:qrs_top(i))==0);
ifisempty(temp) == true,
temp =1;
end
else
qrs_start(i) = 1;
end
temp = find(y_diff(qrs_top(i):qrs_top(i)+30)==0);
ifisempty(temp) == true,
13
temp = 30;
end
5-We define (-p) with the same principle as the method of determining (R),
where we take the time reversal axis starting from( QRS_start (when the derivative
value becomes) QRS_start=0 (In the same way as before, we have we got
(P_top,P_start,P_end )
%% P wave
p_top = zeros(1,length(qrs_top));
p_start = zeros(1,length(qrs_top));
p_end = zeros(1,length(qrs_top));
j = 1;
fori = 1:length(qrs_top)
if (beat_begin(i) > 0)
segment = x1(beat_begin(i):qrs_start(i));
max_seg = max(segment);
segment = x1(beat_begin(i):p_top(i));
14
min_seg = min(segment);
segment = x1(p_top(i):qrs_start(i));
min_seg = min(segment);
end
end
6-We define T (with the same principle of calculating R) where we take the time
axis starting from (QRS_end)When the value of the derivative of (QRS_end=0)
becomes, in the same way as before, we have we got) T_ top, T_start, T_end )
%% T wave
a = [1 -2 1];
b = [1 0 0 0 -2 0 0 0 1];
T_top = zeros(1,length(qrs_top));
T_start = zeros(1,length(qrs_top));
T_end = zeros(1,length(qrs_top));
fori =1:length(qrs_start) - 1,
15
segment = x1(qrs_end(i)+2:p_start(i+1)-5);
y_T_diff = segment;
%% T Top
t=max(y_T_diff);
%% T end
seg = y_diff(T_top(i):p_start(i+1)-5);
ifisempty(idx1) == 1,
idx1 = 1;
end
%% T start
seg = y_diff(qrs_end(i):T_top(i));
if length(idx2) > 1,
idx2 = idx2(1);
end
16
end
T = mean(x1(T_top(1:length(T_top) - 1)));
P_width = mean(p_end-p_start)*4;
For each parameter, the arithmetic meantime with the passage of the waves is
calculated and . is calculated scattering; Dispersion expresses the extent to which
the real values change from the average. The greater the dispersion, the greater the
change. If we assume that the dispersion of the RR measurement was large, the
real values will change significantly from the mean and thus Heartbeat changes
will be rapid
Matlab contains libraries that support building a user interface to hide the
complexities of the functions Written and easy to handle the project. Programming
in the case of interfaces differs from traditional programming in that it is event-
based programming, and here we mean every means for the user to communicate
with the computer, such as the keyboard, moving Mouse, pressing one of the
mouse buttons and other events. In the help interface of Matlab, write the
following instruction: guide or click the guide button located in- :) Toolbar, the
following window will appear in the figure( Figure (3-7):
17
Figuer(4-3) Help window - Guide.
We choose Save new figure as and then put the name of the file in which we want
to save the interface, for example untitled2, Matlab generates two files with the
same name, but they differ in the suffix and the two suffixes are: Fig: This file
contains the shape of the interface (Controlls.) m : It contains the function of each
of the microcontrollers in the previous file. Figure (4-7) shows the design window:
18
Figure (4-4): Design window
To the left of this window are the controllers that we can put in the interface we
want to designIt contains most of the Windows controllers and allows the designer
to use external libraries as well.To run the window, we press the Run button :- ,
(we get the figure 4-5 )
19
Figure (4-5): When the Run button is pressed.
First: Adding a Push Button: When you click on this button, we get to the welcome
20
message, and this shows Figure (4-6(
Figure (4-6): Adding a Push Button Second: The name of this button must be
changed, so we double-click the button, and the Inspector window will open as It
is shown in Figure (4-6), and we search within it for the - String box and give it the
name we want ECG
21
Figure (4-7): Window – Inspector
Figure (4-7) shows the shape of the interface after changing the name of the button
from - Push to ECG
22
Figure ( 4-8): The appearance of the interface after changing the name of
the button from - Push to ECG
When running and pressing the previous button, nothing happens. To add the
desired function, we pressButton in the design window with the right mouse button
and from the menu select View Callbacks, from which we choose Callback
23
Figure (4-9) shows the shape of the interface that was designed in this
project
24
Figure(4-10) ) shows the designed interface after the signal is entered and
analyzed
It is important that the design submitted for any model performing a particular
medical function be scalable and modernization, which enables the user to respond
effectively and smoothly to most requirements and medical needs that arise as a
result of scientific developments, without the need to replace the entire system.
Thus without relatively high costs. The model presented in our project is
characterized by the simplicity of the algorithm, which saves time and effort for
25
the user ,it is characterized by a high capacity for development thanks to the
computer infrastructure that it includes in analysis and demonstration which in turn
offers high flexibility in design to keep pace with all developments in this field,
which dictated by the need.
Here are some personal suggestions that could be developed for this algorithm:
2. The ability to connect with the available information network, whether in the
hospital or clinic, which gives High flexibility and speed in data transmission and
the ability to store all data.
3. The possibility of expanding the algorithm and adding many heart diseases and
abnormalities (especially thoseIllnesses that are in changes from the normal or less
pathologically severe sign state Small changes (and analyzed and shown on the
computer.In the end, we hope that we have succeeded in this project and that it will
achieve success on the practical levelAnd be a second assistant to doctors in clinics
and hospitals to detect disease cases In a fast and easy way after the signal is
entered and analyzed
26
5 References
[1] J. R. Hampton and J. (Consultant physician) Hampton, “The ECG made easy,” p.
194.
27
[8] M. Sheppard, F. Laskou, P. P. Stapleton, S. Hadavi, and B. Dasgupta,
“Tocilizumab (Actemra),” https://doi.org/10.1080/21645515.2017.1316909, vol.
13, no. 9, pp. 1972–1988, Sep. 2017, doi: 10.1080/21645515.2017.1316909.
[11] “(11) (PDF) ‘Kentish Gothic’ or imported? Understanding a group of early 15th
century tracery-carved medieval chests in Kent and Norfolk. Archaeologia
Cantiana, 138, 2017, 105-128.”
https://www.researchgate.net/publication/328175585_’Kentish_Gothic’_or_import
ed_Understanding_a_group_of_early_15th_century_tracery-
carved_medieval_chests_in_Kent_and_Norfolk_Archaeologia_Cantiana_138_201
7_105-128 (accessed May 24, 2022).
28
[14] C. M. Otto et al., “2020 ACC/AHA Guideline for the Management of Patients
With Valvular Heart Disease: Executive Summary: A Report of the American
College of Cardiology/American Heart Association Joint Committee on Clinical
Practice Guidelines,” J Am Coll Cardiol, vol. 77, no. 4, pp. 450–500, Feb. 2021,
doi: 10.1016/J.JACC.2020.11.035.
29