Higher Diploma in Biomedical Engineering
VerifiedAdded on 2022/08/27
|28
|5438
|21
AI Summary
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
1
HIGHER DIPLOMA IN BIOMEDICAL ENGINEERING
HND FINAL ENGINEERING PROJECT: INTERIM REPORT
S
Eman Hassan CL/HNDBME/07/25
Varsha Kalubowila CL/HNDBME/07/26
Naween Dissanayake CL/HNDBME/07/05
Adisha Gamage CL/HNDBME/07/18
HIGHER DIPLOMA IN BIOMEDICAL ENGINEERING
HND FINAL ENGINEERING PROJECT: INTERIM REPORT
S
Eman Hassan CL/HNDBME/07/25
Varsha Kalubowila CL/HNDBME/07/26
Naween Dissanayake CL/HNDBME/07/05
Adisha Gamage CL/HNDBME/07/18
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Abstract:
2
2
Table of Contents
Chapter 01: Introduction.......................................................................................................................4
1.1 Background of the project:..............................................................................................................4
1.2 Problem identification.....................................................................................................................5
1.3 Aim and Objective...........................................................................................................................5
1.3.1 Aim.......................................................................................................................................5
1.3.2 Objectives.............................................................................................................................5
1.4 Scope and Limitation.......................................................................................................................6
Chapter 02: Background Study.............................................................................................................7
2.0 Theory.............................................................................................................................................7
2.1 ECG Detection Algorithms.....................................................................................................7
2.2 ECG Signal Filters...................................................................................................................8
Chapter 03: Literature Review..............................................................................................................9
3.1 ECG Circuitry..................................................................................................................................9
3.1.1 ECG Amplifier.....................................................................................................................9
3.1.2 Instrumentation Amplifier..................................................................................................11
3.1.3 Electrode.............................................................................................................................11
3.1.4 Biosensors..........................................................................................................................11
3.1.5 Pulse Sensor SEN-11574....................................................................................................12
3.1.6 ECG Filtering Techniques..................................................................................................12
3.1.7 A/D Conversion..................................................................................................................12
3.1.8 Transmitter.........................................................................................................................12
3.2 Data Processing.............................................................................................................................12
3.2.1 Microcontrollers.................................................................................................................12
3.3 Output............................................................................................................................................12
3.3.1 LCD....................................................................................................................................12
3.4 Emergency Alarm System.............................................................................................................12
Chapter 04: Methodology....................................................................................................................13
4.1 Overview of the design..................................................................................................................13
4.2 ECG Circuitry................................................................................................................................14
3
Chapter 01: Introduction.......................................................................................................................4
1.1 Background of the project:..............................................................................................................4
1.2 Problem identification.....................................................................................................................5
1.3 Aim and Objective...........................................................................................................................5
1.3.1 Aim.......................................................................................................................................5
1.3.2 Objectives.............................................................................................................................5
1.4 Scope and Limitation.......................................................................................................................6
Chapter 02: Background Study.............................................................................................................7
2.0 Theory.............................................................................................................................................7
2.1 ECG Detection Algorithms.....................................................................................................7
2.2 ECG Signal Filters...................................................................................................................8
Chapter 03: Literature Review..............................................................................................................9
3.1 ECG Circuitry..................................................................................................................................9
3.1.1 ECG Amplifier.....................................................................................................................9
3.1.2 Instrumentation Amplifier..................................................................................................11
3.1.3 Electrode.............................................................................................................................11
3.1.4 Biosensors..........................................................................................................................11
3.1.5 Pulse Sensor SEN-11574....................................................................................................12
3.1.6 ECG Filtering Techniques..................................................................................................12
3.1.7 A/D Conversion..................................................................................................................12
3.1.8 Transmitter.........................................................................................................................12
3.2 Data Processing.............................................................................................................................12
3.2.1 Microcontrollers.................................................................................................................12
3.3 Output............................................................................................................................................12
3.3.1 LCD....................................................................................................................................12
3.4 Emergency Alarm System.............................................................................................................12
Chapter 04: Methodology....................................................................................................................13
4.1 Overview of the design..................................................................................................................13
4.2 ECG Circuitry................................................................................................................................14
3
4.3 Device to embed Microcontroller..................................................................................................15
4.4 Microcontroller..............................................................................................................................15
4.5 Thermal Sensor..............................................................................................................................15
4.6 Pressure Sensor..............................................................................................................................15
4.7 Emergency Alarm System.............................................................................................................16
4.8 Further Discussion on the Reviewed Project................................................................................16
REFERENCES....................................................................................................................................17
4
4.4 Microcontroller..............................................................................................................................15
4.5 Thermal Sensor..............................................................................................................................15
4.6 Pressure Sensor..............................................................................................................................15
4.7 Emergency Alarm System.............................................................................................................16
4.8 Further Discussion on the Reviewed Project................................................................................16
REFERENCES....................................................................................................................................17
4
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Chapter 01: INTRODUCTION
1.1 Background of the project:
An ECG is a recording of the electrical activity on the body surface generated by the heart
aaccording to National Health Service, United Kingdom in 2018, ECG measurement is an
information that is collected through electrodes placed at designated locations on the body. It is the
best way to measure and diagnose abnormal rhythms of the heart, particularly abnormal rhythms
caused by damage to the conductive tissue that carries electrical signals by electrolyte imbalances.
The aim of ECG detection algorithm is to detect the characteristic waveforms of ECG, such as QRS
wave group which represents depolarization and contractions left and right ventricles. This includes
exporting the digitized data of ECG and then using programming languages to detect the high peak
QRS wave group through a threshold.
The National Heart, Lung, and Blood Institute, Disease and Condition Index in 2003, states that
abnormal ECG waveforms are mostly obtained from patients above 55 years old. Therefore senior
citizens are vulnerable to heart attack. Senior citizens need to be monitored closely to identify and be
alerted regarding any sudden changes on the heart condition so that necessary actions could be
taken. Usually a caretaker or a family member is responsible for measuring and recording the
important parameters and comparing them to see if the heart condition worsens or not. This requires
the caretaker/family member to be present near the patient at most times and the elder citizen may
even find it difficult to have to take ECG and such hourly every day. This will definitely hinder their
5
Electrical disease Circulatory disease Structural disease
Problems with the electrical
system that regulates the
steady heartbeats cause heart
rate to be too slow or too fast.
High blood pressure and
coronary artery disease can
cause a stroke or heart attack
Heat muscle disease and
congenital abnormalities are two
problems that can damage the
heart muscle or valves.
1.1 Background of the project:
An ECG is a recording of the electrical activity on the body surface generated by the heart
aaccording to National Health Service, United Kingdom in 2018, ECG measurement is an
information that is collected through electrodes placed at designated locations on the body. It is the
best way to measure and diagnose abnormal rhythms of the heart, particularly abnormal rhythms
caused by damage to the conductive tissue that carries electrical signals by electrolyte imbalances.
The aim of ECG detection algorithm is to detect the characteristic waveforms of ECG, such as QRS
wave group which represents depolarization and contractions left and right ventricles. This includes
exporting the digitized data of ECG and then using programming languages to detect the high peak
QRS wave group through a threshold.
The National Heart, Lung, and Blood Institute, Disease and Condition Index in 2003, states that
abnormal ECG waveforms are mostly obtained from patients above 55 years old. Therefore senior
citizens are vulnerable to heart attack. Senior citizens need to be monitored closely to identify and be
alerted regarding any sudden changes on the heart condition so that necessary actions could be
taken. Usually a caretaker or a family member is responsible for measuring and recording the
important parameters and comparing them to see if the heart condition worsens or not. This requires
the caretaker/family member to be present near the patient at most times and the elder citizen may
even find it difficult to have to take ECG and such hourly every day. This will definitely hinder their
5
Electrical disease Circulatory disease Structural disease
Problems with the electrical
system that regulates the
steady heartbeats cause heart
rate to be too slow or too fast.
High blood pressure and
coronary artery disease can
cause a stroke or heart attack
Heat muscle disease and
congenital abnormalities are two
problems that can damage the
heart muscle or valves.
daily routine. Thus, an installable multi-healthcare system with Heart Attack Detection is specially
designed as detection unit and as the medium asking for medical help in case of an emergency.
1.2 Problem identification
A proportion (45.3%) of the elder citizens suffer from diabetes and high blood pressure which are
both risk factors for heart attack. Elderly have a need for an extensive health monitoring and
treatment. They need extraordinary care and geriatric treatments that are expensive (Satharasinghe,
A., 2016). Therefore, the provision of long term health care is a most serious issue. Hiring a
caretaker would be wise but expensive as she/he will need to be paid a fee every month including all
the other expenses for the machines to measure the patient’s heart conditions.
The patient would not be able to spend his/her day as they please because the readings have to be
taken at specific times which will hinder their regular routine. If a family member is responsible,
then they would not be able to go for work or might not be sufficiently experienced to handle an
emergency situation if it arises. Thus a simpler and easier way to monitor the patient without
hindering his/her regular routine is important.
1.3 Aim and Objective
1.3.1 Aim
The main aim of this project is to be able to continuously measure the patient’s vitals without
obstructing the patient’s regular routines and to make their life safer and easier. Also, making sure
that there is no abnormality in the heart rhythms and if so, giving a warning before the emergency
call that gives the patient a chance to avoid heart attack.
1.3.2 Objectives
General objectives
To measure patient’s heart rhythms using a wireless biosensor on the wrist and to produce an
alarm in case of an emergency through a microcontroller based program installed in the
walking stick or wheelchair
To produce a wireless emergency communication system through Bluetooth in critical
conditions
Specific objectives
6
designed as detection unit and as the medium asking for medical help in case of an emergency.
1.2 Problem identification
A proportion (45.3%) of the elder citizens suffer from diabetes and high blood pressure which are
both risk factors for heart attack. Elderly have a need for an extensive health monitoring and
treatment. They need extraordinary care and geriatric treatments that are expensive (Satharasinghe,
A., 2016). Therefore, the provision of long term health care is a most serious issue. Hiring a
caretaker would be wise but expensive as she/he will need to be paid a fee every month including all
the other expenses for the machines to measure the patient’s heart conditions.
The patient would not be able to spend his/her day as they please because the readings have to be
taken at specific times which will hinder their regular routine. If a family member is responsible,
then they would not be able to go for work or might not be sufficiently experienced to handle an
emergency situation if it arises. Thus a simpler and easier way to monitor the patient without
hindering his/her regular routine is important.
1.3 Aim and Objective
1.3.1 Aim
The main aim of this project is to be able to continuously measure the patient’s vitals without
obstructing the patient’s regular routines and to make their life safer and easier. Also, making sure
that there is no abnormality in the heart rhythms and if so, giving a warning before the emergency
call that gives the patient a chance to avoid heart attack.
1.3.2 Objectives
General objectives
To measure patient’s heart rhythms using a wireless biosensor on the wrist and to produce an
alarm in case of an emergency through a microcontroller based program installed in the
walking stick or wheelchair
To produce a wireless emergency communication system through Bluetooth in critical
conditions
Specific objectives
6
To make the microcontroller programmed to run an algorithm on the received signal to make
sure if there is an abnormality or not
To be able to manually design Microcontroller’s algorithm for each person as their average
heart rate and such is different from one another
To lower total power consumption so battery does not need to be changed often
To give an emergency call to the necessary personnel if situation is critical.
To connect the microcontroller to the phone through Bluetooth so the emergency call can be
given by the phone
1.4 Scope and Limitation
Scope:
The heart rhythms measured by biosensor
Heart rate and contact details shown in LCD of the walking stick or wheelchair
Comparing the heart rate measured to the normal ranges of the patient
Give out necessary signal or emergency call in case of alarming heart abnormalitiess
Limitation:
In practical scenarios, the patient’s phone is used to call and assumption is made that the user is
within the range of the stick or the wheelchair so the Bluetooth signal could not be interfered
The bio-sensors may have less noise cancellation effect depending on the environment of the
patient.
It will be moderately expensive so not everyone who needs it will be able to buy.
7
sure if there is an abnormality or not
To be able to manually design Microcontroller’s algorithm for each person as their average
heart rate and such is different from one another
To lower total power consumption so battery does not need to be changed often
To give an emergency call to the necessary personnel if situation is critical.
To connect the microcontroller to the phone through Bluetooth so the emergency call can be
given by the phone
1.4 Scope and Limitation
Scope:
The heart rhythms measured by biosensor
Heart rate and contact details shown in LCD of the walking stick or wheelchair
Comparing the heart rate measured to the normal ranges of the patient
Give out necessary signal or emergency call in case of alarming heart abnormalitiess
Limitation:
In practical scenarios, the patient’s phone is used to call and assumption is made that the user is
within the range of the stick or the wheelchair so the Bluetooth signal could not be interfered
The bio-sensors may have less noise cancellation effect depending on the environment of the
patient.
It will be moderately expensive so not everyone who needs it will be able to buy.
7
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Chapter 02: BACKGROUND STUDY
2.0 Theory
National Health Service, United Kingdom in 2018 states that the volume of Electrocardiogram
(ECG) recorded in hospitals is increasing as the people suffering from heart diseases are increasing
at an alarming rate. An ECG is a recording of the electrical activity on the body surface generated by
the heart. ECG measurement information is collected by electrodes placed at designated locations on
the body. It is the best way to measure and diagnose abnormal rhythms of the heart, particularly
abnormal rhythms caused by damage to the conductive tissue that carries electrical signals, or
abnormal rhythms caused by electrolyte imbalances. In a Myocardial infarction (MI), the ECG can
identify if the heart muscle has been damaged in specific areas.
2.1 ECG Detection Algorithms
According to 2019 4th International Workshop on Materials Engineering and Computer Sciences,
ECG detection algorithm as an example, the aim of this algorithm is to detect the characteristic
waveforms of ECG, such as QRS wave group representing depolarization of ventricles or
contraction of left and right ventricles. According to the common method, the first way is exporting
the digitized data of ECG, then program using the C ++ language or other programming languages,
at last we can detect the high peak QRS wave group through a threshold.
According to 2019, 4th International Workshop on Materials Engineering and Computer Sciences;
the accuracy of QRS detection based on the above intuitive method is not high. Because the ECG
waveform may be disturbed by EMG, motion, noise and the baseline drift, leading to some QRS
waves far higher or lower than the baseline. It may not be judged on the threshold, or even be
covered by noise. In addition, the threshold changes by the changes of QRS complex according to
some arrhythmias such as ventricular premature beats occur. Therefore, it is needed to consider
improving the detection algorithm, so we need to add many programming methods and strategies.
The core element embodied in these methods and strategies is the basic knowledge of association.
8
2.0 Theory
National Health Service, United Kingdom in 2018 states that the volume of Electrocardiogram
(ECG) recorded in hospitals is increasing as the people suffering from heart diseases are increasing
at an alarming rate. An ECG is a recording of the electrical activity on the body surface generated by
the heart. ECG measurement information is collected by electrodes placed at designated locations on
the body. It is the best way to measure and diagnose abnormal rhythms of the heart, particularly
abnormal rhythms caused by damage to the conductive tissue that carries electrical signals, or
abnormal rhythms caused by electrolyte imbalances. In a Myocardial infarction (MI), the ECG can
identify if the heart muscle has been damaged in specific areas.
2.1 ECG Detection Algorithms
According to 2019 4th International Workshop on Materials Engineering and Computer Sciences,
ECG detection algorithm as an example, the aim of this algorithm is to detect the characteristic
waveforms of ECG, such as QRS wave group representing depolarization of ventricles or
contraction of left and right ventricles. According to the common method, the first way is exporting
the digitized data of ECG, then program using the C ++ language or other programming languages,
at last we can detect the high peak QRS wave group through a threshold.
According to 2019, 4th International Workshop on Materials Engineering and Computer Sciences;
the accuracy of QRS detection based on the above intuitive method is not high. Because the ECG
waveform may be disturbed by EMG, motion, noise and the baseline drift, leading to some QRS
waves far higher or lower than the baseline. It may not be judged on the threshold, or even be
covered by noise. In addition, the threshold changes by the changes of QRS complex according to
some arrhythmias such as ventricular premature beats occur. Therefore, it is needed to consider
improving the detection algorithm, so we need to add many programming methods and strategies.
The core element embodied in these methods and strategies is the basic knowledge of association.
8
2.2 ECG Signal Filters
ECG signal is very sensitive in nature, hence even a small noise such as muscle movements, mains
current and electromagnetic mixed with the original signal can cause a significant change in the final
result. The ECG signal voltage usually ranges from 0.5-5mV and artefacts lager than that can cause
a change in the signal. Data corrupted with noise must either filter or discarded.
The main types of artefact in ECG signal are Power line interference, Muscle contractions, Electrode
contact noise, Motion Artefacts, Baseline wandering, Noise generated by electronic devices used in
signal processing circuits, Electrical interference external to the subject and recording system, High-
frequency noises in the ECG, Breath, lung, or bowel sounds contaminating the heart sounds.
9
ECG signal is very sensitive in nature, hence even a small noise such as muscle movements, mains
current and electromagnetic mixed with the original signal can cause a significant change in the final
result. The ECG signal voltage usually ranges from 0.5-5mV and artefacts lager than that can cause
a change in the signal. Data corrupted with noise must either filter or discarded.
The main types of artefact in ECG signal are Power line interference, Muscle contractions, Electrode
contact noise, Motion Artefacts, Baseline wandering, Noise generated by electronic devices used in
signal processing circuits, Electrical interference external to the subject and recording system, High-
frequency noises in the ECG, Breath, lung, or bowel sounds contaminating the heart sounds.
9
Chapter 03: LITERATURE REVIEW
3.1 ECG Circuitry
3.1.1 ECG Amplifier
ECG signals usually ranges from microvolt to millivolt. Since the range is very small, the signals
measured should be amplified. Usually biopotential amplifiers are considered as they have high
input impedance as well as it is very safe. Since signals are drawn from living organisms safety is
important in order to prevent macro and micro shocks. To remove external load with minimum
distortion output impedance of the amplifier should be very low. Furthermore, the gain should be
large since the signal is small. High common mode rejection ratio should be there in order to
eliminate large offset signals. Most of the biopotential amplifiers are differential amplifiers as they
make sure that noise from the inputs are not amplified thus yielding a higher integrity signal.
However, differential amplifiers with such characters are hard to find. Therefore, combination of
differential amplifiers are constructed to form an instrumentational amplifier. There are two stages
of instrumentational amplifier that aids in meeting the requirements of the ideal biopotential
amplifier. The first stage is the input stage of the amplifier followed by the gain stage.
Figure 5 Input and gain stages of instrumentation amplifier
10
3.1 ECG Circuitry
3.1.1 ECG Amplifier
ECG signals usually ranges from microvolt to millivolt. Since the range is very small, the signals
measured should be amplified. Usually biopotential amplifiers are considered as they have high
input impedance as well as it is very safe. Since signals are drawn from living organisms safety is
important in order to prevent macro and micro shocks. To remove external load with minimum
distortion output impedance of the amplifier should be very low. Furthermore, the gain should be
large since the signal is small. High common mode rejection ratio should be there in order to
eliminate large offset signals. Most of the biopotential amplifiers are differential amplifiers as they
make sure that noise from the inputs are not amplified thus yielding a higher integrity signal.
However, differential amplifiers with such characters are hard to find. Therefore, combination of
differential amplifiers are constructed to form an instrumentational amplifier. There are two stages
of instrumentational amplifier that aids in meeting the requirements of the ideal biopotential
amplifier. The first stage is the input stage of the amplifier followed by the gain stage.
Figure 5 Input and gain stages of instrumentation amplifier
10
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
In the research done by G. Gargiulo (2010), for an ultra-high input impedance ECG amplifier for
long- term monitoring of athletes Burr–Brown INA116 amplifier is used because it has the highest
input impedance available which is 1015 Ω. It has a maximum input bias current of 3 fA and an input
current noise of 0.1 fA/√Hz. This circuit offers integrated active input shielding which is used to
shield the electrodes. Furthermore, it features built-in electrostatic discharge and overvoltage
protection. The printed circuit board must be laid out and constructed with care to take full
advantage. In conclusion this biopotential amplifier was successfully can be used in standard clinical
monitoring applications as well as unusual applications, such as monitoring of patients, sports
medicine etc.
Figure 6 Schematics of the biopotential amplifier INA116
According to U. Pradhan (2015), in designing of three lead ECG amplifier system, ECG amplifier
was constructed using IC LM386. The LM386 is a powerful amplifier which is used in low voltage
consumer applications. To keep the external part count low, gain was set to 20. Since the LM386 has
a higher gain it was necessary to bypass the unused inputs in order to prevent the degradation of gain
and possible instabilities. With this proposed design a noise free ECG system with low cost was
designed.
Figure 7 Circuit diagram of the ECG amplifier constructed using IC LM386
11
long- term monitoring of athletes Burr–Brown INA116 amplifier is used because it has the highest
input impedance available which is 1015 Ω. It has a maximum input bias current of 3 fA and an input
current noise of 0.1 fA/√Hz. This circuit offers integrated active input shielding which is used to
shield the electrodes. Furthermore, it features built-in electrostatic discharge and overvoltage
protection. The printed circuit board must be laid out and constructed with care to take full
advantage. In conclusion this biopotential amplifier was successfully can be used in standard clinical
monitoring applications as well as unusual applications, such as monitoring of patients, sports
medicine etc.
Figure 6 Schematics of the biopotential amplifier INA116
According to U. Pradhan (2015), in designing of three lead ECG amplifier system, ECG amplifier
was constructed using IC LM386. The LM386 is a powerful amplifier which is used in low voltage
consumer applications. To keep the external part count low, gain was set to 20. Since the LM386 has
a higher gain it was necessary to bypass the unused inputs in order to prevent the degradation of gain
and possible instabilities. With this proposed design a noise free ECG system with low cost was
designed.
Figure 7 Circuit diagram of the ECG amplifier constructed using IC LM386
11
3.1.2 Instrumentation Amplifier
An instrumentation amplifier is usually the very first stage in an instrumentation system. This is
because of the very small voltages usually received from the probes need to be amplified
significantly to the proceeding stages. An instrumentation amplifier (IA) is a difference amplifier
where the difference between the two input terminals is amplified and the common signals between
the inputs are rejected (Common Mode Rejection (CMR)).
Many industrial and medical applications use instrumentation amplifiers (INAs) to condition small
signals in the presence of large common-mode voltages and DC potentials so it choose Analog
instrumentation amplifier to amplify the ECG voltage from electrodes, which is in the range of 1mV
to 5mV.
3.1.3 Electrode
It converts physical signals into electrical voltage. The voltage is in the range of 1 mV ~ 5 mV. The
sensor pair is stuck on the right arm (RA), left arm (LA) and right leg (RL) of the subject. This
system uses the right leg of the patient as “driven right leg lead”. This involves a summing network
to obtain the sum of the voltages from all other electrodes and driving amplifier, the output of which
is connected to the right leg of the patient. This arrangement is known as Wilson electrode system.
The effect of this arrangement is to force the reference connection at the right leg of the patient to
assume a voltage level equal to the sum of the voltages at the other leads. This arrangement
increases the common mode rejection ratio of the overall system and reduces noise interference. It
also has the effect of reducing the current flow in to the right leg electrode.
3.1.4 Biosensors
According to 2011 IEEE Sensors Applications Symposium; Biosensors are devices comprising
biological element and a physiochemical detector that are used to detect analytes. These instruments
have a wide range of applications. The biosensors are based on the electrons movement. The
elements of the detector transform the signals from the interface of an analyte with the biochemical
elements into other signals like transducer and it can be measured more easily and qualified. The
biosensor devices are associated with the electronics and the signal processors and they are generally
responsible for the display of the results and they are user friendly. Biosensor research has a
significant role in the development of modern electronics.
12
An instrumentation amplifier is usually the very first stage in an instrumentation system. This is
because of the very small voltages usually received from the probes need to be amplified
significantly to the proceeding stages. An instrumentation amplifier (IA) is a difference amplifier
where the difference between the two input terminals is amplified and the common signals between
the inputs are rejected (Common Mode Rejection (CMR)).
Many industrial and medical applications use instrumentation amplifiers (INAs) to condition small
signals in the presence of large common-mode voltages and DC potentials so it choose Analog
instrumentation amplifier to amplify the ECG voltage from electrodes, which is in the range of 1mV
to 5mV.
3.1.3 Electrode
It converts physical signals into electrical voltage. The voltage is in the range of 1 mV ~ 5 mV. The
sensor pair is stuck on the right arm (RA), left arm (LA) and right leg (RL) of the subject. This
system uses the right leg of the patient as “driven right leg lead”. This involves a summing network
to obtain the sum of the voltages from all other electrodes and driving amplifier, the output of which
is connected to the right leg of the patient. This arrangement is known as Wilson electrode system.
The effect of this arrangement is to force the reference connection at the right leg of the patient to
assume a voltage level equal to the sum of the voltages at the other leads. This arrangement
increases the common mode rejection ratio of the overall system and reduces noise interference. It
also has the effect of reducing the current flow in to the right leg electrode.
3.1.4 Biosensors
According to 2011 IEEE Sensors Applications Symposium; Biosensors are devices comprising
biological element and a physiochemical detector that are used to detect analytes. These instruments
have a wide range of applications. The biosensors are based on the electrons movement. The
elements of the detector transform the signals from the interface of an analyte with the biochemical
elements into other signals like transducer and it can be measured more easily and qualified. The
biosensor devices are associated with the electronics and the signal processors and they are generally
responsible for the display of the results and they are user friendly. Biosensor research has a
significant role in the development of modern electronics.
12
3.1.5 Pulse Sensor SEN-11574
Pulse sensor is used to measure the heartbeat. The sensor is really small and perfect for reading
heartbeat across earlobe or on the fingertip. It is 0.625” in diameter and 0.125” thick from the round
PCB side.
3.1.6 ECG Filtering Techniques
3.1.7 A/D Conversion
3.1.8 Transmitter
3.2 Data Processing
3.2.1 Microcontrollers
According to Journal of Physics Conference Series 890(1):012095 · September 2017 ;a
microcontroller is a computer present in a single integrated circuit which is dedicated to perform one
task and execute one specific application. It contains memory, programmable input/output
peripherals as well a processor. In this section all the stages and components that has for presenting
to transmit and monitor the ECG signal by using serial transmission RS232 starting with how to
import the ECG signal files and ending to receive the signal serially, to display it and has included
converting and digitizing the ECG files to transmit.
3.3 Output
3.3.1 LCD
It is used to displaying the result on a text based LCD (Normal, Low, High).
13
Pulse sensor is used to measure the heartbeat. The sensor is really small and perfect for reading
heartbeat across earlobe or on the fingertip. It is 0.625” in diameter and 0.125” thick from the round
PCB side.
3.1.6 ECG Filtering Techniques
3.1.7 A/D Conversion
3.1.8 Transmitter
3.2 Data Processing
3.2.1 Microcontrollers
According to Journal of Physics Conference Series 890(1):012095 · September 2017 ;a
microcontroller is a computer present in a single integrated circuit which is dedicated to perform one
task and execute one specific application. It contains memory, programmable input/output
peripherals as well a processor. In this section all the stages and components that has for presenting
to transmit and monitor the ECG signal by using serial transmission RS232 starting with how to
import the ECG signal files and ending to receive the signal serially, to display it and has included
converting and digitizing the ECG files to transmit.
3.3 Output
3.3.1 LCD
It is used to displaying the result on a text based LCD (Normal, Low, High).
13
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
3.4 Emergency Alarm System
14
14
Chapter 04: METHODOLOGY
According to the National Heart, Lung, and Blood Institute, Disease and Condition Index in 2003,
abnormal ECG waveforms are mostly obtained from patients above 55 years old. Therefor senior
citizens are prone to heart attack. The multi healthcare Walking Stick with Heart Attack Detection is
specially designed for senior citizens who are using a walking stick and the has a possibility of heart
issues. The walking stick is used as detection unit and as the medium asking for medical help.
4.1 Overview of the design
Figure 1 Overview of the design
Two biosensors placed on the patient’s wrist detects the ECG signal and send it to the ECG circuity.
The ECG circuity will amplify and filter the analogue signal. This output will be then given to the
A/D converter to convert the analogue signal to digital signal. The digital signal is then transmitted
to the receiver in the walking stick. The receiver in the stick will send the digital ECG signal to the
microcontroller and it will run a heart attack algorithm and detect any heart abnormalities. If any
symptoms are detected and the threshold level is reached the emergency mode will be activated; the
patient and the caregiver will be informed.
The wireless connection between the ECG circuity unit and the main unit on the walking stick
allows the patient to move freely by avoiding wire attachment between the wrist and the stick.
15
According to the National Heart, Lung, and Blood Institute, Disease and Condition Index in 2003,
abnormal ECG waveforms are mostly obtained from patients above 55 years old. Therefor senior
citizens are prone to heart attack. The multi healthcare Walking Stick with Heart Attack Detection is
specially designed for senior citizens who are using a walking stick and the has a possibility of heart
issues. The walking stick is used as detection unit and as the medium asking for medical help.
4.1 Overview of the design
Figure 1 Overview of the design
Two biosensors placed on the patient’s wrist detects the ECG signal and send it to the ECG circuity.
The ECG circuity will amplify and filter the analogue signal. This output will be then given to the
A/D converter to convert the analogue signal to digital signal. The digital signal is then transmitted
to the receiver in the walking stick. The receiver in the stick will send the digital ECG signal to the
microcontroller and it will run a heart attack algorithm and detect any heart abnormalities. If any
symptoms are detected and the threshold level is reached the emergency mode will be activated; the
patient and the caregiver will be informed.
The wireless connection between the ECG circuity unit and the main unit on the walking stick
allows the patient to move freely by avoiding wire attachment between the wrist and the stick.
15
The project can be divided into 3 parts.
4.2 ECG Circuitry
Electrodes can be used as biosensors, since electrodes have good electrical contact with the skin.
Artefacts due to motions are low and has a strong adhesive quality to skin. The signals picked by the
biosensors which are usually 0.2-2 mV are being amplified by the ECG amplifier. Since ECG signal
voltage usually ranges from 0.5-5mV and artefacts lager than that can cause a change in the signal.
Data corrupted with noise must either filter or discarded. In order to filter these artefacts filters are
used. Then the analogue signal given by the ECG circuitry should be converted digital signal using
A/D converter. In order for the transmission of Digital signal RS232 is used since in PIC
microcontroller signal is digital, the same transceiver to transmit digital signal can be used.
16
1. ECG circuity on
the wrist
2. Microcontroller
based system
3. Emergency alarm
system
Biosensors FiltersECG amplifier
A/D converterTransmitter
4.2 ECG Circuitry
Electrodes can be used as biosensors, since electrodes have good electrical contact with the skin.
Artefacts due to motions are low and has a strong adhesive quality to skin. The signals picked by the
biosensors which are usually 0.2-2 mV are being amplified by the ECG amplifier. Since ECG signal
voltage usually ranges from 0.5-5mV and artefacts lager than that can cause a change in the signal.
Data corrupted with noise must either filter or discarded. In order to filter these artefacts filters are
used. Then the analogue signal given by the ECG circuitry should be converted digital signal using
A/D converter. In order for the transmission of Digital signal RS232 is used since in PIC
microcontroller signal is digital, the same transceiver to transmit digital signal can be used.
16
1. ECG circuity on
the wrist
2. Microcontroller
based system
3. Emergency alarm
system
Biosensors FiltersECG amplifier
A/D converterTransmitter
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
4.3 Device to embed Microcontroller
4.4 Microcontroller
The microcontroller is a computer control system on one chip. It has many electronic circuits that
can decode written instructions and convert them into electrical signals. The microcontroller will
then go through these instructions and follow them one at a time. List of these instructions given to
the microcontroller is called program.
Input signals - thermal sensors, inclinometer, pressure sensors
Output signals - beeper, Alarm, emergency light
4.5 Thermal Sensor
Two thermal sensors will be placed one in the centre of the stick and other in the handle. The
temperature difference will be calculated. The temperature deference will detect id the handle is held
or not.
4.6 Pressure Sensor
The pressure against the stick will be measure by the 4 sensors placed at the bottom of the stick.
4 sensors are pushed equally – Stick is at 90°
2 sensors have the same reading - Stick is at an angle
17
4.4 Microcontroller
The microcontroller is a computer control system on one chip. It has many electronic circuits that
can decode written instructions and convert them into electrical signals. The microcontroller will
then go through these instructions and follow them one at a time. List of these instructions given to
the microcontroller is called program.
Input signals - thermal sensors, inclinometer, pressure sensors
Output signals - beeper, Alarm, emergency light
4.5 Thermal Sensor
Two thermal sensors will be placed one in the centre of the stick and other in the handle. The
temperature difference will be calculated. The temperature deference will detect id the handle is held
or not.
4.6 Pressure Sensor
The pressure against the stick will be measure by the 4 sensors placed at the bottom of the stick.
4 sensors are pushed equally – Stick is at 90°
2 sensors have the same reading - Stick is at an angle
17
1 or 2 sensors reading is below the stick weight – It is leaned against something
Inclinometer is installed to the stick of the body. Tilt angle will measure if the stick is standing,
leaning or lying. LCD display be at the handle of the stick which will show the contact details of the
caregiver and the heartrate of the patient. If the user drops it by accident it will beep using the
beeper. Alarm will give an alarm if the patient is in danger.
4.7 Emergency alarm system
Bluetooth communication can be used to call the caregiver. Since it is wireless user can put the cell
phone within the range of the Bluetooth communication and it will call the caregiver if necessary.
4.8 Further Discussion on the Reviewed Project
18
Hear rate is normal
The beeper will go off
alarming the user to rest
Heart rate is slightly over
the normal range
No alarm
Heart rate is alarmingly
high
The alarm will go off and
the caregiver will be
alarmed
Inclinometer is installed to the stick of the body. Tilt angle will measure if the stick is standing,
leaning or lying. LCD display be at the handle of the stick which will show the contact details of the
caregiver and the heartrate of the patient. If the user drops it by accident it will beep using the
beeper. Alarm will give an alarm if the patient is in danger.
4.7 Emergency alarm system
Bluetooth communication can be used to call the caregiver. Since it is wireless user can put the cell
phone within the range of the Bluetooth communication and it will call the caregiver if necessary.
4.8 Further Discussion on the Reviewed Project
18
Hear rate is normal
The beeper will go off
alarming the user to rest
Heart rate is slightly over
the normal range
No alarm
Heart rate is alarmingly
high
The alarm will go off and
the caregiver will be
alarmed
Chapter 5: RESULTS
5.1. Simulation
Instrumental amplifier circuit diagram
19
5.1. Simulation
Instrumental amplifier circuit diagram
19
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Sample Statistics used
Rhythm Rate Duration
24 year old
Female
66 year
old Female
69 year old
Male
24 year
old
Female
66 year
old
Female
69 year
old
Male
Normal sinus rhythm 49-87 69-82 54-91 22:36 3:52 30.06
Paced rhythm --- 70-78 26:13
Ventricular bigeminy 55-103 --- 7:15 ---
Ventricular trigeminy 57-90 --- 0:13 ---
Ventricular
tachycardia
121 --- 0:02 ---
Beats Before 5:00 After 5:00 Total
Normal 271 65 1236 98 1507 163
APC --- --- 10 --- --- 86 --- --- 96
PVC 60 1 3 460 1 13 520 2 16
Paced --- 197 --- --- 1183 --- --- 1380 ---
Pacemaker fusion --- 104 --- 562 --- ---- 666 ---
Right BBB --- --- 349 --- --- 1817 --- ---- 2166
Blocked APC --- --- 3 --- --- 7 --- --- 10
Unclassifiable --- 5 --- --- 13 --- --- 18 ---
Total 331 372 365 1696 1857 1923 2027 2229 2288
Feature Duration (msec) Amplitude (mv)
PR Interval 180 120 160 --- ---
ST Interval 360 330 320 --- ---
QRS Complex 120 160 80 R=0.75,
S=-0.23
R=0.66
S=-0.62
R=0.5
S=-0.3
T Wave 163 157 160 0.4 0.32 0.06
P w=Wave 93 --- 120 0.27 --- 0.12
Medications Inderal Digoxin,
Pronestyl
Digoxin,
Norpace
The received signal of a 24 year female patient
20
Rhythm Rate Duration
24 year old
Female
66 year
old Female
69 year old
Male
24 year
old
Female
66 year
old
Female
69 year
old
Male
Normal sinus rhythm 49-87 69-82 54-91 22:36 3:52 30.06
Paced rhythm --- 70-78 26:13
Ventricular bigeminy 55-103 --- 7:15 ---
Ventricular trigeminy 57-90 --- 0:13 ---
Ventricular
tachycardia
121 --- 0:02 ---
Beats Before 5:00 After 5:00 Total
Normal 271 65 1236 98 1507 163
APC --- --- 10 --- --- 86 --- --- 96
PVC 60 1 3 460 1 13 520 2 16
Paced --- 197 --- --- 1183 --- --- 1380 ---
Pacemaker fusion --- 104 --- 562 --- ---- 666 ---
Right BBB --- --- 349 --- --- 1817 --- ---- 2166
Blocked APC --- --- 3 --- --- 7 --- --- 10
Unclassifiable --- 5 --- --- 13 --- --- 18 ---
Total 331 372 365 1696 1857 1923 2027 2229 2288
Feature Duration (msec) Amplitude (mv)
PR Interval 180 120 160 --- ---
ST Interval 360 330 320 --- ---
QRS Complex 120 160 80 R=0.75,
S=-0.23
R=0.66
S=-0.62
R=0.5
S=-0.3
T Wave 163 157 160 0.4 0.32 0.06
P w=Wave 93 --- 120 0.27 --- 0.12
Medications Inderal Digoxin,
Pronestyl
Digoxin,
Norpace
The received signal of a 24 year female patient
20
Figure 1: Showing the received signal of the 24-yo patient
The received signal of a 66 year female patient
Figure 1: Showing the received signal of the 66-yo patient
The received signal of a 69 year male patient
21
The received signal of a 66 year female patient
Figure 1: Showing the received signal of the 66-yo patient
The received signal of a 69 year male patient
21
Figure 1: Showing the received signal of the 69-yo patient
The received signal of a 62 year male patient
Figure 1: Showing the received signal of the 62-yo patient
The Matlab code of the graphs above
22
The received signal of a 62 year male patient
Figure 1: Showing the received signal of the 62-yo patient
The Matlab code of the graphs above
22
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Note: I used Matlab windowing functions
%This code takes an ecg signal filters it and gets the QRS complex
%locations. This uses thresholding and "findpeaks"
%Normal Parameters(in seconds) (approx.) (can verify with code
accordingly)
%QRS complex 0.06-0.1
%RR 0.6 - 1.2
%heart rate 60-100bpm (essential for sinus rhythm)
%PR interval 0.12 - 0.2
%QT interval less than 1/2 the RR interval
%RR, QT,QRS and PR intervals are found (mean)
%heart rate is computed
%in normal ECG signals, this code will give the correct peak locations and
%even handle certain cases. However under extremely abnormal cases, wrong
peaks get
%marked hence we can detect an abnormality since the intervals won't be in
range.
%Compiled and Maintained by
%Simon Ndoro
Baseline remover.
This is a DC notch filter to remove baseline noise from ECG signals for further analysis
%% logic
b = [1 -1];
a = [1 -0.9];
z = filter(b,a,sig);
end
Signal acquiring and pre-processing
ecg1=load('/Users/simonndoro/Desktop/Matlab_codes_all/MLII/1 NSR/100m
(3).mat');
end
fs = 360; %From database itself
ecg2 = extractfield(ecg1,'val');
[ecg1,d]= lowpass(ecg2,9/(fs/2)); %filtering (keep same) vary with dataset
ecg_f = baseline_remove(ecg1);
23
%This code takes an ecg signal filters it and gets the QRS complex
%locations. This uses thresholding and "findpeaks"
%Normal Parameters(in seconds) (approx.) (can verify with code
accordingly)
%QRS complex 0.06-0.1
%RR 0.6 - 1.2
%heart rate 60-100bpm (essential for sinus rhythm)
%PR interval 0.12 - 0.2
%QT interval less than 1/2 the RR interval
%RR, QT,QRS and PR intervals are found (mean)
%heart rate is computed
%in normal ECG signals, this code will give the correct peak locations and
%even handle certain cases. However under extremely abnormal cases, wrong
peaks get
%marked hence we can detect an abnormality since the intervals won't be in
range.
%Compiled and Maintained by
%Simon Ndoro
Baseline remover.
This is a DC notch filter to remove baseline noise from ECG signals for further analysis
%% logic
b = [1 -1];
a = [1 -0.9];
z = filter(b,a,sig);
end
Signal acquiring and pre-processing
ecg1=load('/Users/simonndoro/Desktop/Matlab_codes_all/MLII/1 NSR/100m
(3).mat');
end
fs = 360; %From database itself
ecg2 = extractfield(ecg1,'val');
[ecg1,d]= lowpass(ecg2,9/(fs/2)); %filtering (keep same) vary with dataset
ecg_f = baseline_remove(ecg1);
23
ecg_f = ecg_f(350:3400);
ecg_f = ecg_f./max(ecg_f); %normalization (VVVimp)
num_filt = d.Coefficients;
Extraction of R peaks for windowing purposes
[pks,locs_R] = findpeaks(ecg_f,'MinPeakHeight',0.4,'MinPeakDistance',90);
%R peaks
mean_RR = mean(diff(locs_R))/fs;
Window extraction
if length(locs_R)<=6
ecg_f = ecg_f.*1;
ecg_inv = -1.*ecg_f;
else
Number = 5;%peaks to consider (KEEP SAME) (keep standard) DO NOT
CHANGE LEAVE CONSTANT
wl = (round(mean_RR*fs))*Number;
idx = locs_R(round(length(locs_R)/2)) - round(wl/2); %this is done to
ensure that the ecg signal
%starts symmetrically about the R peak as often as possible
%so at center R peak, - 1/2 the window length so symmetry is
%assured.(VVVVVIMP)
ecg_f = ecg_f(bsxfun(@plus,idx,0:wl-1)); %extracted indexes
ecg_inv = -ecg_f;
end
Thresholding and peak finding
[pks3,locs_R2] =
findpeaks(ecg_f,'MinPeakHeight',0.4,'MinPeakDistance',90); %R peaks
[pks2,locs_S]
=findpeaks(ecg_inv,'MinPeakHeight',0.4,'MinPeakDistance',160); %S peaks
[~,min_locs] = findpeaks(ecg_inv,'MinPeakDistance',19); %Q peaks
locs_Q = min_locs(ecg_inv(min_locs)>0.12 & ecg_inv(min_locs)<0.3);
%threshold values keep same
%vary threshold with dataset/signal
[~,min_locs2] = findpeaks(ecg_f,'MinPeakDistance',22);
locs_PT = min_locs2(ecg_f(min_locs2)>0.03 & ecg_f(min_locs2)<0.4);
24
ecg_f = ecg_f./max(ecg_f); %normalization (VVVimp)
num_filt = d.Coefficients;
Extraction of R peaks for windowing purposes
[pks,locs_R] = findpeaks(ecg_f,'MinPeakHeight',0.4,'MinPeakDistance',90);
%R peaks
mean_RR = mean(diff(locs_R))/fs;
Window extraction
if length(locs_R)<=6
ecg_f = ecg_f.*1;
ecg_inv = -1.*ecg_f;
else
Number = 5;%peaks to consider (KEEP SAME) (keep standard) DO NOT
CHANGE LEAVE CONSTANT
wl = (round(mean_RR*fs))*Number;
idx = locs_R(round(length(locs_R)/2)) - round(wl/2); %this is done to
ensure that the ecg signal
%starts symmetrically about the R peak as often as possible
%so at center R peak, - 1/2 the window length so symmetry is
%assured.(VVVVVIMP)
ecg_f = ecg_f(bsxfun(@plus,idx,0:wl-1)); %extracted indexes
ecg_inv = -ecg_f;
end
Thresholding and peak finding
[pks3,locs_R2] =
findpeaks(ecg_f,'MinPeakHeight',0.4,'MinPeakDistance',90); %R peaks
[pks2,locs_S]
=findpeaks(ecg_inv,'MinPeakHeight',0.4,'MinPeakDistance',160); %S peaks
[~,min_locs] = findpeaks(ecg_inv,'MinPeakDistance',19); %Q peaks
locs_Q = min_locs(ecg_inv(min_locs)>0.12 & ecg_inv(min_locs)<0.3);
%threshold values keep same
%vary threshold with dataset/signal
[~,min_locs2] = findpeaks(ecg_f,'MinPeakDistance',22);
locs_PT = min_locs2(ecg_f(min_locs2)>0.03 & ecg_f(min_locs2)<0.4);
24
%threshold values keep same
%vary with dataset/signal
Since windowing is done P and T locations can be determined
if(isempty(locs_PT) ==0)
if (locs_PT(1) - locs_R2(1) <0 & locs_PT(2) - locs_R2(1) >0)
locs_P = locs_PT(1:2:end);
locs_T= locs_PT(2:2:end);
elseif (locs_PT(1) -locs_R2(1) <0 & locs_PT(2) - locs_R2(1) <0)
locs_P = locs_PT(2:2:end);
locs_T= locs_PT(1:2:end);
else
locs_P = locs_PT(2:2:end);
locs_T= locs_PT(1:2:end);
end
else
locs_P =[];
locs_T =[];
end
Eliminate noise / unwanted peak detection by using known parameters.
Note: We can never have a Q peak after S peak.
%It covers most cases. In case of a severe issue, the wrong peaks will be
%detected and hence the mean time period will vary.
if length(locs_S)>=length(locs_Q)
locs_S_check = locs_S(1:length(locs_Q));
check = any(locs_Q>locs_S_check);
if check ==1
locs_to_remove = find((locs_Q>locs_S_check)>0);
locs_Q([locs_to_remove]) =[];
end
end
Plots
%fvtool(d); %(If you want to see filter response)
figure(1);
hold on
plot(ecg_f,'linewidth',1.5);
plot(locs_R2,ecg_f(locs_R2),'rv','MarkerFaceColor','r');
25
%vary with dataset/signal
Since windowing is done P and T locations can be determined
if(isempty(locs_PT) ==0)
if (locs_PT(1) - locs_R2(1) <0 & locs_PT(2) - locs_R2(1) >0)
locs_P = locs_PT(1:2:end);
locs_T= locs_PT(2:2:end);
elseif (locs_PT(1) -locs_R2(1) <0 & locs_PT(2) - locs_R2(1) <0)
locs_P = locs_PT(2:2:end);
locs_T= locs_PT(1:2:end);
else
locs_P = locs_PT(2:2:end);
locs_T= locs_PT(1:2:end);
end
else
locs_P =[];
locs_T =[];
end
Eliminate noise / unwanted peak detection by using known parameters.
Note: We can never have a Q peak after S peak.
%It covers most cases. In case of a severe issue, the wrong peaks will be
%detected and hence the mean time period will vary.
if length(locs_S)>=length(locs_Q)
locs_S_check = locs_S(1:length(locs_Q));
check = any(locs_Q>locs_S_check);
if check ==1
locs_to_remove = find((locs_Q>locs_S_check)>0);
locs_Q([locs_to_remove]) =[];
end
end
Plots
%fvtool(d); %(If you want to see filter response)
figure(1);
hold on
plot(ecg_f,'linewidth',1.5);
plot(locs_R2,ecg_f(locs_R2),'rv','MarkerFaceColor','r');
25
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
plot(locs_Q,ecg_f(locs_Q),'rs','MarkerFaceColor','g');
plot(locs_S,ecg_f(locs_S),'o','MarkerFaceColor','y');
plot(locs_P,ecg_f(locs_P),'v','MarkerFaceColor','m');
plot(locs_T,ecg_f(locs_T),'s','MarkerFaceColor','k');
legend('ECG Signal','R peaks','Q Peaks','S Peaks','P peaks','T peaks');
hold off
title('QRS complex being marked on the fitered ECG signal along with the P
and T peaks');
xlabel('Samples');
ylabel('Normalised Amplitude');
figure(2);
subplot(2,1,1);
[BW,Flo,Fhi] = obw(ecg2,fs);
obw(ecg2,fs);
subplot(2,1,2);
[BW2,Flo2,Fhi2] = obw(ecg_f,fs);
obw(ecg_f,fs);
Time interval
%the below code computes all relevant time differences
% in case of any abnormility, length of the vector is adjusted to give a
% numerical answer
%we basically perform truncation.
QRS Complex period
QRS_period =[];
if length(locs_Q) > length(locs_S)
locs_Q1 = locs_Q(1:length(locs_S));
locs_S1 = locs_S;
else
locs_S1 = locs_S(1:length(locs_Q));
locs_Q1 = locs_Q;
end
for j = 1:max(length(locs_Q1),length(locs_S1))
QRS_period(j) = (locs_S1(j) - locs_Q1(j));
end
QRS_mean = mean(QRS_period)/fs;
if isnan(QRS_mean) ==1
26
plot(locs_S,ecg_f(locs_S),'o','MarkerFaceColor','y');
plot(locs_P,ecg_f(locs_P),'v','MarkerFaceColor','m');
plot(locs_T,ecg_f(locs_T),'s','MarkerFaceColor','k');
legend('ECG Signal','R peaks','Q Peaks','S Peaks','P peaks','T peaks');
hold off
title('QRS complex being marked on the fitered ECG signal along with the P
and T peaks');
xlabel('Samples');
ylabel('Normalised Amplitude');
figure(2);
subplot(2,1,1);
[BW,Flo,Fhi] = obw(ecg2,fs);
obw(ecg2,fs);
subplot(2,1,2);
[BW2,Flo2,Fhi2] = obw(ecg_f,fs);
obw(ecg_f,fs);
Time interval
%the below code computes all relevant time differences
% in case of any abnormility, length of the vector is adjusted to give a
% numerical answer
%we basically perform truncation.
QRS Complex period
QRS_period =[];
if length(locs_Q) > length(locs_S)
locs_Q1 = locs_Q(1:length(locs_S));
locs_S1 = locs_S;
else
locs_S1 = locs_S(1:length(locs_Q));
locs_Q1 = locs_Q;
end
for j = 1:max(length(locs_Q1),length(locs_S1))
QRS_period(j) = (locs_S1(j) - locs_Q1(j));
end
QRS_mean = mean(QRS_period)/fs;
if isnan(QRS_mean) ==1
26
QRS_mean = 0;
end
PR Interval
PR_interval =[];
temp =0;
if length(locs_R2) > length(locs_P)
locs_R3 = locs_R2(1:length(locs_P));
locs_P2 = locs_P;
temp =1;
else
locs_P2 = locs_P(1:length(locs_R2));
locs_R3 = locs_R2;
temp =1;
end
for k = 1 :max(length(locs_R3),length(locs_P2))
PR_interval(k) = locs_R3(k) - locs_P(k);
end
if temp ==0
mean_PR = mean(PR_interval)/fs;
elseif temp ==1
mean_PR = abs(mean(PR_interval))/fs;
end
if isnan(mean_PR) == 1
mean_PR = 0;
end
QT Interval
QT_interval = [];
if length(locs_Q) > length(locs_T)
locs_Q2 = locs_Q(1:length(locs_T));
locs_T2 = locs_T;
flag =1;
else
locs_T2 = locs_T(1:length(locs_Q));
locs_Q2 = locs_Q;
flag =1;
end
27
end
PR Interval
PR_interval =[];
temp =0;
if length(locs_R2) > length(locs_P)
locs_R3 = locs_R2(1:length(locs_P));
locs_P2 = locs_P;
temp =1;
else
locs_P2 = locs_P(1:length(locs_R2));
locs_R3 = locs_R2;
temp =1;
end
for k = 1 :max(length(locs_R3),length(locs_P2))
PR_interval(k) = locs_R3(k) - locs_P(k);
end
if temp ==0
mean_PR = mean(PR_interval)/fs;
elseif temp ==1
mean_PR = abs(mean(PR_interval))/fs;
end
if isnan(mean_PR) == 1
mean_PR = 0;
end
QT Interval
QT_interval = [];
if length(locs_Q) > length(locs_T)
locs_Q2 = locs_Q(1:length(locs_T));
locs_T2 = locs_T;
flag =1;
else
locs_T2 = locs_T(1:length(locs_Q));
locs_Q2 = locs_Q;
flag =1;
end
27
for k = 1 :max(length(locs_Q2),length(locs_T2))
QT_interval(k) = locs_T2(k) - locs_Q2(k);
end
if flag ==0
mean_QT = mean(QT_interval)/fs;
elseif flag == 1
mean_QT = abs(mean(QT_interval))/fs;
end
if isnan(mean_QT) ==1
mean_QT = 0;
end
Heart rate
%heart rate in bpm is computed using a single formula
bpm = round(60/mean_RR);
28
QT_interval(k) = locs_T2(k) - locs_Q2(k);
end
if flag ==0
mean_QT = mean(QT_interval)/fs;
elseif flag == 1
mean_QT = abs(mean(QT_interval))/fs;
end
if isnan(mean_QT) ==1
mean_QT = 0;
end
Heart rate
%heart rate in bpm is computed using a single formula
bpm = round(60/mean_RR);
28
1 out of 28
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.