Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1...

28
Physiological Signal Simulator Méabh Malone 09547771 Electrical & Electronic Engineering College of Engineering and Informatics, National University of Ireland, Galway FYP Project Supervisor Dr. John Breslin Submission Date: 19th December, 2012

Transcript of Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1...

Page 1: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator Méabh Malone 09547771 Electrical & Electronic Engineering College of Engineering and Informatics, National University of Ireland, Galway

FYP

Project Supervisor Dr. John Breslin Submission Date: 19th December, 2012

Page 2: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Abstract

Physiological signal simulators exist in medical training facilities to reproduce the physiological signals of

patients with different diseases. Such a system could potentially monitor heart-rate, blood pressure and

other physiological indicators. However, these systems are very expensive when sold commercially. The

aim of this project is to develop a multi-purpose physiological signal simulator which can be used for

research and development purposes at NUI, Galway. The development of such a system provides a

lower cost solution and will advance the development of iPhone and iPad medical applications at NUI,

Galway. It has the potential to communicate with devices such as phones and monitors to provide data

and results for medical research and technology development.

Page 3: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Table of Contents Abstract .......................................................................................................................................................... 2

Table of figures ............................................................................................... Error! Bookmark not defined.

Introduction ................................................................................................................................................... 5

1. Project Breakdown ................................................................................................................................. 7

1.1 Medical Research and Interview .................................................................................................... 7

1.1.1 Existing Medical Technology: Zigbee ............................................................................................ 7

1.1.2 Interview ....................................................................................................................................... 7

1.2 Physionet.............................................................................................................................................. 9

1.3 LabVIEW ............................................................................................................................................. 10

1.3.1 Advantages of LabVIEW .............................................................................................................. 10

2. Proposals for tackling project .............................................................................................................. 11

3. Progress to date ................................................................................................................................... 12

3.1 Concepts of the ECG .......................................................................................................................... 12

3.1.1 The Heart .................................................................................................................................... 12

3.1.2 ECG .............................................................................................................................................. 13

3.1.3 Sinus Rhythm .............................................................................................................................. 15

3.1.4 Analysis of P-QRS-T Complex ...................................................................................................... 15

3.2 Selecting Signals from Physionet ....................................................................................................... 19

3.3 Reproducing signals with LabVIEW .................................................................................................... 22

3.3.1 Initial LabVIEW Program ............................................................................................................. 22

3.4 UI Design ............................................................................................................................................ 23

3.5 Website .............................................................................................................................................. 27

4. Task List and Project Plan ..................................................................................................................... 27

5. Conclusion ............................................................................................................................................ 27

Bibliography ................................................................................................................................................. 28

References ................................................................................................................................................... 28

Page 4: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Table of Figures Figure 1 System Diagram .............................................................................................................................. 7

Figure 2 Heart Chambers ............................................................................................................................ 13

Figure 3 Depolarisation of myocyte cells .................................................................................................... 14

Figure 4 Contraction of the myocardium as depolarisation wave moves through heart ........................... 14

Figure 5 Depolarisation and repolarisation wave ....................................................................................... 14

Figure 6 the sinus node ............................................................................................................................... 15

Figure 7 P-QRS-T Complex .......................................................................................................................... 15

Figure 8 the P Wave .................................................................................................................................... 16

Figure 9 QRS Complex ................................................................................................................................. 17

Figure 10 ST Segment.................................................................................................................................. 17

Figure 11 T Wave ........................................................................................................................................ 18

Figure 12 Regions of the heartbeat ............................................................................................................ 19

Figure 13 Screenshot of Normal Sinus Rhythm on Physionet .................................................................... 21

Figure 14 Screenshot of Loop with Delay Block Diagram ........................................................................... 22

Figure 15 Screenshot of Front panel ........................................................................................................... 22

Figure 16 User Interface Design Idea .......................................................................................................... 23

Figure 17 Flowchart of State Machine so far .............................................................................................. 24

Figure 18 Screenshot of "Idle" state Block Diagram ................................................................................... 25

Figure 19 Screenshot of "Load signal" state Block Diagram ....................................................................... 25

Figure 20 Screenshot of "Update graph" state Block Diagram ................................................................... 26

Figure 21 Screenshot of Front Panel UI so far with plot of Arrhythmia samples ....................................... 26

Page 5: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Introduction

Simulation is the imitation of the conditions of a situation, or the representation of the behaviour or

characteristics of one system through the use of another system, called a simulator. Simulators are

designed to reproduce the operations of a complex system and are especially used to produce a

computer model of the process. Simulation can be performed using a hardware model or by running a

software program or through a combination of both.

Simulators are used in training and education as well as to design or develop computer models of

natural and human systems to analyse past events and predict future ones. In communication and

computer network research network simulators are used to predict the behavior of a computer network

by modeling it with different devices and levels of traffic. Performance and efficiency can be then be

analysed and decisions made based on the results. Simulation programmes based on differential

equations can produce mathematical models to predict future events and behaviours such as expected

population growth, global warming, stock rise and fall etc. The use of simulation technology in sports is

having a major impact in optimising the performance of individual athletes and improving the

development of many team sports. A main application of simulators is in the training of a wide range of

professionals for jobs in which real-world training would prove too dangerous and/or costly and many of

which would have to take place in extreme working environments which are almost impossible to

reproduce on an ongoing basis. Both the Military and Marine core recruit and train soldiers using war

simulated environments constructed as video games. Simulators’ are used by Airline pilots in flight

simulation training and by Surgeons and medical professionals to simulate situations and practice

procedures in the hope of reducing error.

The use of simulation technology is vital to the advancement of the world of medicine. Continuous

advancements in technology have resulted in the development of new and better methods for the

teaching and practicing of medicine. One of the key innovations in the field of health care is the use of

medical simulation. The future of medical training relies on this visual - based learning tool. Medical

simulation is a branch of simulation technology involved in education and training across various

medical fields. It combines health care professionals and physicians with industry professionals such as

computer scientists, researchers, educators and engineers. It can involve simulation of human patients

and their physiological signals, educational documents, casualty assessment, military situations and

emergency response.

Page 6: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

The use of simulators adds a new dimension to the world of medical training and has many advantages.

Its main purpose in the training of medical professionals is to reduce accidents and percentage error

during surgery, prescription, and general practice. It allows physicians to practice procedures as many

times as they need to without putting the patient at risk.

It puts the student in critical scenarios in which a rapid response is needed. If it was a real-life situation

with a real patient a senior doctor would step in and make the decision but the use of a simulation

environment means errors can be made and allowed to reach their conclusion. The student doctors’ can

then see the results of their decisions and actions. It also allows the educator to control the training

environment and the simulation speed can be varied or stopped to allow for better learning. This new

technology can move medicine from the old method of seeing a procedure once then performing it, to a

new method of seeing it once, practicing it many times, then performing it. Decreasing the percentage

error and increasing percentage of success.

A physiological signal simulator is a system that reproduces and simulates physiological signals (e.g. ECG,

RR, EEG, accelerometer, blood pressure, respiration etc.). They are extremely useful to reproduce the

physiological signals of a patient with different disease characteristics. Such a system could potentially

monitor heart-rate, blood pressure and other physiological indicators. The signals are downloaded from

a database on a website, this allows the doctor to analyse the signals of a “virtual” patient and

eliminates the need of an actual patient to be present when gathering signals.

Physiological simulators exist in medical training facilities and are excellent visual learning tools to assist

trainee medical professionals. However these systems are very expensive when sold commercially. It is

not only medical professionals who need to use these systems.

At the moment there are a number of engineers, researchers, educators and PHD students in NUI,

Galway working on projects involving the simulation and analysis of physiological signals. New software

programs and smart phone applications are being developed in NUI, Galway, many of which need to

simulate physiological signals for patients with specific cardiac profiles (e.g. heart failure NYHA class III,

arrhythmia, etc) as part of the development. But due to the lack of time of the PHD students and

researchers, the quality of the simulated signals used in the development of these applications is poor.

Therefore, a system which could simulate, analyse and provide feedback on physiological signals could

potentially make a significant difference to the research and development of new medical applications

and technology at NUI, Galway.

Page 7: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

1. Project Breakdown

Figure 1 System Diagram

1.1 Medical Research and Interview

1.1.1 Existing Medical Technology: Zigbee

Currently the medical device industry uses a wireless communication network called Zigbee to connect

different devices together.

Zigbee technology is the main existing communication technology used in monitoring the physiological

signals of patients. It is a low-cost, low-power, wireless mesh network that addresses the

communication needs of sensor and control networks in a wide range of markets including commercial,

residential, energy, consumer, health and industrial sectors. Zigbee wirelessly enables medical devices

such as vital sign monitors, physiological signal simulators, ventilators and infusion pumps to collect and

store data centrally. The software is designed to be easy to develop on small, inexpensive

microprocessors.

It operates on the ISM (industrial, scientific and medical) radio band width of 868 MHz in Europe and

915MHz in the United States. The data transmission rate varies from 20 – 900 kbps. The disadvantages

of using Zigbee include its low-transmission rate, and also it can only connect and transmit data

between devices over a small distance.

1.1.2 Interview

I hope to gain a professional insight into the practical, everyday use of this system, to gain feedback on

my project and to see if there is potential to improve the development of such systems in the future. I

Page 8: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

also want to find out what existing medical technologies are used in different fields of the Irish

Healthcare system. As part of my research I conducted an interview with Orthopaedic surgeon at

Cappagh and Blanchardstown hospitals and lecturer at the College of Surgeons, Dr. Paddy Kenny. I hope

to find out if these types of simulators are used in his area of medicine and are they used as training

tools in Irish Universities, and if not why not. I hope to study and use their feedback, real-life experience

and perspective to get the most out of my project and develop the system to best suit their needs. I am

also interested in hearing their opinion on the use of iPhone and iPad apps in medicine.

1. Have you used a physiological signal simulator system? What do you think of the use of these simulator

systems in medicine?

I have no experience of physiological signal simulator systems. Surgical simulators are in widespread use

as a teaching tool for learning to do operations and are a good form of education but do not replace or

replicate the live surgical situation.

2. What types of simulators are used in the field of surgery? (surgery, pediatrics)

Computer based simulators as well as physical models are used for simulation. We also do cadaveric

work for teaching.

3. Do you use Zigbee, or any other medical technology system, or have you heard of it?

I have not heard of Zigbee. We use Traumacad and NIMIS which are radiology systems. We use various

programmes for data collection.

4. What improvements if any could be made to the current simulator systems used by surgeons?

I don't know enough about them to answer this question

5. Are physiological signal simulators currently used as a training tool for medical students in Ireland?

I don't know

6. Do you think they are a good idea and offer benefits to trainee doctors (allowing them to practice

procedures as many times as they need to without putting the patient at risk)?

I think that they are an excellent idea as a training tool.

7. Do you think the use of a physiological signal simulator system such as my project can reduce accidents

and percentage error during surgery, prescription, and general practice?

I think that this type of system would make it easier to teach junior doctors how to do operations, as

they will have a better idea of what to expect when they come to operate on a patient. I think that it will

possibly shorten the amount of time that a junior doctor needs to spend in training. Currently an

orthopaedic surgeon does at least 9(most do 11-13) years training after leaving medical school before

Page 9: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

they can qualify to be a consultant. Our trainees are very well supervised by a senior surgeon when

learning operations and therefore I am not sure that errors would or can be reduced.

8. Is there anything you think I could add to the system in the future to improve it/ offer more benefits to

doctors?

The introduction of simulators which can be accessed easily and at minimal cost would be a great step

forward.

9. Do you or your colleagues use iPhone/smart phone apps for surgery/medicine? What apps do you use?

I use apps for data collection; I have text books and surgery manuals on my phone. We have the ability

to view x-rays, scans etc remotely.

10. Are medical apps for iPad/iPhone becoming part of the everyday life of a surgeon?

Yes. More and more all the time.

11. Would a smart phone app that could show these signals and data be used by surgeons?

Yes. But ease of access and reliability of the data displayed would be essential.

12 What field of medicine do you think we should aim this app at?

It sounds to me that this app would be ideally suited to cardiology, respiratory or renal medicine for

everyday practical use and for surgical training.

1.2 Physionet Physionet is a database which stores large collections of physiological signals. It includes software that

can be used to analyse these signals, as well as collections of research papers, reference material and

tutorials relating to the signals and software. Physionet receives its data and software from researchers

worldwide. Many of the contributors are clinical and medical researchers, but also from physicists,

mathematicians, computer scientists, educators and students. All signals have been annotated by at

least two cardiologists making the data very reliable and excellent for research, analysis and learning

purposes.

Since physiological signals display astonishing diversity, it is impossible to analyse and categorise signals

from just studying a small number of them. In order to gain an accurate insight into the characteristics of

these signals and what causes certain changes in them we need to study hundreds of them. It is difficult

and expensive to collect and study this large amount of data and requires software which is flexible,

efficient and modifiable to match the research requirements. Physionet provides a solution. This readily

available data and software will assist and increase the speed of my medical research and will allow me

to gain a better understanding of ECG signals. It will increase the accuracy and quality of my data.

Page 10: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

1.3 LabVIEW LabVIEW is a graphical programming environment for developing custom applications that interact with

real-world signals in the field of science and engineering. It allows the user to create measurement, test

and control systems using graphical icons and wires. Because LabVIEW programming model is very

similar to standard flowchart notation, it is extremely intuitive and easy to learn. It offers unparalleled

integration with thousands of hardware devices and makes a wide variety of libraries and data analysis

tools available in a single environment.

1.3.1 Advantages of LabVIEW

Faster Development

The intuitive drag and drop graphical functions and interconnecting wires allow the user to program

faster compared to writing lines and lines of code. The flowchart-like model makes it is easy to develop

and maintain code, spot bugs and errors and understand the flow of control.

Integrated Hardware

LabVIEW has built in compatibility with thousands of hardware libraries including signal conditioning,

data and image acquisition and motion control.

Powerful Analysis

LabVIEW features powerful analysis libraries complete with statistics, evaluations, regressions, linear

algebra, signal generation algorithms, time and frequency-domain algorithms and digital filters.

User Interface – Draw Your Own Solution

LabVIEW provides an easy-to-use development environment that allows the user to draw user interfaces

by choosing from hundreds of drag and drop controls. The user can interactively control the system data

and visualise results using graphs and 3D visualisation tools. You can write a program and then rapidly

prototype, design, and modify it in a short amount of time. LabVIEW allows you to develop a complete

solution within one environment. This solution is ideal for my project as it can be modified to include

features such as creating “virtual” patient profiles, dynamic real-time analysis of their vital signals,

comparison of past and current results and report generation for forming a diagnosis.

Page 11: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

2. Proposals for tackling project

Page 12: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

3. Progress to date

3.1 Concepts of the ECG

I spent time researching and studying the ECG signal before I began any coding. I think it is important to

understand exactly what is happening in the signal in order to develop a system to analyse it. I learned

about what each wave and interval in the ECG corresponds to in the human body and made a

connection between the electrical pulse and the mechanical action of the heart. I stepped through the

cycle of a heart beat and gained a good understanding of how to analyse an ECG signal. I compared a

healthy sinus rhythm to diseased rhythms. I studied a number of different cardiac diseases and how

these affect the characteristics of the ECG. For research purposes I talked to two medical professionals

and interviewed a surgeon to gain medical knowledge and to see the importance of ECG analysis from

the perspective of a doctor.

3.1.1 The Heart

The heart is the organ that supplies blood and oxygen to all parts of the body. It is divided into two

halves by a muscular like wall called the septum. The halves are in turn divided into chambers. The

upper two chambers of the heart are called atria and the lower two chambers are called ventricles. The

atria receive blood returning to the heart from the body and the ventricles pump blood from the heart

to the body. The heart is made up of cardiac muscle which enables it to contract and allows the

synchronization of the heart beat. The heart wall is divided into three layers: the epicardium,

myocardium, and endocardium. I am only concerned with the myocardium, which is the middle

muscular layer of the heart. It has heart muscle cells called myocytes. When the myocardium is

stimulated it electrically contracts. The signals corresponding to these electrical contractions are

recorded on the ECG.

Page 13: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Figure 2 Heart Chambers

3.1.2 ECG

The electrocardiogram (ECG) records the electrical activity of the heart, providing a record of cardiac

electrical activity, as well as valuable information about the heart’s functions and structure. Most of the

information on the ECG represents electrical activity of contraction of the hearts muscle

(“myocardium”). The ECG also produces valuable information about the heart’s rate and rhythm. ECG’s

record the electrical heart activity using skin sensors called electrodes. While in resting state the

myocytes (muscle cells) are polarised negatively.

When myocytes are depolarised they become positively charged and contract. Depolarisation moves as

a wave of positive charges through the heart muscle and causes progressive contraction. This cell-to-cell

conduction of depolarisation is carried by fast moving Na+ ions. When this wave of positive charges

(Na+ions) moves toward a positive electrode there is a simultaneous positive upward deflection

recorded on the ECG.

Page 14: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Figure 3 Depolarisation of myocyte cells

Figure 4 Contraction of the myocardium as depolarisation wave moves through heart

Repolarisation is the recovery phase after depolarisation that brings the myocyte cells back to their

resting negative charge. It is an electrical phenomenon that begins immediately after depolarisation.

Figure 5 Depolarisation and repolarisation wave

Depolarisation Repolarisation

Page 15: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

3.1.3 Sinus Rhythm

The heart’s dominant pacemaker, the SA node, initiates a wave of depolarisation (Na + ions) that

spreads outwards from the upper right atrium. The enlarging, circular depolarisation wave flows away

from the SA node in all directions and stimulates the atria to contract as it advances. The ability of the

SA node to generate pace making ability is called automaticity. The simultaneous contraction of the

atria forces blood through the Atrio-Ventricular (AV) valves. The AV valves prevent the backflow of

blood; the AV node shown in diagram below is the only conducting path between the atria and

ventricles.

Figure 6 the sinus node

3.1.4 Analysis of P-QRS-T Complex

The heartbeat signal is made up of five points – P, Q, R, S and T.

Figure 7 P-QRS-T Complex

The P- Wave

Page 16: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Each depolarization wave emitted by the SA node spreads through both atria and produces a positive P

wave on the EKG. Therefore the P wave represents the depolarisation of both atria and hence the

simultaneous contraction of the atria on the ECG.

When the atrial depolarization wave enters the AV node, depolarization slows down producing a brief

pause or delay, allowing time for the blood in the atria to enter the ventricles. This pause is seen on the

ECG.

Figure 8 the P Wave

QRS Complex

Depolarization conducts slowly through the AV node as the charge carriers are slow moving Ca+ ions,

however depolarization rapidly shoots up through the ventricular conduction system beginning in the

His Bundle. This is because the His Bundles and both bundle branches are bundles of Purkinje fibers that

use fast moving Na+ ions for conduction of depolarization. Rapid depolarization continues through the

His Bundle and the Bundle branches. The terminal filaments of the Purkinje fibers depolarize the

ventricular heart muscle. This quickly distributes the positive charge to the ventricular muscle cells. The

depolarization of the ventricular heart muscle causes the ventricles to contract and this corresponds to

the QRS complex on the ECG. The Q wave is the first downward deflection of the complex. The

downward Q wave is followed by an upward R wave. The upward R wave is followed by a downward S

wave.

pause

Page 17: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Figure 9 QRS Complex

ST Segment

The horizontal flat segment of the baseline following the QRS complex is the ST segment. If the ST

segment is elevated above or below the normal baseline it is usually a sign of imminent problems. The

ST segment represents the initial phase of ventricular repolarisation. J is the point of deflection between

S wave and the ST segment.

Figure 10 ST Segment

T Wave

The T wave represents the final “rapid” phase of ventricular repolarisation. Ventricular repolarisation

occurs quickly and effectively here so that the ventricular muscle cells can recover their resting negative

charge. Hence depolarization can begin again and the cardiac cycle continues. Repolarisation is

accomplished by potassium K+ ions leaving the muscle cells.

Page 18: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Figure 11 T Wave

QT interval

The QT interval represents the duration of ventricular contraction and is measured from the start of the

Q wave to the end of the T wave. It is a good indicator of repolarisation and varies with heart rate. The

QT interval is considered normal when it is less than half of the R-to-R interval at normal rates.

Summary

Wave Electrical Activity Physiological Heart Activity

P Atrial depolarization Atria contract

Pause/Delay Conduction delay Blood flow from atria to ventricles

QRS Ventricular depolarization Ventricles contract

ST interval Isoelectric Ventricle segment Initial repolarisation of ventricles

T Ventricular repolarisation Rapid repolarisation of ventricles

Q-T interval Complete ventricular

depolarisation and

repolarisation

Duration for full ventricular

contraction

Page 19: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Figure 12 Regions of the heartbeat

3.2 Selecting Signals from Physionet

I became familiar with the Physionet database and learned how to read information from the files,

select and download ECG signals, convert them to a format which could be read by a LabVIEW program

and then saved hard copies of appropriate formatted files to folders on my laptop. The physiological

signals I used are located in Physiobank.

PhysioBank is an archive with characterised digital recordings of physiological signals and related data

which is used by the biomedical research industry. PhysioBank contains biomedical signals from healthy

and unhealthy subjects, with a variety of conditions.

Each PhysioBank database can contain more than one record, and each recording might have three files:

1. Header file (*.hea file) - a short text file that describes the signals using ID number or URL of the

file, storage format, number of channels, sampling frequency, total number of samples,

calibration data, digitiser characteristics, record duration and starting time.

2. Annotation file - description of features of the signals

3. Binary (*.dat) – file containing digitised samples of signals

Page 20: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

The file I used for information was the header file. It was important for me to record the sampling

frequency and bit resolution of the files I saved as these are important parameters when reproducing

the signals with LabVIEW. I also needed to format the files and save them so that they were readable by

LabVIEW. I decided to write/read from a text file. I converted selected ECG signals from .DAT format on

Physionet to CSV format then edited the rows/columns so that the only information saved was the wave

amplitude (mV) and time (ms), as this is the only data needed to plot a waveform graph.

I used the following path to select and edit ECG signals from Physionet:

Physiobank -> Physionet ATM -> ECG -> Select signal -> Edit/Save to CSV -> Format Rows/Columns ->

Save as text file

I studied a number of ECG signals on Physionet before downloading them, including both healthy and

unhealthy rhythms. Cardiac disease characteristics I looked at include:

Atrial Fibrillation

Sleep Apnea

Congestive Heart Failure

Cardiac Arrest

Arrhythmias – Ventricular Tachycardia

Ventricular Fibrillation

Page 21: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Figure 13 Screenshot of Normal Sinus Rhythm on Physionet

Page 22: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

3.3 Reproducing signals with LabVIEW

3.3.1 Initial LabVIEW Program

Initially I wrote a program on LabVIEW to reproduce the downloaded ECG file using the sampling

frequency. I needed to include a time delay between when each pulse is plotted. The time delay needs

to be a factor of an incoming parameter. I used the following formula to calculate the time delay:

½*fsamp = delay

The first program I wrote reads the data from file and writes it to the waveform graph with a delay.

Figure 14 Screenshot of Loop with Delay Block Diagram

Figure 15 Screenshot of Front panel

Page 23: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

3.4 UI Design I am currently in the process of developing and improving my LabVIEW User Interface. I hope the end

product to be intuitive and user friendly, and to offer many analysis options.

Figure 16 User Interface Design Idea

To help design the backbone of my UI I have decided to use a state machine. A state machine will allow

different user actions or selections to determine the next state of the state machine, where each state

will be a processing segment. I downloaded the JKI State Machine for LabVIEW, a powerful String based

queue state machine template. The state machine is a case structure inside a while loop. It has a core

event handler which is the “Idle” frame of the case structure. The event handler has a timeout frame set

as minus 1 which means it will never execute. The states are executed by wiring in a String of states. It

has a number of initialise states that are called when the program starts to initialise data and the VI. It

then waits in the “Idle” state until the user performs an action. I drew a flow chart of the first few states

of my state machine; I will be adding more states and developing it in the coming weeks.

Page 24: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Figure 17 Flowchart of State Machine so far

I incorporated my earlier code to read data from file and created a “Load signal” state. This means the

machine remains idle until the “Load” button is pressed by the user, and then the user is asked to select

the file they want to read data from. I also created an “Update graph” state. When the data is read from

file the next state updates the waveform graph. I also have a “Stop” state which executes when the user

presses the “Ok” button. This clears the graph and stops the program running. Since the state machine

operates as a Queue I ensured I added my states in the correct FIFO order. The next step is to create an

“Add signal” state so that the user can add another signal to the same graph for comparison and

analysis. I hope to also add a zoom button so that the user can manipulate the graph and zoom in on

different regions of the wave based on the disease characteristics. I am currently working on these

features.

Page 25: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Figure 18 Screenshot of "Idle" state Block Diagram

Figure 19 Screenshot of "Load signal" state Block Diagram

Page 26: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Figure 20 Screenshot of "Update graph" state Block Diagram

Figure 21 Screenshot of Front Panel UI so far with plot of Arrhythmia samples

Page 27: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

3.5 Website A website is available at http://meabhmalonefyp.wordpress.com

It contains back ground of my project, milestones on which my FYP will be graded and documentation of

my progress to date.

4. Task List and Project Plan

Develop LabVIEW UI to allow manipulation and selection of signals

Research existing simulators- software versus hardware

Output signals to Bluetooth port or hardware amplifier

Package of complete software/hardware system

Testing of system

Identification of limits

5. Conclusion

In conclusion I am very interested in the possible applications of a physiological signal simulator system

such as this one, for both medical training and technology advancement purposes. I have a keen interest

in medicine and how the body works and have gained knowledge in this area. The main objective now

is to improve the UI to include more analysis options for the manipulation of signals. The aim is for the

simulator system to be low cost, user friendly, intuitive and to simulate, analyse and provide feedback

on physiological signals. Currently my system can meet all of these aims at a low level. As I improve the

system and adapt it to include Bluetooth or a monitor, I hope that it could potentially help advance the

research and development of new medical applications and technology at NUI, Galway.

Page 28: Physiological Signal Simulator Signal Simulator FYP 1. Project Breakdown Figure 1 System Diagram 1.1 Medical Research and Interview 1.1.1 Existing Medical Technology: Zigbee Currently

Physiological Signal Simulator FYP

Bibliography

http://biology.about.com/od/anatomy/a/theheart.htm

http://www.google.ie/imgres?q=the+heart+chambers&hl=en&sa=X&biw=713&bih=932&tbm=isch&prm

d=imvns&tbnid=hUO3hlsVbY8FXM:&imgrefurl=http://washingtonhra.com/2.html&docid=PuccQhanbLZ

ZtM&imgurl=http://washingtonhra.com/resources/Heart%252Banatomy.png&w=342&h=500&ei=0FuN

UK7_FoWDhQeyk4GgBQ&zoom=1&iact=hc&vpx=536&vpy=259&dur=10223&hovh=272&hovw=186&tx

=164&ty=178&sig=112541250704356799777&page=1&tbnh=147&tbnw=100&start=0&ndsp=33&ved=1

t:429,r:9,s:0,i:93

http://amazinghumanbody-prakash.blogspot.ie/2011/06/electrocardiography-ii-basic.html

http://hyperphysics.phy-astr.gsu.edu/hbase/biology/imgbio/ecg.gif

http://thediagram.com/5_5/progressivewave.jpg

http://paramedicine101.com/files/2011/01/ECG-P-wave-1024x556.jpg

http://www.google.ie/imgres?q=sinus+node+and+p+wave&hl=en&biw=1400&bih=959&tbm=isch&tbni

d=L9fSg221pGU1hM:&imgrefurl=http://www.meditech.cn/meditech-edu/ecg-

1.asp&docid=zJy1PmmlzTDcNM&imgurl=http://www.meditech.cn/images/ecg-

info/figure2.jpg&w=1114&h=836&ei=RkWNUI3DA42yhAfZu4GwAQ&zoom=1&iact=hc&vpx=474&vpy=4

46&dur=274&hovh=194&hovw=259&tx=164&ty=103&sig=112541250704356799777&page=1&tbnh=13

9&tbnw=186&start=0&ndsp=26&ved=1t:429,r:16,s:0,i:111

http://www.physik.uni-freiburg.de/~severin/ECG_QRS_Detection.pdf

http://www.physionet.org/faq.shtml#physionet-what

http://www.ni.com/white-paper/6349/en

References

[1] Dale Dublin, MD, 2000: Rapid Interpretation of EKG’s, 6th Edition

[2] John R. Hampton, 1992: The ECG In Practice, 2nd Edition