mi esposa Jessica Velázquez Valdéz cuyo amor, comprensión y paciencia le debo esto y más. ...... Atlas fotográfico de anatomÃa cardiaca, Barcelona: Ediciones ...
CENTRO DE INVESTIGACION Y DE ESTUDIOS AVANZADOS DEL INSTITUTO POLITECNICO NACIONAL
ELECTRICAL ENGINEERING DEPARTMENT BIOELECTRONICS SECTION
Development of an algorithm for the automatic measurement of the QT interval based on LabVIEW®
Thesis presented by
Jose Guadalupe Mercado Rojas
To receive the Grade of
Master’s Degree
In Electrical Engineering
Specialty
Thesis Director: Dr. Carlos Alvarado Serrano
Mexico, D.F.
January 2013
CENTRO DE INVESTIGACIÓN Y DE ESTUDIOS AVANZADOS DEL INSTITUTO POLITÉCNICO NACIONAL
DEPARTAMENTO DE INGENIERÍA ELÉCTRICA SECCIÓN DE BIOELECTRÓNICA
Desarrollo de un algoritmo para la medición automática del intervalo QT basado en LabVIEW®
Tesis que presenta
José Guadalupe Mercado Rojas
para obtener el Grado de
Maestro en Ciencias
en la Especialidad de
Ingeniería Eléctrica
Director de la Tesis: Dr. Carlos Alvarado Serrano
México, D.F.
Enero 2013
Resumen Actualmente en México, las enfermedades cardiovasculares son una de las principales causas de muerte debido a diversos factores, por lo que el uso de técnicas no invasivas como la electrocardiografía son una herramienta útil para el diagnóstico y tratamiento oportuno en pacientes cardiacos. Los intervalos de tiempo del electrocardiograma (ECG) son importantes en el diagnóstico electrocardiográfico porque reflejan procesos electrofisiológicos del corazón. Un parámetro electrocardiográfico importante que cuantifica la duración de la despolarización y repolarización ventricular es el intervalo QT ya que su prolongación anormal y el incremento en su dispersión están asociados con un alto riesgo de arritmias ventriculares y muerte cardiaca súbita en varias condiciones clínicas.
El objetivo de esta tesis es el desarrollo de un algoritmo para la medición automática del intervalo QT basado en LabVIEW® utilizando la transformada wavelet. La metodología fue implementar algoritmos utilizados en otras plataformas en LabVIEW® e integrarlos en una interfaz humana amigable para propósitos clínicos. El algoritmo desarrollado detecta inicialmente el complejo QRS y posteriormente el inicio del complejo QRS y el final y pico de la onda T.
La evaluación del desempeño del algoritmo de detección del complejo QRS fue hecha en 8 registros de la base de datos del MITBIH, su precisión fue de 99.56%. La evaluación del algoritmo de detección de inicio del complejo QRS y del pico y final de la onda T fue hecha en 15 registros de la base de datos QT. Su validación se realizó mediante el promedio (m) y la desviación estándar (sd) de las diferencias entre las medidas del cardiólogo en la base de datos QT y las medidas automáticas del algoritmo desarrollado en cada registro.
Los resultados obtenidos fueron: para el inicio del complejo QRS: 9.05±5.37 ms, para el pico de la onda T: 7.76±5.29 ms y para el final de la onda T: 9.24±6.06 ms. Estos resultados están dentro de los límites de tolerancia para desviaciones con respecto a las medidas manuales determinadas por los expertos. Por lo tanto, se puede concluir que la contribución de este trabajo, por su interfaz y desempeño alcanzado, puede ser ampliamente utilizada en clínica y para propósitos de investigación en trabajos futuros.
I
Abstract
Nowadays in Mexico, cardiovascular diseases are one of the main death causes due to sedentary live, poor eating habits and smoking. Therefore, the implementations of non-invasive techniques as the electrocardiography are useful tools for timely treatment and diagnosis for cardiac patients. Time intervals are important in electrocardiographic diagnosis because reflect electrophysiological processes of the heart. One important electrocardiographic parameter that quantifies the duration of ventricular depolarization and repolarization is the QT interval, because its abnormal prolongation and increased dispersion are associated with high risk of ventricular arrhythmias and sudden cardiac death in various clinical conditions.
This thesis is focused in generating an algorithm for the automatic measurement of the QT-interval in LabVIEW® using the wavelet transform. The methodology was to implement algorithms from other developing platforms into LabVIEW® and integrated them into an easy going human interface for clinic purpose. The developed algorithm first detects the QRS complex and then the onset of the QRS complex, the T wave peak and the T wave offset.
Evaluation of the QRS detection algorithm performance has been done in 8 ECG data files of the MITBIH database, and the accuracy has been of 99.56%. Evaluation of the detection algorithms of the QRS wave onset and peak and offset of T wave were done in 15 ECG data files of the QT database. The validation was done through the mean (m) and standard deviation (sd) of the differences between the cardiologist measures on the QT database and the automatic measurements of the algorithm developed in each record.
The results obtained were: for QRS wave onset: 9.05±5.37 ms, for T wave peak: 7.76±5.29 ms and T wave end: 9.24±6.06 ms. These results are within the tolerance limits for deviations with respect of the manual measurements determined by experts. It can be concluded that the contribution of this work for its interface and performance reached can be widely used in clinic and for research purpose for future work.
II
Agradecimientos
Mediante la presente sección, quiero dar gracias a todas aquellas personas e instituciones cuyo apoyo sirvió en la finalización de este trabajo. Primero quisiera sobre todas las cosas, agradecer a Dios. La ciencia no tiene por qué estar peleada con las creencias y primero que nada a él le debo todo el trabajo realizado.
También les debo todo a esas personas que estuvieron conmigo en mi corazón a pesar de la distancia, mis padres Gerardo Mercado Pérez y María de Jesús Rojas Beas, mis hermanos Rocío Mercado Rojas, Elizabeth Mercado Rojas y Gerardo Mercado Rojas, y por último pero considerándola demasiado importante, a mi esposa Jessica Velázquez Valdéz cuyo amor, comprensión y paciencia le debo esto y más.
También debo agradecer a todas aquellas personas cuya amistad y apoyo para mí han sido invaluables, mis amigos Priscila, David, Esaú, Hugo, Alejandro, Joaquín, Ángel, Uziel; mis primos Javier, César, Ramón, Moy, José, Magaly, Jair y demás ya que sus consejos, apoyo y momentos juntos ayudaron de una u otra manera. También quiero agradecer a esos compañeros y profesores con los que conviví en la maestría y que de cierta forma marcaron en mi algo importante, la ingeniero Vallejo, el maestro Christopher, la maestra Verónica, los maestros Carlos y Ernesto, el Dr. Vera, el Dr. Pablo, el Dr. Carlos y el ingeniero Eladio. Quisiera decir que en especial agradezco al Dr. Carlos Alvarado por darme la oportunidad de ingresar a la maestría y sobre todo agradecer al CINVESTAV por proporcionarme los medios físicos para finalizarla.
También quiero agradecer al CONCACYT por el apoyo financiero otorgado a los largo de 2 años para finalizar este trabajo. En la realización de mi tesis merece especial mención Zhijun Gu, Ingeniero de Software en National Instruments por proporcionar información importante para la adquisición por base de datos con el código fuente del Biomedical Startup Kit. No me resta más que agradecer a todos y cada uno de ustedes ya que de una manera han dejado marcado mi camino a través de esta etapa de mi vida.
Sinceramente muchas gracias a todos.
III
Greetings In this section I thank all the people and institutions that helped in the process and finalization of this work. First I would like to thanks God. Science and Believes don’t have to be in constant struggle therefore, for me, God goes first.
I would like to thank my parents Gerardo Mercado Perez and Maria de Jesus Rojas Beas, my siblings Rocio Mercado Rojas, Elizabeth Mercado Rojas and Gerardo Mercado Rojas. Being away from home is not easy and we endured through this process. At last but very important for me, I thank my wife Jessica Velazquez Valdez who gives me all her love, sympathy and patience. I own her this work and even more.
I would like also to thanks all my friends and cousins whose friendship and support have been really important for me, Priscila, David, Esau, Hugo, Alejandro, Joaquin, Angel, Uziel, Javier, Cesar, Ramon, Moy, Jose, Magaly, Jair and more. They gave me tips, support and everything I always wanted in a friendship.
I want to thanks my partners and professors from the master degree process because they marked my life over this stage B.Sc. Vallejo, MSc. Christopher, MSc. Veronica, MSc. Carlos, MSc. Ernesto, PhD. Vera, PhD. Pablo, PhD. Carlos, and B.Sc. Eladio. I want to give special thanks to the PhD. Carlos Alvarado for giving me the opportunity to stay in the master.
I want to give special thanks to CINVESTAV Zacatenco and CONACYT for giving me the knowledge and the financial support to finish the work and the opportunity to show that in Mexico exist talent to develop suitable technology for our specific purposes. Talent, intelligence and capability are characteristics in us and it’s all up to ourselves to prove it.
This work was also possible thanks to Zhijun Gu, Software engineer in National Instruments who helped in the acquisition solution for the database giving the source code of the Biomedical Startup Kit. At last, thanks to everyone because without your support and patients this project wouldn’t have been the same.
Thank you for everything.
IV
Contents
Contents.......................................................................................................................... 1
Chapter 1. Introduction ......................................................................................... 5 1.1 Problem approach ......................................................................................... 5 1.2 Proposed solution .......................................................................................... 6 1.3 Objectives....................................................................................................... 8 1.3.1 Main Objective ................................................................................ 8 1.3.2 Specific Objectives ......................................................................... 8
Chapter 2. Background and State of the art...................................................... 11 2.1 The Heart ..................................................................................................... 11 2.1.1 History ............................................................................................ 11 2.1.2 Anatomy ......................................................................................... 14 2.1.3 Electric activation .......................................................................... 17 2.1.4 The Electrocardiogram (ECG) ..................................................... 25 2.1.4.1 History ............................................................................ 25 2.1.4.2 Analysis.......................................................................... 29 2.1.4.3 QT interval ..................................................................... 33 2.1.4.5 The ECG’s leads ........................................................... 37 2.1.5 Squatted Challenge ...................................................................... 40 2.2 The Wavelet Transform .............................................................................. 42 2.2.1 The transform ................................................................................ 43 2.2.2 Wavelet through time .................................................................... 46 2.2.3 Wavelet definition.......................................................................... 48 2.2.4 The Undecimated Wavelet Transform ........................................ 53
1
2.3 LabVIEW® ................................................................................................... 59 2.3.1 The beginning of LabVIEW® ....................................................... 59 2.3.2 LabVIEW® at the forefront ........................................................... 60 2.3.3 LabVIEW® Basic Programming .................................................. 62 2.3.3.1 The HMI: The Frontal Panel ........................................ 62 2.3.3.2 Engineering in action: The Block Diagram ............. 63 2.3.3.3 Controls, Indicators, Constants and Arrays ........... 65 2.3.3.4 Function Palette and Programming Structures ..... 69 2.3.3.5 Data Storage .................................................................. 73 2.3.3.6 Modular Programming (Local variables, Global variables and SubVIs) ................................................. 76 2.3.3.7 Property reference nodes ........................................... 78 2.3.3.8 Programming design patterns ................................... 80 2.3.3.8.a LabVIEW® Queued State Machine Architecture .................................................... 84
Chapter 3. The QT measurement program ........................................................ 89 3.1 Quantitative introduction structure ............................................................. 89 3.2 Hierarchy ...................................................................................................... 90 3.3 Program description .................................................................................... 91 3.3.1 Acquisition phase .......................................................................... 93 3.3.1.A Data Acquisition from Equipment ............................ 94 3.3.1.A.1 Patient’s information .................................... 95 3.3.1.A.2 Equipment Selection .................................... 95 3.3.1.B Load Data .................................................................... 100 3.3.1.C Marks ............................................................................ 102 3.3.1.C.1 Squatted Description.................................. 103 3.3.2 Conditioning phase ..................................................................... 104 3.3.2.A Description.................................................................. 105 3.3.2.B Diagram ....................................................................... 105 3.3.2.C UWT Analysis for QRS Complex (theory) ............. 107 2
3.3.2.D UWT Analysis for QRS Complex (implementation) ..................................................................... 109 3.3.2.E Data logging ................................................................ 113 3.3.3 Main Menu ................................................................................... 114 3.3.3.A R-R Phase.................................................................... 115 3.3.3.A.1 R-R Manual Analysis .................................. 115 3.3.3.A.2 R-R Results .................................................. 117 3.3.3.B QT Phase ..................................................................... 118 3.3.3.B.1 QT Detection ................................................ 118 3.3.3.B.2 QT Manual Analysis .................................... 126 3.3.3.B.3 QT Results .................................................... 127 3.3.3.C Squatted Phase .......................................................... 128 3.3.3.C.1 Squatted obtaining ..................................... 128 3.3.3.C.2 Squatted Results ......................................... 133
Chapter 4. Results and Validation ................................................................... 136 4.1 Results ........................................................................................................ 136 4.1.1 Acquisition ................................................................................... 136 4.1.2 Synthetized ECG signal ............................................................. 138 4.1.3 QRS Complex ............................................................................. 139 4.1.4 QT Interval ................................................................................... 140 4.1.5 Squatted....................................................................................... 141 4.2 Validation.................................................................................................... 143 4.2.1 QRS Complex ............................................................................. 143 4.2.2 QT Interval ................................................................................... 145
Chapter 5. Conclusions .................................................................................... 150
References ......................................................................................................... 152
3
4
Chapter 1- Introduction
1.1. Problem approach
In
last
decades,
industrial
countries
had
grown
rapidly
increasing
manufacturing, supplies and consumption. This increase has stepped civilization into excessive intakes causing public health problems. In Mexico, cardiovascular diseases are the third significant death cause according to the statistical information release of 2009 [1]. Over 11.3% of Mexican population dies because of cardiovascular problems where seigneur people over 60 years old are the most affected sector [1, 2] . By 2005, [2]
a total of 8’640,000 people were part of this sector, this means an increase of
Million of People
781.63% from 1940 [3] [Figure 1.1].
10.00 9.00 8.00 7.00 6.00 5.00 4.00 3.00 2.00 1.00 0.00 1940 1950 1960 1970 1980 1990 1995 2000 2005 Year Fig. 1.1 Seigneur people in Mexico [3].
At this rate, by 2050 it would be over 14 million of people with high risk of cardiovascular diseases. Therefore, timely diagnosis and treatment of cardiovascular diseases must be a priority for a future better life quality and health.
5
1.2. Proposed solution
The electrocardiogram (ECG) had been used as diagnostic test in clinical medicine for more than 70 years [4]. It has a high clinical value because of its efficiency to diagnosis rhythm disorders, conduction abnormalities, cavity dilatation, recent or late myocardial ischemia and infarcts, pharmacological effects, imbalance in electrolyte metabolism and other cardiac disorders [5]. It is a non-invasive tool necessary to assist the electrocardiologist to learn as possible the state of all parts of the myocardium and conduction system, through recordings of electrical potentials related to its activity [6].
An important interval of the ECG is the QT interval. This interval is defined by two principal phases in the heartbeat cycle. Its beginning comes from the earliest indicator of ventricular depolarization and its ending from the latest indicator of ventricular repolarization. Therefore, this interval represents the complete ventricular electric contribution of the heartbeat. Coronary diseases and myocardial infarct produces ventricular injuries with consequences such as ventricular arrhythmias or sudden cardiac death (SCD) [5]. In these conditions, QT interval has an abnormal prolongation and an increase of its dispersion that are associated with an increased risk of arrhythmic death, then, the measurement of this interval is important.
This thesis proposes the development of an algorithm for automatic measurement of QT interval for the study of its time and spatial variability. This algorithm can analyze ECG signals obtained by an own electrocardiography systems and available databases. It pretends to be used as a clinic indicator for ventricular disorders and also for future investigation in other measurements related to this interval. The algorithm will be implemented in a software called LabVIEW®.
6
NI LabVIEW® is a graphical programming language designed for engineers and scientists to develop test, control, and measurements applications. Its optimization for over 20 years and its intuitive graphical programming nature makes this tool easy for researchers to incorporate the software in a range of applications. Its graphical system design is a modern approach to designing, prototyping, and developing systems. The combination of hardware and software simplifies development of new technology at short-term [7].
LabVIEW® gives the flexibility of a powerful programming language without the complexity of traditional development environments. It is capable of perform extensive acquisition, analysis, and presentation capabilities in a single platform. It increases productivity compared with other software and it is easy to learn and use. Table 1.1 shows the software benefits of LabVIEW® [7].
Table 1.1 LabVIEW® Software Characteristics [7]. Intuitive graphical programming for faster development Easy to learn and use
Optimized for engineers and scientists Data visualization for control design Thousands of built-in analysis functions
Functionality
More than 200 signal processing an math functions Full programming language
Integrated I/O Capabilities
Seamless integrations with data acquisition devices for USB, Ethernet, PCI, PCI Express, and PXI/CompactPCI Thousands of instrument drivers for more than 250 vendors Fully integrated with commercial off-the-shelf hardware
All these characteristics make LabVIEW® the indicated software for the QT interval detection algorithm. LabVIEW® can integrate algorithm engineering with a single environment to decrease the design cycle combining the theoretical models of the design with real-world signals. So higher-quality designs can be achieved, avoiding simulation-only challenges and building more rapidly design, prototypes, and applications [7].
7
1.3.
Objectives
1.3.1. Main Objective
Implementation and evaluation of an algorithm based in LabVIEW® automatic measurement of QT interval in ECG signals obtained of
for
proprietary
electrocardiography systems and existing databases.
1.3.2. Specific Objectives
Ø Human-Machine interface (HMI) for the QT interval algorithm. Ø Selection between acquiring a signal from a file (previously acquired or a database) or from an electrocardiography or Holter equipment constructed in previous thesis works. Ø Storage of patient’s name, gender, age and description (only for signal acquiring mode). Ø Acquirement of patient’s ECG specifying leads, acquisition time, time indicator and marking options (only for squatted challenge). This record will be shown in real-time (only for signal acquiring mode). Ø Acquirement of patient’s Holter specifying leads, acquisition time, time indicator, serial port selection, continue mode option and battery status. This record will be shown in real-time (only for signal acquiring mode). Ø Acquirement of patient’s data from files previously acquired with the electrocardiography or Holter equipments, MIT-BIH arrhythmia database or the database from the “Instituto Nacional de Cardiología Ignacio Chávez” (INC). Ø ECG’s signal acquisition for squatted challenge applied in the INC for Brugada, Anderson and Long QT Syndrome (LQTS) patients.
8
Ø Marking report and modification for different phases applied in the squatted challenge. Ø Signal conditioning process where, applying undecimated wavelet transform, QRS complex detection is done. Ø Codification and storage of R-R index data information. Ø Main menu for different analysis, adjustments and data interpretation. Ø Manual analysis of the R-R interval which includes index selection, autozoom, addition of R-R index, deletion of R-R index, lead selection and phase selection. Ø R-R interval result report measuring the R-R interval average, the cardiac frequency and showing the R-R interval, Cardiac frequency and R-R interval average variability per lead and phase (phase only for squatted challenge). Ø Detection of Q wave onset (Qi), T wave peak (Tp), and T wave end (Te) for the different leads using undecimated wavelet transform at different scales and its index codification and storage. Ø QT interval manual analysis for index, lead and phase selection including auto-zoom and addition or deletion of Qi, Te or Tp. Ø QT interval result with measurements for QTp (from Q wave onset to T wave peak), QTe (from Q wave onset to T wave end), and QTc (QTe corrected according to Bazett’s formula) maximum, minimum and tendency values. Location of maximum and minimum values between leads. Ø Squatted challenge condition for each phase and storage of the data. Ø The result between phases of the squatted challenge for analysis.
9
[1] [2] [3] [4] [5] [6] [7]
10
Chapter 2- Background and State of the art
2.1. The Heart
The heart is an elemental organ for human life. It has been widely studied, from physiology to poetry, science and art. Now some background is needed in order to understand the importance of this organ.
2.1.1 History
In ancient times, medical knowledge was tied to fraud, legends and quackery and most of it was mistaken [8]. In his book of history of medicine, Fielding Garrison exemplifies that “Medicine couldn’t be considered medicine until it was dissociated from magic and religion” [9]. The word heart has its meaning from Indo-European and Anglo language word in Sanskrit “hrid” that means “jump”. Therefore these civilizations used to call the heart “the jumper, the one that jumps in the chest” [8].
Healers from ancient China used the heart beat to know the heart health. In 1500 B.C. Egyptian papyrus describes this vital organ as “blood factory” responsible for distributing the blood by canals all over the body. Classic Greeks as Hippocrates describes the heart as a big muscle with semi-lunar valves. But until the second century, Galen describes wrongly the blood flow and the chambers [10].
Leonardo Da Vinci was a remarkable physiologist and anatomist. He studied and illustrated perfectly the valves, the cavities and the coronary arteries of the heart. In renaissance era, Miguel Servet discovered the pulmonary circulation of the blood. This discovery sentenced Servet to death. One decade after, William Harvey proved the true blood circulation process and heart’s role as impulsion motor. His thesis “De
11
Motus Cordis” was considered so important that he received the title of father of cardiology [Figure 2.1] [8, 10].
[ [8]. [10]].
Fig. 2.1 William Harvey considered father of cardiology [8].
Centuries XVII and XVIII were anatomists’ ages. Vieussens, Morgagni, Hunter, Malpighi settled together structural evidence of this organ. By XIX century, the cardiac auscultation by French Laënnec [Figure 2.2]; the heart block by Adams; the aortic deficiency; the discovery of Purkinje’s cardiac conduction tissue and the cardiac malformations described by Fallot were some of the relevant actualities [10].
Fig. 2.2 René Laënnec, inventor of the stethoscope and auscultation [8].
12
In the last hundred years, cardiology progress has been spectacular [11]. Aschoff, Tawara, His, Keith and Flack completed the description of cardiac stimulus conduction. Einthoven made the first electrical recording of the heart. Cardiac catheterization was introduced by Forssmann and phonocardiogram by A. Weber. Blalock and Helen Taussing began to implement the first correctional surgeries for congenital cardiac diseases [10].
In XX century, cardiac pharmacology began to evolve. This evolution made possible the first open heart surgery performed by Derrey Dodrill. Senning implanted the first cardiac peacemaker ten years before Christian Barnard achieved the world’s first successful human-to-human heart transplant [10, 12].
[10], [12]
By now XXI century, Dowling and Gray constructed Abiolar, the first autonomous total artificial heart (TAH). This iron bump was the precursor for ventricular assistance devices (VAD) such as Lion Heart, Jarvik-7 and Heart Matell [Figure 2.3] [10].
Fig. 2.3 Jarvik-7, Total Artificial Heart (TAH-t) [13].
13
2.1.2 Anatomy
The heart is found in the mediastinum with its mayor axis oriented from the hypochondriac to the right shoulder. Its anterior face is covered by the right and left lungs. All is in the thoracic cavity. The heart is protected by a fibrous sac called the pericardium. This pericardium is firmly bonded to the diaphragm [Figure 2.4] [14].
Fig. 2.4 Resection of the anterior chest wall, the heart in situ [14].
Its main function is to bump blood to all the body. The circulation of the blood is important because it provides of oxygen, nutrients, vitamins and hormones to all cells in the body. It also retrieves metabolic products due to wastes such as CO 2 and H2O [15]. In fact, the heart is composed by two different bumps [Figure 2.5]. The right bump is the one that bumps blood to the lungs (for the pulmonary circulation). In the other hand, peripheral organs are blood supplied by the left bump (for the systemic circulation). Each one of these bumps is a pulsatile element with two chambers composed of an atria and a ventricle [16]. The atria function principally as entryways to the ventricles. It is a weak bump that helps to move the blood through the atria into the ventricles. The ventricles supply the force that propels blood through the lungs (right ventricle) or through the peripheral circulatory system (left ventricle) [17].
14
Fig. 2.5 Heart structure and blood flow path [16].
Left and right bumps are separated by a muscular wall, or septum. This septum normally prevents mixture of the blood from the two sides of the heart. Between the atria and ventricles, there’s a layer of dense connective tissue known as the fibrous skeleton of the heart. Bundles of myocardial cells in the atria attach to the upper margin of this fibrous skeleton and form a single functioning unit (myocardium). The myocardial cells’ bundles of the ventricles attach to the lower margin and form a different myocardium [18].
The heart is composed of three major types of cardiac muscles: atrial muscle, ventricular muscle, and specialized excitatory and conductive muscle fibers [17]. The myocardia of the atria and ventricles are structurally and functionally separated from each other, and special conducting tissue is needed to carry action potentials from
15
the atria to the ventricles [18]. How special conducting tissue works, will be described later on this chapter.
Between atria and ventricles there are valves called atrioventricular valves. These valves are composed of cusps and flaps that allow blood to flow from the atria into the ventricle but preventing blood to flow back. The atrioventricular valve between the right atrium and the right ventricle has three cusps and it’s called the tricuspid valve. The atrioventricular valve between the left atrium and the left ventricle has two cusps so it’s called bicuspid or mitral valve. After right ventricle in the pulmonary circulation, the blood has to enter into the pulmonary arteries through the pulmonary semilunar valve. This valve consists of three pocketlike semilunar cusps that block blood flow. A similar valve exists in the systemic circulation between aorta and left ventricle called aortic semilunar valve.
It is convenient to discuss blood flow through the heart in order to understand how blood circulation occurs. It’s important to know that both atria contract at about the same time and both ventricles contract at about the same time. This fact must be considered particularly in electrical activity, pressure changes, and heart sounds [19].
At the beginning of the process blood enters the right atrium from the systemic circulation, which returns blood from all the tissues of the body. Blood flows from an area of higher pressure (systemic circulation) to a lower pressure (right atrium). Most of the blood in the right atrium passes into the right ventricle as the ventricle relaxes from its previous contraction. The right atrium then contracts pushing the blood remaining into the right ventricle to complete the filling.
When the right ventricle contracts it pushes the blood against the tricuspid valve closing it. This action pushes the blood and against the pulmonary semilunar valve opening it letting the blood enters into the pulmonary trunk. The pulmonary trunk branches to form the pulmonary arteries. These arteries carry blood to the lungs 16
where gas exchange occurs. Carbon dioxide is released and oxygen is picked up. Oxygen diffuses from the air to the capillary blood, while carbon dioxide diffuses in the opposite direction [18, 19].
[18], [19]
After gas exchange, blood returns from the lungs into the left atrium through the four pulmonary veins. The blood passing from the left atrium to the left ventricle open the bicuspid valve and contraction of the left atrium completes left ventricular filling. Contraction of the left ventricle pushes blood against bicuspid valve forcing its closing. This contraction pushes blood against the aortic semilunar valve opening it and letting the blood flow to the aorta. Blood is then distributed to all parts of the body except the lungs. Lungs are supplied by the pulmonary blood vessels in the process [19]. Figure 2.6 exemplifies how this process is done.
Fig. 2.6 Blood Flow through the Heart [19].
2.1.3 Electric activation
As stated before, the myocardia of the atria and ventricles are structurally and functionally separated from each other, so special conducting tissue is needed for its electric activation. But first, it’s important to know how this electric activation occurs. In order to perform its functions, some systems in the body generate electric currents. The information from this current is important because it contains useful information 17
that can be represented. These bioelectric potentials are linked to events such as cardiac activity. In fact, these potentials are produced by ionic voltages due to electrochemical activity on special excitable cells [20].
In the heart these excitable cells are called myocyte. These cells are characterized because of its permeable selective membrane. The permeability allows ionic exchange between inside and outside of the cell to generate an electrical behavior. Its electric activation takes place from the inflow of sodium and potassium ions across the cell membrane. This phenomenon is called action potential. There are three possible phases during the action potential: resting membrane potential, depolarization and repolarization [19-21].
[19]
[20]
[21]
In the heart, there’re also two types of
action potential, non-pacemaker action potentials and spontaneous action potentials [22].
During resting membrane potential, gated sodium channels and gated potassium channels in the cell membrane are closed. The outside of the plasma membrane is positively charged compared to the inside of the cell because of the ionic concentration [19]. The majority of myocardial cells have resting membrane potential of about -90 mV [Figure 2.7].
Fig. 2.7 Resting membrane potential [19].
18
Stimulus of a cell can cause depolarization of its plasma membrane. The depolarization phase of an action potential is triggered if the depolarization changes the membrane potential to a value called threshold. The action potential fails to occur if the stimulus doesn’t reach this threshold. By the other hand, if the stimulus is at or above the threshold intensity, the action potential occurs with a constant amplitude and form. This is called the all or none law. In depolarization, gated sodium channels are open. The inward movement of sodium makes the inside of the membrane more positive [19, 23] [Figure 2.8]. [19] [23]
Fig. 2.8 Depolarization [19].
During depolarization phase, cells can’t be stimulated again. This time is called absolute refractory period [15, 23]. Depolarization’s duration in the heart depends on [15] [23]
the type of action potential. Different action potentials in the heart will be described later.
After depolarization, repolarization phase begins. At this point, gated sodium channels are closed and gated potassium channels are open. Sodium movement into the cell stops and potassium moves out of the cell causing repolarization [19] [Figure 2.9]. In this process a progressive recovery of excitability is established. This is called relative refractory period. Cardiac muscle can be excited but it requires stronger than normal stimuli. After depolarization the threshold is decreased, and after repolarization the threshold is back to normal [15, 23].
[15] [23]
19
Fig. 2.9 Repolarization [19].
In general way, this is how action potential occurs. As mentioned before there are two types of action potential in the heart, non-pacemaker action potentials and spontaneous action potentials. Non-pacemaker action potentials are also called fast response action potentials, because of its rapid depolarization [Figure 2.10]. These action potentials are found throughout the heart except for special cardiac cells called pacemakers cells [22].
Fig. 2.10 Non-pacemaker cardiac action potential [22].
20
Figure 2.10 shows the different phases of a non-pacemaker cardiac action potential. Phase 4 is the resting membrane potential. This potential is about -90 mV and it depends on the concentration of sodium and potassium ions. This potential can be obtained with the Goldman-Hodgkin-Katz constant field equation [24]. To maintain this potential, cell membrane is adapted with an energy dependent bump system called Na/K ATPase (or Na-K bump). This bump transports sodium ions out of the cell and potassium ions back into the cell [22] [Figure 2.11].
+
+
Fig. 2.11 Na /K ATPase (Na-K bump) [22].
This bump is an active carrier which means that requires ATP (Adenosine Triphosphate) to function. It is used to flow ions against concentration gradient and preserve resting membrane potential. For each three ions of sodium transported outside the cell two potassium ions enters [25, 26]. Phase 0 in the non-pacemaker [25]
[26]
cardiac action potential occurs with threshold voltage causing a rapid depolarization. This voltage threshold is caused by action potentials in adjacent cells. The depolarization occurs as explained before, because of the inflow of sodium through fast sodium channels [22].
Phase 1 is called early repolarization. This repolarization is because to the fall in sodium permeability [27] and the opening of special type of transient outward potassium channels [22]. At this point, normal repolarization was taking place as stated before, but in non-pacemaker cardiac action potentials another ionic channel must be taken into consideration. After early repolarization Calcium channels open. This slow inward of Calcium ions generates a delay in the repolarization causing the plateau distinctive feature of depolarization in heart muscle (phase 2) [22, 27].
[22] [27]
21
At least, phase 3 occurs when Calcium channels are inactivated and potassium ionic exchange increases. The interior of the cell became more and more electronegative with respect to the exterior, until the resting potential difference was regained (phase 4) [28]. Figure 2.12 exemplifies how spontaneous action potentials occur. In contrast with non-pacemaker cardiac action potentials, these potentials do not maintain a resting membrane potential. Instead, during the period of diastole, they exhibit a spontaneous depolarization [18, 22].
[18] [22]
Fig. 2.12 Spontaneous cardiac action potential [18].
At phase 0, just after preview repolarization, membrane potential is very negative and it starts to depolarize opening few sodium channels and slow calcium channels begin to open. This phase is called prepotential or pacemaker potential. This spontaneous depolarization is produced by the diffusion of calcium through openings in the membrane [18, 19, 22].
[18]
[19]
[22]
At the threshold level of around -40 mV
depolarization occurs (phase 1). Fast calcium channels open and calcium rapidly diffuses into the cells. This calcium channels are not as fast as in the depolarization of non-pacemaker action potential, therefore the rate of depolarization is much slower [18, 22].
22
[18] [22]
At the beginning of repolarization (phase 3), potassium channels open and calcium channels become inactivated and closes. Outward diffusion of potassium repolarize the cell membrane until it achieves the negativity required to begin a new pacemaker potential [18]. Potassium channels close and phase 0 starts again. In the heart, special conduction system is required. This system excites heart cell for contraction in order to produce the heartbeat. There are four electro-physiologic process involved in this system: autorhythmicity of the heart, electrical transmission through specialized fibers, myocardial activation, and myocardial recovery [29].
The autorhythmicity of the heart is produced by the Sinoatrial Node (SA node). The SA node is composed of small cells that are tightly assembled into small aggregates accumulate in a defined region at the entrances of the superior vena cava into the right atrium [30]. Its role is to be the normal cardiac pacemaker [28]. Hence, its action potentials are spontaneous. From the SA node, the cardiac impulse spreads radially throughout the right atrium and by the anterior interatrial myocardial band the impulse is conducted to the left atrium. This impulse is the responsible for atrial contraction (depolarization). Despite being a non-pacemaker action potential, the plateau of this contraction is not well defined and its repolarization occurs at a slower rate [28].
After atrial contraction, the cardiac impulse spread to the atrioventricular node (AV node). The AV node is located in the atrial septum immediately above the ventricles. There, the excitatory wavefront is delayed before entering the ventricles [30]. The AV node contains the same cells type as the SA node so their action potentials are similar [28].
After the AV node, the impulse passes to the ventricles via the common bundle (bundle of His). This bundle passes down the right side of the interventricular septum for approximately 12 mm and then divides into the right and left bundle branches. 23
Right bundle is a direct continuation of the bundle of his and proceeds down the right side of the interventricular septum. The left bundle is thicker than the right and it arises almost perpendicularly perforating the interventricular septum. Both branches then subdivide into a complex network of conducting fibers called Purkinje fibers which ramify over the subendocardial surfaces of both ventricles. Velocity of the propagation of action potential over Purkinje fiber system is the fastest of any tissue in the heart letting a rapid activation of all regions [28]. Their action potentials are non-pacemaker action potentials.
The end of cardiac electrical conduction is at the ventricles, where the cardiac impulse from Purkinje fibers depolarizes the ventricular muscle. Figure 2.13 shows all different action potentials of the cardiac conduction system and muscle contractions. The extracellular record of this electrical activity is correlated in a signal called electrocardiogram (ECG) [5].
Fig. 2.13 Cardiac conduction system and its correlation with the ECG [19, 5].
24
[19] [5]
2.1.4. The Electrocardiogram (ECG)
Now that is understood how the heart functions and its electrical conduction, is now useful to know how to record this activity, its interpretation, and utilization. But first, it is also important to know how everything began.
2.1.4.1.
History
Knowledge of bioelectricity started with the observation by L. Galvani in 1787 [31] that a frog muscle contracted when exposed to an electrical discharge process. Opposed by Alessandro Volta, Galvani idea of animal electricity was possible to prove after the development of sensitive galvanometers in 1825. This experiment proved that there are charges and currents within the frog itself [32].
By 1843, Italian physician Carlo Matteuci proved how electrical current is present in each heartbeat [33] beginning the origins of modern cardiac electrophysiology. The following year German physiologist Emil DuBois-Reymond described an action potential that accompanied muscular contraction [34] and by 1856 Rudolph von Koelliker and Heinrich Muller recorded the first cardiac action potential [33, 34].
[33] [34]
August Desiree Waller began a series of experiments at St. Mary’s Hospital Medical School in London and in 1887 he succeeded in recording the first human ECG. Weller carried out his studies using the capillary electrometer invented by the French physicist Gabriel Lippman in 1873. By means of the capillary electrometer Waller investigated systematically the potential distributions associated with the beating heart on man and animals. Weller even predicted the reversal of the electrical pattern [32, 34, 35].
[32]
[34]
[Figure 2.14]. However he initially concluded “I don’t know
[35]
imagine that electrocardiograph is likely any very extensive use in the hospital. It can
25
at most be of rare and occasional use to afford a record of some rare anomaly of cardiac action.” [36]
Fig. 2.14 Distribution of negative and positive potentials on human and animal body surfaces [37].
In 1889 Dutch physiologist Willem Einthoven met Waller and saw his technique of recording the heart’s electrical impulse at the First International Congress of Physiologists held at Basel [33, 34]. His vision and tenacity led Einthoven to establish [33] [34]
the clinical relevance of this strange new trace and to develop and commercialize a clinically acceptable system based on the string galvanometer [35].
William Bayliss and Edward Starling of University College (London) published the result of their research on the electrical activity of the heart using the capillary electrometer in 1892. Improvements as including electric arc light and more powerful projection microscope allowed them to distinguish 3 separate deflections while Waller had identified only 2 [38]. But throughout the 1890s Einthoven recognized the limited frequency response of the capillary electrometer and between 1893 and 1896 along 26
with George J. Burch developed methods of calibrating and complex mathematic and physical approaches to enhance the quality of his records. This complements allow Einthoven a signal shape which was close to the “true” ECG [39]. He concluded that each cardiac contraction was accompanied by 5 distinct electrical deflections which he labeled P, Q, R, S, and T [40] [Figure 2.15]. His choice of this letters reflected a tradition in mathematics from 17th century traced to French scientist René Descartes [41]. Einthoven introduced the term electrocardiogram and his denomination is in use until today [32, 33].
[32] [33]
Fig. 2.15 Einthoven’s denomination of electrocardiographic waveform [39].
Einthoven was not satisfied with the sluggishness, the slow response in time, and the poor accuracy of the capillary electrometer so in 1900 he started the development of a new device [32]. Based on an amplifier system developed by French electrical engineer Clement Ader called string galvanometer for undersea telegraphic transmission lines, Einthoven created a modification and in 1902 he reported the first use in electrocardiography [34]. This first electrocardiograph weighed 600 pounds and required five people for operation. Several companies started a redesign to make the system marketable until 1911 when the Cambridge Scientific Instrument Company introduced the first table electrocardiograph in London [32] [Figure 2.16].
27
Fig. 2.16 First table-model Einthoven electrocardiograph manufactured by the Cambridge Scientific Instrument Company of London in 1991 [42].
Using the Einthoven string galvanometer fundamental research started to understand the electrographic signal. In his paper “Über die Richtung und die manifeste Größe der Potentialschwankungen im menschlichen Herzen un über den Einfluß der Herzlage auf die Forms des Elektrokardiogramms” Einthoven established the first standards for ECG leads and the electrocardiograph career as a noninvasive tool for clinical heart function analysis started [43]. In 1924 Einthoven was awarded with the Nobel Prize for his discovery on the mechanism of the electrocardiogram [32].
After the invention of the vacuum tube, the small electrical signals from the heart could be amplified. The first report was made in 1928 by Ernestine and Levine in the American Heart Journal. The same year Frank Sanborn’s company converts their table model ECG into the first portable version, weighing 50 pounds and powered by a 6 V automobile battery. In 1934, portable electrocardiographs started with the first amplifier type electrocardiographs developed by Siemens and Halske in Germany [42].
28
With the invention of the cathode ray tube, physical characteristics of ECG improved and new areas for research started (e.g. vectocardiography). New devices for ECG started to arise to be used in clinic and facilitate practitioners; one example of this is the introduction of pen-writing instruments in 1932 [32]. The same year Wolferth and Francis Wood described the clinical use for precordial lead. In 1938 the American Cardiology Society and the British Cardiology Society defined standard positions for precordial leads. In 1942 Emanuel Goldberger increases the threshold for leads aVR, aVL, and aVF and with the 3 Einthoven leads (I, II, and III) and the 6 precordial leads complete the conventional ECG of 12 leads used nowadays [33].
During 20th century, cardiology grew in size as a result of technology advances that help heart specialists diagnose and treat patients. Nowadays some specialists justified their expertise in a specific area of medicine by claiming a special ability to operate a medical tool. New techniques are being implemented as cardiac electrophysiology
evolves
for
example,
Holter
monitoring,
His
bundle
electrocardiography, intracardiac mapping, programmed electrical stimulation, and signal averaged electrocardiography [44]. Advances in cardiopulmonary resuscitation and coronary care units are medical advances that owe their existence to electrocardiogram [45]. Currently more than 50 million electrocardiograms are processed by computer annually in North America [46].
2.1.4.2.
Analysis
In this section the ECG analysis will be described. As mentioned before the extracellular record of the electrical activity of the heart is called ECG [5]. Electrocardiography is a fundamental part of cardiovascular assessment. It is an essential tool for investigating cardiac arrhythmias and is also useful in diagnosing cardiac disorders such as myocardial infarction [47].
29
The propagation and excitation of cardiac cells has different velocities depending on the region. This produces delays between the activation of the different action potentials. The addition of all these action potentials at once represents a signal that can be measured all through the body [48] [Figure 2.17]. The form of this signal depends on the way that is measured in the body. The different positions for measuring (leads) will be explained later.
Fig. 2.17 ECG signal, deflections, and intervals [49].
Figure 2.17 shows the different deflections presented in one lead of an ECG. The P wave represents the atrial activation (depolarization). Its increase in amplitude is an indicator of hypertrophy. Its increase in duration is an indicator of dilatation or myocardial diffuse injury. Notches are indicators of local myocardial injury [6].
The PR interval is from the beginning of the P wave to the beginning of QRS complex. This interval represents the beginning of atrial depolarization to the beginning of ventricular depolarization. It is related with age and heart frequency. Its elongation indicates first grade AV block due to active rheumatic carditis; vagotonia; digitalis; coronary diseases in sclerosis, hypertension, and lues; infarct; congenital anomaly in conduction system or diphtheritic myocarditis. Its shortage is an indicator
30
of nodal rhythm and extrasystole; pacemaker migration or Wolff- Parkinson-White syndrome [6].
The QRS complex is the ventricular activation (depolarization). Its width can determine different disorders as recent infarct; hypertrophy; idioventricular rhythm; incomplete block of the branch; ventricular extrasystoles or Wolff-Parkinson-White branch block. Low amplitude disorders may be caused by diffuse myocardial injuries; infarct; edema; stroke; obesity; emphysema; heart failure or myxedema. Heart rotation is characteristic by a high voltage in QRS complex due to ventricular hypertrophy in arterial hypertension, aortic failure, congenic diseases and more. Some other pathologic signs are slurring; notching or electrical axis deviation because of toxic, inflammatory and degenerative causes [6].
The Q wave has an initial negative wave deflection and then a positive wave deflection. This wave is generated for the activation of the partition wall in the heart. In this partition wall the left surface has much area than the right surface. The impulse prolongation from left side to right side forms Q wave. If Q wave exceed 0.03 seconds is an indicator of infarct, cardiosclerosis or rheumatic carditis. If Q wave is presented in precordial right leads (V1, V2 o V3) is a pathologic sign normally due to right hypertrophy. Deep Q wave in DIII lead is present in posterior infarct; pericarditis, acute cor pulmonale or diaphragm elevation (normally con pregnancy) [6].
The ST segment is one of the most important in ECG. Its beginning corresponds to the complete ventricular depolarization, and the end corresponds to the ventricular repolarization. It has normally a gap of ±1 mm but higher gap is an indicator for acute and reversible myocardial changes associated to muscular damage (e.g. infarct). Gaps lower than 1 mm are indicator of chronic and persistent myocardial changes (months or years) without muscular damage (e.g. hypertrophy). For diminished polarization in damaged regions during diastole, a gap is presented.
31
An infarct gap in presence of ischemia is associated with a ST segment prolongation measured at the initial part of the segment [6].
The T wave represents ventricular repolarization. This is the easiest readable wave in the ECG. It is symmetric with rounded or acuminated tip. High amplitude is an indicator of exercise, vagotonia, hyperthyroidism, ventricular hypertrophy, arterial hypertension, branch block, congenic diseases, acidosis or uremia. Low amplitude is an indicator of cardiac failure, sympathicotony, cardiosclerosis, acute myocarditis, toxic actions, anemia, myxedema, alkalosis or postprandial. The inversion of the T wave in certain leads reflects infarct, ischemia, ventricular hypertrophy or branch block [6].
This thesis is focused to the QT interval therefore this interval will be explained later at detail.
The U wave is a mechanoelectric phenomenon that results in a low-amplitude, low-frequency deflection that occurs after the T wave. It is frequently absent in the limb leads and is most evident in lead V2 and V3. Increase in U wave amplitude in association with depression of ST segment and decrease in T wave amplitude may be caused by cardioactive drugs with quinidine-like effects and by hypokalemia. Fusion of the U wave with the T wave occurs in association with an increase in sympathetic tone and in presence of markedly prolonged QT interval [50]. The inversion of U wave with T wave positive is abnormal [6].
The next Table shows the normal range value of duration for the different intervals of the ECG [5].
32
Table 2.1 ECG Parameters value range [5].
2.1.4.3.
ECG Parameter
Range value (s)
PR interval
0.12-0.20
QRS complex
0.06-0.10
ST segment
0.05-0.15
QTc interval
0.35-0.44
RR interval
0.60-1.00
QT interval
This thesis is focused to the automated measurement of the QT interval, so it is convenient to go deeper in this deflection. The QT interval is defined as the interval from the onset of the QRS complex (the earliest indication of ventricular depolarization) to the end of the T wave (the latest indication of ventricular repolarization) [50]. Its electrical systole corresponds to the mechanical systole [6]. If ventricular action potential and QT interval are compared, the QRS complex corresponds to depolarization, the ST segment to the plateau, and the T wave to repolarization [Figure 2.18].
The QT interval measures the total duration of
ventricular activation because it represents the combined influence of all the ventricular action potentials [51].
33
Fig. 2.18 Ventricular action potential VS QT interval [51].
Coronary arterial diseases and myocardial infarct (MI) produces ventricular injuries that can trigger acute ventricular arrhythmias or sudden death due to ventricular tachycardia. This tachycardia can lead to a ventricular fibrillation. These conditions can be detected in the ECG as abnormal variations of the duration of the QT interval especially in patients with post-MI [5].
Some families have a rare inherited abnormality called congenital long QT syndrome (LQTS). This syndrome is related to syncope (fainting) or sudden death. The ECG of affected individuals reveals either long, irregular T wave, or prolonged ST segment, or both. Patient’s hearts have delayed repolarization, which prolongs the ventricular action potential. When repolarization occurs, repolarized myocardium is subject to sudden, early depolarizations called afterdepolarizations. These happen because the membrane potential of certain regions of myocardium starts to depolarize before it has stabilized at the resting value. These afterdepolarizations disrupt the normal, synchronized pattern of depolarization and ventricles start to depolarize in chaotic patterns causing ventricular fibrillation. With ventricular
34
fibrillation the heart cannot bump blood, arterial pressure drops, blood flow to the brain and other parts of the body ceases, and sudden death occurs. It is apparent that at least one cause of sudden infant death syndrome (SIDS) involves a form of LQTS [51].
The prolongation of the QT interval due to chemical and electrical delays in depolarization and repolarization is present in ischemia, hypocalcaemia, alkalosis, uremia, beriberi, and diabetic coma for quinidine. Its shortening corresponds to increases
in
physical
chemistry
and
electric
process
and
is
present
in
hypercalcaemia, hyperthyroidism, and acidosis for digitalis. QT interval duration is reciprocal to calcaemia [6].
For QT interval measurement is necessary a lead with T wave well defined without U wave superimposed. Normal values for QT interval are dependent of age, gender, cardiac frequency, and the autonomic nervous system (ANS). To correct the interval in function of cardiac frequency Bazett’s formula is used [5]:
ܳܶ ൌ
ொ்
ξோோ
(2.1)
Where, QT, is the QT interval measured. RR, is the RR interval measured between two heartbeats.
When QTc prolongation is superior of 0.44 s, it is a denotation of idiopathic anomalies or due to drugs, metabolic disorders, branch block, ANS failure or other disorders causing malign ventricular arrhythmias or sudden death [5].
35
The QT interval is an indicator of the ventricular repolarization state, which variations represent its heterogeneity. This heterogeneity is expressed as the QT interval dispersion [52]. Since 1964, Jaok Han and Gordon Moe established the linkage between non-homogeneity from the ventricular repolarization and the lower threshold for ventricular fibrillation by proving that the difference between refractory cycles in adjacent areas could be responsible of arrhythmias and fibrillation [53]. This leads into the hypothesis that the differences in spatial variability between leads of the QT interval can reflect regional alterations in the repolarization process [54-56].
[54]
[55]
Therefore in 1990, Day et al. suggested that the spatial variability of the QT interval
[56]
reflects these differences, and it could represent an indicator of high susceptibility to ventricular arrhythmias. They defined the QT interval dispersion (QTd) as the difference between the maximum and minimum interval detected between the 12 leads of the superficial ECG (QTmax-QTmin) [57].
Repolarization’s dispersion can be affected by multiple factors such as cardiac frequency and rhythm, prematurity in complexes that interact with excitability, conduction speed, and refractoriness in cardiac tissue. Other factors such as the anatomy and morphology of healthy and sick hearts; influence from the neurovegetative system or electrolytic imbalance can affect the repolarization’s dispersion as well. Therefore, evaluation in extraordinary cases can become really complex [52].
The problems associated with the measurement of the QT interval are that there isn’t any standard criterion for the measurement in a specific lead, ignoring spatial variability between leads (QT interval varies between different leads) [56]; the difficulty in measuring QT interval due to low amplitude of T wave and the standardized definition for the T wave end especially with U wave presence [58] and the QT interval correction for age, gender, cardiac diseases, ANS, circulating catecholamines, electrolytes and drugs [59].
36
2.1.4.4.
The ECG’s leads
Now that the different deflections of the ECG have been explained, it’s time to understand how this electrical activity of the myocardium during a cardiac cycle is recorded. The electrical activity generated by the heart can be modeled as a vector whose magnitude and direction changes throughout the cardiac cycle. To record the different projections of this vector, several electrodes are attached to the body in different locations known as leads [57] [Figure 2.19].
Fig. 2.19 The ECG 12 leads vectors [47].
These leads measure the electric potential of the heart between two points from different directions. Its amplitudes, polarities, times and duration between leads are different, therefore they are normalized. Table 2.2 shows the different electrodes combination to achieve the 12 leads standard ECG used in clinic cardiology [5].
37
Table 2.2 ECG 12 leads combination [5]. Lead
Electrode
Bipolar limps leads (Einthoven)
LA, RA, RL, LL
Definition I=LA-RA II=LL-RA III=LL-LA
Augmented unipolar leads (Goldberger)
aVR=RA-0.5(LA+LL) LA, RA, RL, LL
aVL=LA-0.5(LL+RA) aVF=LL-0.5(LA+RA) V1=V1-(LA+RA+LL)/3 V2=V2-(LA+RA+LL)/3
Unipolar precordial leads (Wilson)
V1, V2, V3, V4, V5, V6
V3=V3-(LA+RA+LL)/3 V4=V4-(LA+RA+LL)/3 V5=V5-(LA+RA+LL)/3 V6=V6-(LA+RA+LL)/3
The standard ECG consists of recordings of 12 different leads. A lead consists of the recording from electrodes placed at specific sites on the body. Each lead shows the same cardiac event as other leads but from different view [60]. Figure 2.20 shows how electrodes must be attached to the body.
Fig. 2.20 Electrodes positions on the body [61].
The Einthoven’s triangle is when the torso is considered to be an equilateral triangle with the right and left shoulders and the left leg as the three apices. The right leg serves as a ground connector. All four electrodes merely serve as conductors 38
from the torso. If lines are drawn perpendicularly from the center of each side of an equilateral triangle, they will meet at the center of the triangle. These lines represent the zero potential lines for the three sides of the triangle. Three leads are formed by measuring the potential differences between any two of the limb electrodes. Lead I measures the difference between LA and RA electrodes, lead II the difference between LL and RA electrodes and lead III the difference in LL and LA electrode [60].
If the three limb leads are connected to a common terminal, the combined voltage from the three leads will be zero (Wilson central terminal WCT). This common terminal is attached to the negative pole and a fourth, or exploring, electrode can be attached to the positive pole. This will provide the absolute voltage at the body surface of the exploring electrode. This arrangement is termed unipolar precordial leads. There are six standardized sites of precordial leads that measures electrical activity in the horizontal plane of the body. V1 is in the fourth intercostal space (ICS) just to the right of the sternum; V2 is in the fourth ICS just to the left of the sternum; V4 is in the midclavicular line (MCL) in the fifth ICS; V3 is halfway between V2 and V4; V5 is in the anterior axillary line at the same level as V4; and V6 is in the midaxillary line at the same level as V4 and V5 [60].
Any of the three limb electrodes can be used to record cardiac potentials in comparison to the common terminal (WCT). The resulting voltage is small, because the potential difference is reduced by the contribution on that limb electrode in the common terminal. Therefore, disconnecting that lead from the common terminal increases the potential by 50% and results in the augmented unipolar limb lead. Then, aVR is the potential difference between RA and (LA+LL); aVL is the potential difference between LA and (RA+LL) and aVF is the potential differences between LL and (RA+LA). The augmented limb leads bisects the angles of Einthoven’s triangle from -150° to 30° in aVR; from -30° to 150° in aVL and from 90° to -90° in aVF [60].
39
2.1.5. Squatted Challenge
When human beings evolved into upright position, its vulnerability to gravity in circulation was incremented. Therefore, the brain became the most affected organ susceptible to hypoxia because of its anatomical position. On orthostatic position, there is a vertical blood displacement under the heart which results in a decrease on venous compensation. The heart can’t bump blood if it isn’t receiving it, so the beat volume decreases and arterial pressure drops. Once detected these events, regulatory cardiovascular reflects are activated to compensate circulation and keep arterial pressure independent from gravity force. To achieve this response, it is necessary to moderate cardiac output, output per beat and peripheral vascular resistance. The autonomous nervous system is the principal responsible of the response in postural changes of short and medium term. These alterations in the autonomic functions can incur into sympathetic malfunctions resulting into orthostatic hypotension which can be important enough to produce cerebral hypoperfusion and loss of consciousness (syncope) [62].
In contemporary clinical practice, challenges are used as helpful tools for diagnostic assessment [63]. One challenge commonly used is the tilt table challenge. This challenge consists on an orthostatic test in which the patient is laid on a table that can be tilt from 0° to 80° in order to analyze its neurological response to the challenge [64] [Figure 2.21].
40
Fig. 2.21 Tilt table challenge [64].
In 1986, Kenny and other colleagues observed an abnormal response to tilt in 10 of 15 patients with unknown syncope. This response consisted in hypotension and bradycardia. This challenge was tested in 10 more healthy people without preview syncope observing an abnormal response in only one. Since then, tilt table challenge has been used for many authors with different protocols for diagnostic, investigation and therapy. In 1991 Fitzpatrick and colleagues implemented another challenge (the Westminster challenge) using a bicycle in which they proved lower specificity compared to the tilt table. From 1989, other researchers as Almquist, Waxman, Kapoor, Raviele and more have been experimenting with these challenges varying different factors as tilt angles, tilt duration or drug administration [64].
One specific objective of the thesis is the implementation of an algorithm for the automatic measurement of the QT interval to be used in a challenge called squatted challenge. Although there’s no background in which the squatted challenge has been used as a diagnostic tool, there is evidence that this position has been used as a solution to reduce hypoxemia. This happens because it reduces the venous41
arterial short circuit and raises the pulmonary flow increasing the systemic resistance and diminishing the venous blood which return highly desaturated of oxygen from extremities [65]. These effects in the squatted position are really useful to decrease sign and symptoms presented on a tetralogy of Fallot [66]. This thesis work is the first attempt to compare QT intervals between positions in a squatted challenge consisting in basically three positions [Figure 2.22]. This challenge will be explained later in the thesis.
Fig 2.22 Squatted challenge’s basic positions [67].
2.2. The Wavelet Transform
In order to understand the mathematical concepts applied in this thesis it is fundamentally important to look back into the foundations of what was used for the signal processing of the ECG. The tough part of the work done is applied inside the program, but in order to apply that method it was necessary to fully understand what does a wavelet transform does, its meaning, its early stages and its advantages.
42
2.2.1.
The transform
Concepts are the key in our civilization for a correct understanding, and those concepts must be standardized for everybody. Before getting into the matter, basic concepts for standardization will be implemented. This chapter refers to the meaning of transform in the Wavelet transform (WT) part. Transform can have lot of different meanings but in mathematics it is an operation that takes a function or a sequence and maps it into another representation [68].
Transforms are elemental operations because they may give additional or hidden information of the original function unavailable before. They can also be important in the solution of problems in which by applying a transform it may be easier to solve. In communication transforms of sequence can achieve less storage providing data compression. Some operations can be easier applied on the transformed function rather than in the original one which provides faster computational analysis.
In history, the first signal transform described was the Fourier Transform. The 21th of December in 1807, Fourier stated that “An arbitrary function, continuous or with discontinuities, defined in a finite interval by an arbitrarily capricious graph can always be expressed as a sum of sinusoids” [68]. With this Fourier proved that complex function representation can be done by simple building blocks. In the Fourier Transform (FT) this simple building blocks are sinusoids which transform the function into frequency domain representations.
݁ ఠ௧ ൌ
ሺ߱ݐሻ ݆݊݅ݏሺ߱ݐሻ
(2.2)
This complex exponential are used as building blocks in which for each frequency of complex exponential, the sinusoid at that frequency is compared to the signal. If
43
the signal consist of that frequency large FT coefficients are obtained otherwise, the correlation at that frequency is low or zero [69].
ܨሺ߱ሻ ൌ ݂ ሺݐሻ݁ ିఠ௧ ݀ݐ
(2.3)
FT identifies all spectral components present in the signal, but it doesn’t provide information about the temporal localization of the components. For stationary signals where all spectral components exist at all times and therefore there’s no need to know any time information, FT works perfectly [Figure 2.23].
(a)
(b)
Fig. 2.23 a) Stationary Signal with three frequency components. b) Its Fourier Transform [69]
But in signals which are non-stationary, such as the ECG, there is a perfect knowledge of what frequencies exist in the signal, but it is impossible to find out which spectral component appears at a certain time location [Figure 2.24].
44
(a)
(b)
Fig. 2.24 a) Non-Stationary Signal with three frequency components at varying times. b) Its Fourier Transform [69].
This particularity can be solved with a time-frequency representation (TFR) of the non-stationary signal. This representation of a local analysis scheme is composed of a windowed FT or better known as Short Time FT (STFT). It consists of segmenting the signal into narrow time intervals, narrowing enough to be considered stationary, and take the Fourier transform of each segment [70][Equation 2.4]. With this technique, each FT provides spectral information of a separated time-slice of the signal, providing simultaneous time and frequency information.
ܵܶܶܨ௫ఠ ሺ ݐᇱ ǡ ߱ሻ ൌ ௧ ሾݔሺݐሻ ή ܹሺ ݐെ ݐᇱ ሻሿ ή ݁ ିఠ௧ ݀ݐ
(2.4)
But there is one more new problem, the Heisenberg principle [Equation 2.5]. This principle states the inequality between the time resolution (how well two spikes in time can be separated from each other in the transform domain) and the frequency resolution (how well two spectral components can be separated from each other in the transform domain) [71].
ଵ
ο ݐή ο݂ ସగ
(2.5) 45
Therefore, in non-stationary signals the window should be narrow enough to ensure that the portion of the signal in the window is stationary. This gives good time resolution but poor frequency resolution. And with wider windows high frequency resolution and low time resolution are acquired. Once the window is set, the resolution is chosen for both time and frequency. The Heisenberg uncertainty principle limits the resolution because both time and frequency can’t be arbitrarily high consequently, it can’t be known at what time instance a frequency component is located, only what interval of frequencies are present in which time interval.
To overcome this problem, Morlet proposed to use a variable length window in which each window would analyze different frequencies. Narrow windows would analyze high frequencies achieving better time resolution. Wider windows would analyze low frequencies, achieving better frequency resolution [68]. This works perfectly with signals of slow varying characteristics with occasional high frequency bursts (just as the ECG). This function used to window the signal is called Wavelet.
2.2.2.
Wavelet through time
Looking back in history, in 1807 Fourier states that all periodic functions can be expressed as weighted sum of trigonometric functions. This publication was denied by Lagrange, Legendre and Laplace until 1822 when the publication was finally published [68]. 143 years later in 1965, Cooley & Tukey implemented the Fast Fourier Transform.
In 1946, Denis Gabor implement the Short Time Fourier Transform in which high frequency components where analyzed by using a narrow window and low frequency components where analyzed with wider windows, but not both. Then in late 1970s, the geophysical engineer Morlet fronted a Time-Frequency analysis problem of signals with high frequency components for short time spans and low frequency 46
components with long time spans. STFT can solve one, or the other but not both, so Morlet proposed the solution of using different windows functions of the signal with different frequency content. These windows were generated to be dilated or compressed as oscillatory signals (wavelets). Due to the lack of mathematical rigor this method was condemned until early 1980s where the theoretical physicist Grossman formalized the transform and devised the inverse transformation in the First Wavelet Transform [68].
Since then, Wavelet Transform became an important tool in signal analysis. With the works stated by Alberto Calderon in 1964 on harmonic analysis, Yeves Meyer, noticed a similarity between Morlet’s and Calderon’s work in 1984. The redundancy in Morlet’s choice of basis functions leads Meyer to the creation of the orthogonal wavelet basis functions with better time and frequency location.
By this time, the rediscovery of the Harmonic Analyst J.O. Stromberg work on the same basis functions in 1980 and the rediscovery of Alfred Haar work in 1909 on orthogonal basis functions lead into the creation of the simplest known orthonormal wavelets. Then, Ingrid Daubechies discretization of time and scale parameters allowed the first attempt to create the Discrete Wavelet Transform (DWT). Her work in wavelet frames (1986), orthonormal bases of compactly supported wavelets (Db wavelets in 1988) and the liberty in the choice of basis functions at expense of redundancy are her most notorious contributions in the wavelet history [72].
In 1986, Stephane Mallat along Mayer created the multiresolution analysis. Then he formalized the DWT into a cascade algorithm for computing it. Between 1986 and 1992, Martin Vetterli & Jelena Kovacevic created the link between wavelets and filter banks, the perfect reconstruction of signals using FIR filter banks, the subband coding and the multidimensional filter bank.
47
During 1990s, new contributions on Wavelet Theory was done including the equivalence of Quadrature Mirror Filters (QMF) and Dyadic Frequencies (MRA) by Albert Cohen in 1990; the compactly supported biorthogonal wavelet by Cohen, Daubechies and J. Feauveau in 1993; Wavelet Packets by Coifman, Meyer and Wickerhauser in 1996; and the zero tree coding by Schapiro between 1993 and 1999.
The actual research work in wavelet analysis is the zero crossing representation for signal classification, computer vision, data compression and denosing; the creation of super wavelets which are linear combination of known basic wavelets; the zero tree coding by Schapiro; the Matching Pursuit which uses a library of basis functions for decomposition by Mallat; and new Moving Picture Experts Group (MPEG) standards [68].
2.2.3.
Wavelet definition
It can be noticed by now how does the wavelet theory evolved, but it hasn’t been formally introduced. Wavelet Transform is a mathematical tool that converts a signal into a different form. The goal of this conversion is to reveal characteristics or features hidden in the original and represent them succinctly. In order to achieve this, a base wavelet (mother wavelet) is needed to implement a wavelet transform. A wavelet is a small wave that has an oscillating wavelike characteristic and has its energy concentrated in time [73] [Figure 2.25].
48
Fig. 2.25 Wavelet Families (a) Haar. (b) Daubechies4. (c) Coiflet1. (d) Symlet2. (e) Meyer. (f) Morlet. (g) Mexican Hat [74].
The difference between a wave and a wavelet is that a wave is usually smooth and regular in shape and can be everlasting, while the wavelet may be irregular in shape, and normally lasts only for a limited period of time. A wave is typically used as a deterministic template for representing a signal that is time-invariant or stationary. In the other hand a wavelet serve as both deterministic and nondeterministic template for analyzing time-varying or non-stationary signals by decomposing the signal into a 2D, time-frequency domain [73].
The wavelet analysis is done similar to the STFT analysis. The signal to be analyzed is multiplied with a wavelet function and then the transform is computed for each segment generated. However, in Wavelet Transform, the width of the wavelet function changes with each spectral component [74]. It still has the oscillating wavelike characteristic but also has the ability to allow simultaneous time and frequency analysis with a flexible mathematical foundation [75].
Mathematically a wavelet is a square integrable function ߰ሺݐሻ that satisfies the
admissibility condition [73]:
49
ஶ ȁఅሺሻȁమ
ିஶ
ሺሻ
݂݀ ൏ λ
(2.6)
ߖሺ݂ሻ is the Fourier transform of the wavelet function ߰ሺݐሻ. The admissibility
function condition indicates that the Fourier transform of the function ߰ሺݐሻ vanishes at
the zero frequency:
ȁȁߖሺ݂ሻȁଶ ȁୀ ൌ Ͳ
(2.7)
This means that the wavelet must have a band-pass like spectrum. A zero at the zero frequency also means that the average value of the wavelet ߰ሺݐሻ in the time
domain is zero implying that the wavelet must be oscillatory in nature.
ஶ
ିஶ ߰ሺݐሻ݀ ݐൌ Ͳ
(2.8)
A wavelet must have a dilatation and translation process in order to achieve its purposes in the transformation. Therefore a family of scaled and translated wavelets can be obtained as:
߰௦ǡ௧ ሺݐሻ ൌ
ଵ
ξ௦
௧ିఛ
߰ቀ
௦
ቁ ǡ ݏ Ͳǡ ܴ߬߳
In order to satisfy the admissibility condition, the factor
ଵ
ξ௦
(2.9)
ensures that the energy
of the wavelet family remains the same under different scales. Equation 2.10 exemplifies that the energy is the same on a family of wavelets.
ஶ
ଵ
௧ିఛ
ߝ ᇱ ൌ ିஶ ቚ ௦ ߰ ቀ 50
ξ
௦
ଶ
ଵ
ஶ
௧
ଶ
ቁቚ ݀ ݐൌ ௦ ିஶ ቚ߰ ቀ௦ቁቚ ݀ ݐൌ ߝ
(2.10)
Graphically this dilatation and translation can be represented as scaling and translation parameters showed in the Figure 2.26.
Fig. 2.26 Translation and dilatation of a wavelet [73].
It was just stated that a Wavelet transforms acts as a Fourier transform changing the basis functions. In general wavelet transforms can be represented as Continue Wavelet Transform (CWT) and Discrete Wavelet Transform (DWT). The CWT of a signal x(t) is defined as:
ݐݓሺݏǡ ߬ሻ ൌ ௧ିఛ
Where ߰ כቀ ௧ିఛ
function ߰ ቀ
௦
௦
௧ିఛ ଵ ஶ ݔ ሺݐሻ߰ כቀ ௦ ቁ ݀ݐ ξ௦ ିஶ
(2.11)
ቁ is the complex conjugate of the scaled and shifted wavelet
ቁ. It can be noticed that the wavelet contains two parameters (scaling
and translation) this means that the signal transformed will be projected into a 2D, time-scale plane.
51
According to this definition, the CWT parameters can be varied continuously which lead into the generation of redundant information. The need for reducing redundancy in the wavelet coefficients among different scales avoiding sacrificing the information contained in the original signal can be achieve by parametric discretization commonly known as Discrete Wavelet Transform (DWT). This type of discretization is expressed as:
(2.12)
where the symbol Z denotes an integer. Applying this discretization the discretized wavelet can be defined as:
(2.13) At least, in general the values of ݏ ൌ ʹܽ݊݀߬ ൌ ͳ are adopted resulting in the
Discrete Wavelet transform definition of:
(2.14)
where the symbol ۃή ۄdenotes inner product operation.
52
2.2.4.
The Undecimated Wavelet Transform
It was just defined the Continue Wavelet Transform (CWT) and the Discrete Wavelet Transform (DWT) each one has its own characteristics, pros and cons. CWT can be varying continuously causing redundant information. This redundant information is useful in signal denoising and feature extraction where desired performance is achieved at the cost of increased computational time and memory size. In the other hand, decimation of coefficients in the DWT is an intrinsic property in which each decimation step removes other of the coefficients of each current level [73]. This decimation reduces computational cost making it faster and more compact in terms of storage space and more importantly, the signal can be reconstructed from such coefficient. The problem is the shift variance of the discrete wavelet transform. This means that the DWT of a signal won’t be the same as the signal shifted [76] [Figure 2.27].
Fig. 2.27 DWT Shift Variance
[76].
Therefore, in this thesis is proposed the use of the Undecimated Wavelet Transform (UWT). This Wavelet Transform combines characteristics from the CWT 53
and the UWT. In addition to the shift-invariance, the UWT gives increased amount of information about the transformed signal, compared to the DWT. With the UWT, the wavelet coefficients do not shrink between the transforms levels [76].
The real name of the undecimated wavelet transform is the redundant discrete wavelet transform (RDWT). It has received different names through the history such as the overcomplete DWT (OWDT) [77], the shift-invariant DWT (SIDWT) [78], and the discrete wavelet frames (DWFs) [79]. There are many ways to implement the UWT but the original one is in the form of algorithme à trous [79, 80] which removes [80] [81]
the downsampling operator from the common implementation of the DWT. In this implementation instead of signal downsampling, the filter responses are upsampled inserting holes between nonzero filter taps.
Let ݄ ݈ דଶ ሺܼሻ and ݃ ݈ דଶ ሺܼሻbe the scaling and the wavelet filters, the UWT scaling
filter at scale ݆ ͳ is defined recursively as [82]: ݄ାଵ ሾ݇ሿ ൌ ݄ ሾ݇ሿ ՛ ʹ ൌ ቊ
ೖ మ
ೕ ቂ ቃǡ௩ ǡௗௗ
ቋ
(2.15)
where݄ ሾ݇ሿ ൌ ݄ሾ݇ሿ. The wavelet filters ݃ ሾ݇ሿ are defined in the same way. The
UWT of ݈ א ݔଶ ሺܼሻ is also implemented recursively with the filter-bank operations: ܿାଵ ሾ݇ሿ ൌ ݄ ሾെ݇ሿ ܿ כ ሾ݇ሿ
(2.16)
݀ାଵ ሾ݇ሿ ൌ ݃ ሾെ݇ሿ ܿ כ ሾ݇ሿ
(2.17)
where ܿ ൌ ݔand ݆ ൌ Ͳǡ ǥ ǡ ܬെ ͳ. The J-scale UWT is ܺ ሺሻ ൌ ܷܹܶ ሾݔሿ ൌ
ሾܿ ݀ ǥ݀ଵ ሿ such that: 54
ଶ
ଶ
ฮܺ ሺሻ ฮ ൌ ฮܿ ฮ σୀଵฮ݀ ฮ
ଶ
(2.18)
Meanwhile, in the frequency domain can be obtained, ݄ ሺ߱ሻ ൌ ݄ ൫ʹ ߱൯ǡ ݃ො ሺ߱ሻ ൌ
݃ො ൫ʹ ߱൯,
ିଵ
ܿƸ ሺ߱ሻ ൌ ൣςఒୀ ݄ כ൫ʹఒ ߱൯൧ݔොሺ߱ሻ
(2.19)
כఒ ݀መ ሺ߱ሻ ൌ ݃ො כ൫ʹିଵ ߱൯ൣςିଶ ොሺ߱ሻ ఒୀ ݄ ൫ʹ ߱൯൧ݔ
(2.20)
In order to reconstruct x in the original signal domain given ܺ ሺሻ in the UWT
domain, a recursively synthesis operation must be performed:
ଵ
ܿ ሾ݇ሿ ൌ ൫݄ ሾ݇ሿ ܿ כାଵ ሾ݇ሿ݃ ሾ݇ሿ ݀ כାଵ ሾ݇ሿ൯ ଶ
(2.21)
Based on this mathematical implementation, an alternative application of the UWT was proposed by Shensa [83] and Beylkin [84]. This implementation employs filtering and downsampling as in the usual critically sampled DWT, then all phases of downsampled coefficients are retained and arranged as children of the signal that was decomposed. The process is repeated on all the low pass bands to achieve multiple decomposition scales (Multiscale) that forms a tree of decompositions [82] [Figure 2.28].
55
Fig. 2.28 UWT’s approximation and detail coefficients of a decomposition branched tree[85].
This decomposition returns the approximation coefficient at the largest level and the detail coefficients at all levels with a resultant UWT with a translation invariant property, which is helpful in robust feature extraction and pattern recognition [85].
In addition to the translation invariant property, the UWT gives increased amount of information about the transformed signal compared to the DWT and the number of wavelet coefficient does not shrink between the transforms levels allowing the signal’s analysis to obtain more information to understand the signal properties [76]. Figure 2.29 shows a denoising application in which the discrimination between the noise and the real data can be improved.
56
Fig. 2.29 DWT vs. UWT denoise.
Smoothness of the estimated ݔො for an Undecimated Wavelet Transform can be
guaranteed in the same way as for Continue Wavelet transform. Another important difference between CWT and UWT are the Signal to Noise Ratios (SNR). According to the work done by M. Lang et all in their paper “Noise reduction using a Undecimated Discrete Wavelet Transform” the SNR corresponding to the ideal risk of the UWT is better than that of Classical Wavelet Denoising (CWD) by 2-3 dB. Figure 2.30 depicts the resulting SNR after denoising (SNRout) for different SNR of a noisy signal (SNRin) [86].
57
Fig. 2.30 Improvement of the actual and ideal risk by using UWT for test signal “Doppler” [78].
All this information supports the decision of implementing the UWT in the algorithm for the QT interval measurement. Table 2.3 shows a resume of the different properties between each Wavelet transforms.
Table 2.3 UWT, CWT and DWT property comparison. NA= Not Applicable Property UWT CWT DWT Time-Varying
X
X
Redundancy
X
X
Smoothness
X
X
NA
X
Varying continuously
X
NA NA
Shrinkage
58
NA X
Low computational cost Undecimation
X
Better SNR
X
Shift-Invariance
X
X
2.3. LabVIEW®
In the last few chapters it has been shown the background, the state of the art and all the theory about the methods implemented in the algorithm and the program. In this chapter the software used for this application will be explained. LabVIEW® is a graphical programming language for developing diverse applications. The block diagram provides a unique form of source code that is dissimilar to most programming languages [87]. Its graphical nature makes it ideal for test, measurements, automation, instrument control, data acquisition, and data analysis application. It is used as a powerful tool that improves efficiency and productivity in various situations [88]. For Engineers, LabVIEW® makes it possible to bring information from the outside world into a computer, make decisions and send the results back into the world to control the equipment [89].
2.3.1.
The beginning of LabVIEW®
In 1986, National Instruments conceived a practical and original programming environment for the Apple Macintosh. It was meant for hardware control and interfacing with host computer which aim was the introduction of an easy interface between a micro-computer and the instruments controlled by it, with a graphical interface that simulates the instruments on the computer screen which derivate on the term of “Virtual Instrument” [90]. A Virtual Instrument (VI) is a LabVIEW® programming element that consists of a frontal panel, block diagram, and an icon that represents the program. Therefore, the meaning of LabVIEW® comes from Laboratory Virtual Instrument Engineering Workbench [88].
It started in 1976, when Dr. James Truchard work on the first product begins in his garage in Austin Texas and founded NI. A year later NI announced its first GPIB to connect scientific instruments to microcomputers when the Kelly Air Force Base of 59
San Antonio becomes the company’s first costumer. Two years later, Dr. Truchard joined NI as a full-time employee. In 1980 Jeff Kodosky and Bill Nowlin joined NI as full-time employees and by 1986, NI developed LabVIEW®. Two years after the develop of its graphical software, NI announced its first plug-in data acquisition board for IBM PC users. In this decade it opened offices in Japan, France, U.K. and Italy.
In the 1990’s NI launched a web site and instrumentation web as an extension of its direct sales model and information source for engineers and scientists and launched PXI, creating an open industry standard for modular computer-based systems. NI opened 27 branch offices by then world width. In the last decade, NI opened its first manufacturing facility in Debrecen, Hungary. Then in 2004, it introduced NI CompactRIO a high-performance embedded control and acquisition platform powered by reconfigurable I/O (RIO) technology. Since 1999 NI is included in FORTUNE magazine’s annual “100 Best Companies to Work For” list and in 2009 achieved its 10th consecutive year.
National Instruments is nowadays a multinational corporation with more than 5,200 employees with off-the-shelf software and cost-effective modular hardware transforming the way engineers and scientists do their jobs all around the world [91].
2.3.2.
LabVIEW® at the forefront
As mentioned before, LabVIEW® is as a powerful tool that improves efficiency and productivity in several distinct fields such as engineering, chemistry, physics, fault diagnosis and medicine. It is portable, being able to run on multiple devices and operation systems. Tools specific to different targets such as industrial computers with real time operating systems (PXI), programmable automation controllers (CompactRIO), PDAs, microcontrollers or field-programmable gate arrays (FPGA’s) are used and after that the compiled code is downloaded to the target.
60
Their built-in libraries and software drivers make the support and use of devices produced available for more than fifty companies including industrial instruments, oscilloscopes, multimeters and signal generators [92]. Engineers and scientists implement
LabVIEW®
in
countless
applications
worldwide
as
automotive,
telecommunications, aerospace, semiconductor, electronic design and production, process control, biomedical and others. Its flexibility and scalability make it suitable for research and design phases all the way to large scale manufacturing test processes interfacing with real-world signals, analyze data for meaningful information, share results and applications carrying on boost productivity [93].
Among the different applications LabVIEW® is mainly focused on: Ø Test and Measurements. Ø Process Control and Factory automation. Ø Machine monitoring and control. Ø Research and Analysis. Ø Control Design. Ø Academic.
Figure 2.31 shows the platforms and languages in which LabVIEW® develops nowadays worldwide.
61
Fig. 2.31 Platforms and Languages environments in which LabVIEW® is implemented [93].
2.3.3.
LabVIEW® Basic Programming
Now that a background has been settled, it is important to understand how does the program work and its internal components before describing the algorithm. The next modules describe a brief description of each component and what can be done with them.
2.3.3.1.
The HMI: The Frontal Panel
One of the main advantages for using LabVIEW® is its capability of implementing Human Machine Interfaces. When starting LabVIEW® it shows 2 windows, the frontal panel and the block diagram window. This module will describe the frontal panel task. The frontal panel is the window entrusted of the user’s interaction. In this panel, functional and design elements are arrange in order to fulfill specifications. Entries are required from the user to modify certain parameters depending on the programming specifications. It also allows users to visualize data in 62
wave graphs or indicators to give information about the system. Figure 2.32 shows an example of a frontal panel.
Fig. 2.32 Frontal Panel Example [94].
In the frontal panel different elements can be managed. Elements such as buttons, graphs, light indicators, backgrounds, logos, numeric controllers, lists, text indicators and more are available for control and display. It is recommended to keep a professional and highly organized appearance but the main issue is to be functional.
2.3.3.2.
Engineering in action: The Block Diagram
The block diagram is the hidden part of the program. In this window the programming is done by connecting the elements on it with wires and terminals. In the diagram block exists different sources and sinks where the information flows from 63
one to another in a concurrent computing form in which computational processes are executed in parallel. These sources and sinks are representations of the elements in the frontal panel that symbolizes the source code in which the programmer implements the tasks.
Figure 2.33 illustrates an example of a diagram block for a PI controller. In the dashed lines different sections of the programming code can be observed:
1. The input section in which the program acquire signal from the sensor. 2. The frontal panel’s controls representation in which user modifications are done. 3. The frontal panel’s indicators in which resulting data and processes are shown to the user. 4. The program processing element in which data is transform or processed in the expected programmed way. 5. The output section where according to the inputs and processes a response is generated to fulfill the program purpose.
64
Fig. 2.33 Diagram Block for a PI controller for a temperature control [89].
Therefore, the diagram block integrates all the aspects of programming by sinks, sources, cables and structures interconnected forming a programming arrangement called g-programming. LabVIEW® is not an interpreted language; it is compiled behind the scenes by its execution engine. These VIs are compiled into an executable code that LabVIEW®’s execution engine processes during runtime. Every time a change is made to a VI, it constructs a wire table for the VI. This wire table identifies elements in the block diagram that have inputs needed for that element to run.
2.3.3.3.
Controls, Indicators, Constants and Arrays
As explained before there are sinks and source in the block diagram that represent information used for the processes. In the frontal panel there are two types of sinks and source, the indicators and the controls respectively. Controls are 65
elements to entry data into the system. Figure 2.34 shows some of the few basic controls that can be used in LabVIEW®. These controls appear in the frontal panel and they provide data from the user.
Fig. 2.34 Text, Buttons, Switches and Numeric controls examples.
Indicators are the responsible to show the data processed and present it to the user. These indicators can be shown as in the controls in different presentation. Indicators can be simple LEDs, Text fields, Numeric fields or Graphs [Figure 2.35].
66
Fig. 2.35 Numeric, Text, LEDs and Graphs Indicators examples.
All of these elements are represented in the frontal panel via the control palette for user manipulation, and at the same time they represent information flowing in the block diagram. There are other elements which can be only visualized in the block diagram, these are the constant elements. In LabVIEW® each control, indicator or constant is represented by a type of data where each color indicates the type of data. To conceive a better performance in the program all data must be manipulated in a standardized data type. LabVIEW® also has operators that transform data from one type to another. Figure 2.36 shows the different data type each one with a constant element example.
67
Fig. 2.36 Different data type color representation for constants.
As can be appreciated before, all different elements have different colors depending on the data type. For example, it can be declared a constant numeric of double precision data type and a constant numeric of byte data type, both are numeric but each data type is different. It doesn’t mean operations between them can’t be performed but first a data conversion must be done. It is important to mention that there is one element that is compound of the integration of other elements, the cluster constant. This constant can be initialized with different type of data elements in order to reduce wiring complexity in programming. This constant composition is the introduction to another compound element, the arrays.
Clusters are compounded of different elements of different types, but there are other elements compounded which can only support same elements with the same data type. These compounds are indexed to keep a relation between them or a sequential application and are called arrays. Arrays can be of different dimensions and this dimension is represented in the diagram block with the width of the connection wire. Figure 2.37 shows an example of a cluster with different arrays representation for indicators and controls in the frontal panel. This cluster’s representation in the block diagram is showed and the different ways of recollecting 68
or re-wire inside cluster’s data with unbundle and bundle elements are displayed too. The bundle and unbundle elements are components that either can dissociate or associate elements in the cluster to modify the elements or read them. Once the cluster is defined, its composition can’t be changed.
Fig. 2.37 Cluster, Arrays, Bundles, Unbundles and Multidimensional array connections.
This figure also shows how different arrays do the connections for the different dimensions and how the wire’s width changes depending on the dimension.
2.3.3.4.
Function Palette and Programming Structures
Now that all the elements in the frontal panel and in the block diagram for entry and withdraw data have been explained, it is now important to find in the function palette the elements that help in the programming sequence to organize data flow, implement calculations and manipulate data in order to achieve the goals in the programming process.
69
The function palette consists of different components in which each category contains the elements that support help in the programming process. Each of these categories is specialized depending on the task to be implemented [Figure 4.9]. Inside of the categories there are sub-categories related to the main category selection. After the second sub-category there are elements to insert in the diagram block dragging them. These elements can be primitive operators or complex subVIs depending on the block. Figure 2.38 shows the sub-categories of the most commonly used categories for the algorithm implementation.
Fig. 2.38 Function Palette with Programming, Express, Signal Processing and Mathematics subcategories displayed.
In order to access to the function palette, the programmer needs to right-click on the block diagram window and start to look for the correct element to insert. Now that the palette function is located in this module will be explained the basic structure functions. This category is situated on the programming category and the subcategory of structures [Figure 2.39].
70
Fig. 2.39 The Programming Structure in the function palette.
Seven elements found in this category were used all over the program but in this section just 5 of them will be explained. As in code programming, LabVIEW® has structures that help in the manipulation of data and the decision taking. Figure 2.40 shows the different structures implemented.
Fig. 2.40 For Loop, While Loop, Case Structure, Event Structure and Stacked Sequence Structure.
71
All these structures, compared to code programming functions in which code was inside of brackets or parenthesis, acts in the way that whatever is inside the structure will be executed when/after certain instruction is realized. A basic explanation of these structures will be given now:
The For Loop Structure consists of 2 nodes, the count terminal and the iteration terminal. This structure will execute whatever is inside of it over and over until the number of repetitions reaches the number specified in the count terminal. The iteration terminal will show for each execution the number of cycle it is actually running.
The While Loop Structure consists of 2 nodes, the iteration terminal and the conditional terminal. The structure will be executed over and over until the conditional terminal receives a true value (specified by the user or the program itself). In the same way than the For Loop Structure, the iteration terminal will indicate the number of cycle in which the structure is being executed.
The Case Structure consists of just one node. This structure, as its name refers, handles the cases depending on what is connected on the selection terminal. In the upper section of the structure is the labeling tool in which programmer defines the cases or sub-diagrams to be executed depending on the value of the selection terminal. Right-click to the structure border is needed to add or delete cases according to the specifications.
The next structure is the Event Structure. This structure only has one node. This structure waits until an event happens and then it executes the appropriate case handled by the event. In the upper left corner a value has to be connected to the timeout terminal to specify how long the event structure must wait for an event to
72
occur. It is important to connect a specific value because the default is -1 and it won’t let the programmer to use this structure.
The last structure to be explained in this module is the Stacked Sequence Structure. This structure consists of frames that execute sequentially. In order to add/delete a frame it is important to right-click on the structure border. This structure is capable of using sequence locals nodes to pass data between frames. The order of the frame position will indicate how the cases will be executed.
All these structures explained in this module were implemented though the entire program for the QT interval measurement in order to achieve the complete structure of the program.
2.3.3.5.
Data Storage
It is important to mention that data in a program after processing must be stored somewhere and not only the visualization of the results is important. In this section the functions used for the storage of the result will be explained. Figure 2.41 illustrate its location on the function palette in the block diagram window.
73
Fig. 2.41 File I/O Sub-Category on the Programming Category in the Function Palette.
There are different ways for storing data using the elements in this category, but it all depends on what kind of information is being manipulated. All the methods described here [Figure 2.42], excepting the first one, need a path file where the name and the extension of the proposed file must be specified.
Fig. 2.42 Storing Data Methods.
The first method is the automatic one called Write to Measurement File. This automatic implementation implements a wizard assistant where the storage characteristics of the data must be filled. This method is limited in file extension
74
selection but works perfectly for fast data storage. The second is the write to spreadsheet file function. This VI stores data of a 1D and 2D array in the selected path with a specified extension as a spreadsheet. In a continue data acquisition this function is useful but two conditions must be done; a feedback node is required between the new file path terminal at the right part of the block and the file path terminal in the left part of the block; and a true value in the append to file terminal.
The third and fourth methods are similar. They have a path terminal where the file name and file extension are declared. Each of them needs three declarations, in which the first one replaces or creates the file. The second declaration writes the data into the file. The third method writes the data as a string input while the fourth method writes it as a binary data. At last the methods need to close the file to assure the end of the process.
The last method is not presented in the Programming File I/O category, but it was also used to store waveforms. In LabVIEW®, signal’s waveform can be stored as special clusters with four parameters (initial time of waveform, sample interval dt, data array and signal attributes). This waveform can be saved with a file path where the file name and extension are declared. This method is located in the Programming category; Waveform sub-category; and waveform file I/O options select the write to file method.
With these methods signals are stored, and with some others this information can be retrieve using similar methods explained here. Figure 2.43 shows the counterpart of the storage method but for the reading implementation. It won’t be necessary to explain these methods again because they function as similar as the storing methods.
75
Fig. 2.43 Reading methods from a stored file.
2.3.3.6.
Modular
Programming
(Local
variables,
Global
variables and SubVIs)
Few modules before, how structures work was described. It was also mentioned that only 5 of the 7 elements used in the program for that category were described in that module. In this module the left elements will be defined because they are basis for modular programming. First let conceive the idea that each control or indicator in the frontal panel is a variable in which the user or the program itself, controls the value it takes. Now, this idea of variable is normally stated on code programming by a declaration, but in LabVIEW® this declaration is done by placing the element in the frontal panel. Each time the programmer wires a control or an indicator the value on it is read or written. The issue with LabVIEW® is that the variable calling must be done graphically. It is then, when the local variable or global variable elements in the programming structure category are used [Figure 2.44].
The difference between local and global variable is the declaration. While the local variable is declared in the VI’s frontal panel, the global variable is declared in a special VI. This special VI consists of only the frontal panel window, without block diagram window in which different controls and indicators can be placed. These indicators represent the global variables. Another difference is that local variables are 76
only shared with the VI where they are declared while the global variables can be called from any VI.
Fig. 2.44 Block Diagram window with Local and Global variables. Frontal Panel of the VI showing the indicators. Global VI.
The next step in modular programming is the implementation of SubVIs. Complex programming can result in extraordinary large g-programming code. To keep the program in an understandable structure SubVIs are required. In code programming SubVIs can be compared as function which receive certain input data and are programmed to implement a task and return an output. In LabVIEW® it functions in the same way but graphically. After creating a normal VI with specific controls and indicators it can be converted into a SubVI by declaring which controls act as inputs and which act as output. This can be done by right-clicking on the upper right corner of the frontal panel where a like oscilloscope icon is displayed and selecting show connectors. Then a pattern will be displayed in the icon where the programmer needs to select each terminal and link them to a control or indicator in the frontal panel.
77
After terminal declaration it is recommended to right-click in the pattern icon and edits the icon into a known figure to distinguish the sub-VI. When the edition is done and the SubVI is saved, the programmer need to call the SubVI in the block diagram to be implemented. This calling is done as with normal elements in which the category for SubVI is Select a VI... Once the SubVI is in the block diagram it is important to connect it with the proper wiring. In some cases it is important to visualize de frontal panel of the SubVI therefore, by right-clicking on the SubVI block and selecting SubVI node setup will configure this implementation. Figure 2.45 shows the different steps to create a SubVI.
Fig. 2.45 Steps for creating a SubVI.
2.3.3.7.
Property reference nodes
Something fundamental in LabVIEW® programming is its capability to modify frontal panel elements’ properties. This advantage provides the programmer with a complementary tool for frontal panel’s manipulation. LabVIEW® assigns to each element in the frontal panel a reference. Using this reference the program can 78
allocate which element to modify. This reference is obtained in the programming application control category on the block diagram’s function palette. Then this reference is wired to a property reference node located in the same category. While doing, the programming, programmers must define which property is intended to modify. Table 2.4 shows some of the most important properties that can be modified programmatically.
Table 2.4 Some property descriptions. Property
Description
Disable
Indicates if control can be operated: Enabled, Disabled, Disabled and Grayed Out.
Value
Value of the element.
Visible
Displays the front panel control.
Value (signaling)
Sets the value of the control and generates a Value Change event.
Position
Position of the top left corner of the bounding rectangle of the object of the frontal panel window in terms of left top coordinates.
After properties’ selection a close reference element must be placed to end properties’ modifications session. Figure 2.46 shows a programmatically properties’ modifications in which disable, value and position properties are modified programmatically and its visualization on the frontal panel.
Fig. 2.46 Properties modifications (reference, values, property node and end reference) and its visualization on the frontal panel.
79
2.3.3.8.
Programming design patterns
The programming design patterns are the base in which the program performs its operations. According to the complexity of the entire program and the computational cost, program’s architecture must be proposed. These architectures solve common software design problems. They are arrangements of structures, functions, controls and even error handlers that form a generic construct for common task such as loops, event handlers, state transitions, data sharing and encapsulation. These patterns are available as templates, for achieving reuse, productivity and quality. Combined with additional SubVIs, controls, utilities and libraries, patterns can form application frameworks [87].
Design patterns promote good programming style and standardization. Correct standardization can be traduced as an easier way for developers to recognize, understand, maintain and reuse codes. Table 2.5 shows some programming methods than will later be explained.
Table 2.5 Summary of the Design patterns and application frameworks [87]. Pattern Design Immediate SubVI Functional Global Continuous Loop Classic State Machine Queued State Machine
80
Sub-VI
Simple Complexity
Medium Complexity
Desktop OS
RealTime OS
EventDriven
Inefficient/ Polling
Immediate SubVI design pattern consists of nodes and error trapping. There are not continuous loops, dialog windows or GUI panel. This pattern executes its code straight through completion in the order in which the error cluster propagates. Error trapping is incorporated as an error case structure for skipping the diagram if an error is detected. It is very common to implement in SubVI’s [Figure 2.47].
Fig. 2.47 Immediate SubVI design pattern.
Functional Global design pattern consist of a SubVI that contains a while loop, a case structure, an enumeration, and controls for reading and writing data. A Boolean constant is connected to its conditional terminal, forcing it to stop after one iteration. The loop’s purpose is to store data into shift registers. Shift registers are values that pass from iteration to iteration. The case structure separates cases for writing or reading data in the shift registers. Cases for initializing, resizing, performing calculations or data manipulation can be added. The enumeration provides the programmatic selection for the supported operations. This subVI structures can be resembled to a global variable [Figure 2.48] [87]. 81
Fig. 2.48 Functional global with while loop, shift registers, case structure and error propagation.
The continuous loop design pattern consists of a while loop, shift registers and error trapping. Multiple criteria for loop condition must be used to make certain that the loop terminates gracefully. Never use the abort execution tool as means of terminating a continuous loop design. It is recommended to use a wait (ms) function incorporating a delay within continuous while loops. This yields of the execution thread allowing the loop to sleep for a number of milliseconds within each iteration. The wait (ms) function allows parallel task to execute and improves the overall performance and responsiveness of the application [Figure 2.49]. A timed loop can be used instead of the while loop to achieve highly precise or complex timing requirements for deterministic applications [87].
82
Fig. 2.49 Continuous loop template with while loop, error handling, shift register, timing and several loop terminal conditions.
States machines are the most highly publicized design pattern all over time. There are many variations in which most of them consist of a case structure within a while loop with shift registers and messaging construct wired to the case selection terminal. Each state corresponds to a case state in the application. The shift register passes the next state selection from a previous case to the selector terminal in the next loop iteration [Figure 2.50] [87].
83
Fig. 2.50 State Machine Design pattern. Each case in the Case Structure corresponds to a state in the application.
2.3.3.8.a. LabVIEW® Queued State Machine Architecture
Queued State Machine design pattern deserves a special mention because this architecture was the one used for programming the whole QT interval program. This alternative state machine implementation utilize queues and event structures for a more functional and efficient application.
The classic state machine design pattern’s method of state transition is limited to one new state specified per loop. But in medium or greater complexity, it is often desirable to buffer multiple states that comprise a sequence and execute at a time. The Queued State Machine design pattern (QSM) uses a queue to buffer multiple states. Any state of the application can add any number of new states to the end of the queue using calls to the Enqueue Element Function. States are then removed from the queue one element at a time and passes to the case selector using the 84
Dequeue Element function. This is similar to a FIFO buffer. An Enqueue element can be placed at the end to add a state to the front of the buffer for immediate execution. This allows the application to respond immediately to high-priority actions or events [87].
Figure 2.51 shows the general architecture of a QSM design pattern, which in the QT interval program generally consists of three parts: the initial part, the consumer part and the producer part.
Fig. 2.51 Queued State Machine Architecture.
The initial part consists of the initialization of the queues. In this part is stated the name of the queue reference and there is also assigned the first state to go into the program [Figure 2.52].
85
Fig. 2.52 Queue Initialization.
After the initialization is done the reference data is divided in two sections. The first goes to the consumer part and the second to the producer part. In the consumer part the queue is Dequeue and is implemented in the case selection terminal. Inside this case structure what is stated to be done is implemented and then the next state is assigned [Figure 2.53]. If there’s no other state expected then the state machines passes to a default state in which an event must occur to continue the process.
Fig. 2.53 Consumer part of the QSM architecture.
86
The second section goes to the producer part. When the consumer part is in the default state, it is expecting the producer to Enqueue for a state to produce. These events are triggered by actions in the frontal panel done by the user. Figure 2.54 shows an example of a producer part in a QSM in which when the mouse is down on this button it enqueues for the consumer to go to the state defined for that action.
Fig. 2.54 Producer part in the QSM design pattern.
All the different VIs and SubVIs implemented all over the QT program were created using QSM architecture. The first state in which the program starts is the initial state. In this state all parameters for background, position and initial values were described. Then next state was proposed. If the state was default, then the program waits until an event occur to do the next state. At the end of the program the exit method implements the shutdown procedure and ends the program. Next chapter describe the whole program and the different Vis that conforms it.
87
88
Chapter 3- The QT measurement program [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94]
Previews chapters were only the beginning in order to achieve a good introductory and standardization knowledge for this chapter, the main chapter of the thesis. In this chapter the different subVIs and VIs are going to be described one by one. There will be just a general description of each VI with only a deeper explanation on the QRS Complex detection and QT interval measurement methods. For further detail on a specific VI, please refer to appendix A in which a link to the files will be given.
3.1. Quantitative introduction structure
As the title explains a quantitative introduction will be given in order to understand the overall of this program. By quantitative, it is meant the structure. The whole program includes 62 SubVIs in which each SubVI is assigned to a specific task. Table 3.1 shows the internal structure of the whole program. It is important to be mentioned that not all the programs included in the QT-interval algorithm have frontal panel.
Table 3.1 Total program’s integration. VI
Number
Have Frontal Panel?
Main VI
1
No
Phases VIs
10
Yes
Global Variables Vis
2
No
SubVIs
6
Yes
Functional Vis
43
No
89
3.2. Hierarchy
All the VIs are linked by different ways and arranged in a specific sequence in order to achieve all the purposes. This connection between them is called the hierarchy of the project. Figure 3.1 shows the global hierarchy in which the QTinterval program is being performed.
Fig. 3.1 QT-Interval Hierarchy in which the program is being structured showing the different phases.
These phases compound each of the structures inside the program, and each structure is represented by frontal panels, SubVIs or other elements that together integrates all the elements functions to achieve and specific task. Figure 3.2 shows the hierarchy of only one phase (from the acquisition phase, explained later). The whole chapter will explain the sequence in which each phase is involved in the whole QT-interval measurement.
90
Fig. 3.2 Hierarchy expansion of the acquisition phase in the algorithm for the automatic measurement of the QT-interval.
3.3. Program description
(Main.vi)
The algorithm for the automatic measurement of the QT-interval was developed using different SubVI linked together. This arrangement demands the program to follow certain coherent structure and methodology to achieve the required conditions. Figure 3.3 explains in general how the program develops each time it runs.
91
Fig. 3.3 General Description of the QT-interval program.
First the Main VI must run. This VI doesn’t have frontal panel but it is in charge of the sequence of all the other VIs. When this VI is finished it means that the whole program is already over. As mentioned in last chapter the QSM architecture is designed by states, for the Main VI each phase is represented by a state [Figure 3.4].
Fig. 3.4 Main VI diagram window in which each state indicates a phase in the program.
The program therefore is divided by phases. Each phase is represented in the frontal panel by its background. Blue backgrounds are acquisition phase’s VIs, green backgrounds are conditioning phase’s VIs and at last Black/White or other 92
backgrounds are from the Menu phase. Now, each subVI that integrates the phases will be explained including the information about how the Undecimated Wavelet Transform is implemented for the automatic measurement of the QT-interval.
____________________________________________________________________ 3.3.1. Acquisition phase
(Acq.vi)
When the program starts, the acquisition phase is the first phase to run. This SubVI has frontal panel in which the program’s information, date and title are displayed [Figure 3.5]. Through this phase the user is guided to acquire data from different sources. The acquisition can be done by acquiring data from the equipment in real-time or by data previously recorded and stored in files. This first SubVI lets the user to choose between acquisition with equipment and acquisition with data base file. From this VI the user selects where to acquire data. First Acquisition for equipment will be explained.
93
Fig. 3.5 Frontal Panel of the Acquisition phase.
3.3.1.A. Data Acquisition from Equipment
When left-clicking in the image on the Data acquisition mode for equipment user is selecting acquire data from equipment. Figure 3.6 shows the procedure to follow in the data acquisition from equipment.
Fig. 3.6 Data acquisition from equipment flow chart.
After clicking, the first VI to run is the Patient’s Information VI.
94
3.3.1.A.1.
Patient’s information
(PatData.vi)
Fig. 3.7 Patient’s information Frontal Panel.
This VI acquires Patient’s name, age, gender and includes some description. If important data as name is incomplete, it returns an error and it doesn’t let user to continue. It also detects if an incorrect character is entered, this occurs because patient’s name is used to create a folder in which all the information will be stored and if a character in the name is not allowed by the OS this folder can be created. After all the data is input, user can continue with the equipment selection.
3.3.1.A.2.
Equipment Selection
(Equipment.vi)
After patient’s information input the user must select which equipment will use for the acquisition. This VI allows the user to select between acquiring data from Holter or a 12 lead electrocardiograph. Figure 3.8 shows the frontal panel of the Equipment VI.
95
Fig. 3.8 Frontal Panel from the equipment selection VI.
In this VI a brief description of the equipment is also given when the mouse is over the equipment’s figure. To select equipment, the user must click on the equipment’s image. Now equipment’s VI will be explained.
Ø Holter Equipment
(Holter.VI)
This VI is used to acquire data from a Holter’s equipment. Figure 3.9 shows the frontal panel of this VI.
96
Fig. 3.9 Holter’s VI Frontal Panel.
1. Description
This VI’s frontal panel is divided in different sections. The equipment allows the user to acquire 3 leads at the same time. It acquires the signal from the patient and sends it through RF to a receiver. The acquisition is done with 500 samples per second per lead. This receiver is connected then by serial port to the CPU. Data is sent in the order shown by Figure 3.10.
Fig. 3.10 Holter’s data Structure.
In the black area of the frontal panel, the signals being acquired in real-time are displayed. In the upper right corner the frontal panel shows the battery indicator. The user needs to specify how the lead’s connections of the Holter were done in the lead area. The user also needs to specify the port in which the receiver is connected.
97
2. Modes
There are two modes in which Holter’s acquisition can be done. One way is done continuously, where data is acquired until the stop button is pressed. The other is done by entering an acquiring time. After reaching the acquiring time the program stops. After finished, the acquisition phase is done and then it creates in the patient’s folder a header’s file, a Holter’s file, leads’ files and battery’s file. Then, the program starts the conditioning phase.
Ø ECG Equipment
(ECG.vi)
The other equipment is a 12 lead ECG. This VI acquires signal from an equipment that is connected to the computer with a multifunctional data acquisition device (DAQ) of National Instrument. With this device connectivity between the equipment and LabVIEW® is done with a DAQ assistance element. Figure 3.11 shows the Frontal Panel of the ECG VI that allows the user to acquire signals from the 12 leads ECG equipment.
98
Fig. 3.11 Frontal Panel of the VI for acquisition with the 12 leads ECG equipment.
3. Description
This VI allows the user to visualize the data being acquired in real-time with the twelve graphs displayed in the lower part of the VI. As in the Holter’s VI user can select which leads to be acquired and analyzed. It can acquire up to 20 minutes of 12 leads signals simultaneously, with start and stop buttons. It also contains a real time indicator in which the program shows the acquisition time.
4. Modes
This VI can be run in two modes with marks or without marks. Without marks is the normal operation mode in which the signal is acquired with the time selected by the user in the acquiring time control and then it is stored. The mark mode is selected with the check box, and it then modifies the frontal panel [Figure 3.12].
99
Fig. 3.12 Frontal Panel’s modification for marked 12 leads ECG equipment.
This modification consists on adding a marking button, marking time indicator and number of mark indicator. These changes were added in order to fulfill the requirements purposed by the INC for a squatted challenge test that will be explained later.
Once finished the acquisition the program ends the acquisition phase and changes to the conditioning phase. If marked mode was selected, before going to the conditioning phase it will show first the marking VI that will allow the user changes in the marks. This marking VI will be explained later also as part of the acquisition phase.
3.3.1.B. Load Data
(Database.vi)
When left-clicking in the image on the Data acquisition mode for Data Base, user is selecting acquire data from a file. Figure 3.13 shows the different files that can be loaded.
100
Fig. 3.13 Files that can be loaded.
This VI can load files from the INC or from the Physionet data base. After loading these files, the program decode them and store the data in a recognized extension. It can also load data from previously acquired files from the Holter or the 12 leads equipment. At last it can load data from previously decoded files from the INC or Physionet. Figure 3.14 shows the Frontal panel of the Data Base VI.
Fig. 3.14 Frontal Panel for the loading file VI.
This VI has a load file control where a path is input. If the loading is incorrect the status indicator will notify the user. The file content is used for Physionet data base in order to select the possible leads to load. When decoding information from data base files that haven’t been previously decoded, a graph indicator will be shown during the process to show the user how the decoding is done [Figure 3.15].
101
Fig. 3.15 Frontal Panel of the loading signal VI loading a MIT-BIH database.
After loading the files and characteristics from the header file the program proceeds to the conditioning phase. There is an exception, if the loaded file from the 12 leads equipment’s file notices that it was a marked acquisition the marking VI will be shown before the program ends the acquisition phase. Marking implementation will be described now as before ending the acquisition phase.
3.3.1.C. Marks
(Marks.vi)
When selecting the marking mode in the 12 leads ECG equipment it consists to insert marks while doing the acquisition. The purpose of these marks is to know a special status in the acquisition for a squatted challenge done by the INC. Figure 3.16 shows the Frontal panel of the marking Virtual Instrument.
102
Fig. 3.16 Frontal Panel of the Mark Virtual Instrument.
3.3.1.C.1.
Squatted Description
The challenge done by the INC consists of suiting the patient in certain position and change that position during acquisition in order to understand how patient’s heart responds to certain stimulation. Figure 3.17 shows the different positions and desired times for each period in the challenge. Each color represents a position of the squatted challenge.
Fig. 3.17 Squatted Challenge desired positions and times.
103
Before starting the acquisition and the challenge (this is the first mark) the patient is told to acquire a resting position. During the first period of time (red part) the patient stays in that position until the marking time indicates the desired time. Then the physiologist marks that moment and demands the patient to change position. During the transition, the equipment continues acquiring data but this data won’t be considered for analysis. After reached the second position, the physiologist marks again and a second period starts (green part). Ones achieved again the desired time, the physiologist marks again and demands the patient to change to a squatted position. When the patient reaches the position, the physiologist marks again and starts the blue part of the challenge. At least the physiologist marks one last time and the patient must acquire the last position of the challenge. The purpose of this challenge consists of analyze the different phases in the challenge and compare measurements in order to detect variability between positions.
Therefore, this VI allows the user to modify the marks recorded in order to achieve an accurate position of the marks in the signal acquired for the challenge.
3.3.2. Conditioning phase
(COND.vi)
Now, the acquisition phase is already over and the program knows which signals are going to be used for the measurement of the QT interval. By this phase the program has loaded data and the first analysis will be done. Specifically the conditioning done in this phase is the QRS complex detection. Based on this detection, next steps will be built, therefore it is important to achieve a perfect detection in this phase.
104
3.3.2.A. Description
Figure 3.18 shows the frontal panel of the conditioning phase. It can be noticed that the background has already changed. In the central part a graph indicator is displayed in order to display how the conditioning is being developed. In the back part the duration of the whole signals is shown and in the right section, leads to be processed are displayed. When finished, the conditioning phase will generate a *.val file in which all the indexes of each lead’s QRS detection are stored. In this file is also stored the R-R interval between each index and the R-R average. If a signal has already been analyzed a skip button is shown letting the user to pass to the next phase if not, conditioning must be done.
Fig. 3.18 Conditioning’s phase frontal panel.
3.3.2.B. Diagram
The methodology used to achieve this conditioning is important to be mentioned. Figure 3.19 refers to the diagram window of the conditioning phase. 105
Fig. 3.19 Diagram Window of the Conditioning Phase.
It can be shown that as stated before the architecture used is from a QSMarchitecture. The initial section implements the initial conditions of the VI as positions, background, initial values and initial properties of the indicators/controls in the frontal panel. Then, this VI loads each lead signal and waits until the user desires to start the conditioning.
There are two ways to do the conditioning: the automatic and the manual. The automatic, as its name states changes lead by lead analysis without any influence of the user. When it finishes the analysis of one lead it passes automatically to the next lead. In the other hand, without the auto check box clicked, the manual way needs the
106
authorization of the user to start the next analysis. The analysis done by this phase will be now explained.
3.3.2.C. UWT Analysis for QRS Complex (theory)
Thakor et al., in their work “Estimation of QRS complex power spectra for design of a QRS filter” presented the ECG relative power spectra and its subcomponents [95] [Figure 3.20].
Fig. 3.20 ECG power spectra and its subcomponents. [95]
Based on this work, it can be noticed that the frequency components of the QRS complex are located mainly between 5-40 Hz. Under this observation, an Undecimated Wavelet Transform that provides an acceptable amplification and attenuation of these characteristics was proposed. There is a function in the advanced signal processing category on the function palette that implements the UWT. It requires the input of a signal, a mother wavelet and scale level to perform the UWT. The input signal will be each signal of each lead for each phase. The mother 107
wavelet used for this function was the biorthogonal wavelet bior3_1. This selection was supported because it is proved that biorthogonal wavelets are suitable for ECG feature extraction. In 2009, Channappa et al implemented an algorithm for the estimation of ECG features using LabVIEW®. In their work, they found that orthogonal wavelets were suitable for denosing ECG signals and biorthogonal wavelets were capable of extracting specific information [96]. There is another research leaded by Ali Shoen et al. They compared the RMS error between clean ECG signal and different wavelet filtered ECG with 20dB additive Gaussian pink noise. The lowest error was achieved with a biorthogonal wavelet [97]. At least the [96]
[97]
level scale to perform the UWT will be based on Thakor’s ECG power spectra graph.
Once selected the input signals and the mother wavelet it is necessary to select a scale level to implement the UWT. Figure 3.21 shows the scale function and bior3_1 mother wavelet.
Fig. 3.21 Scale function and Bior3_1 wavelet.
For different scale levels there are different frequency responses by implementing the fast Fourier transform to each scaled wavelet. Figure 3.22 shows these responses with different scales applied at a sample frequency of 500 Hz.
108
Fig. 3.22 Analysis Wavelet Scale Frequency responses @fs=500 Hz.
With these elements, it is concluded that the proper scale level that provides an acceptable amplification and attenuation for QRS complex’s characteristics fulfilling Thakor’s proposal is scale 4 for Q onset, and scale 6 for T wave. Table 3.2 resumes the information of different scales bandwidths at -3 dB with a sample frequency of 500 Hz. It can be noticed that at higher levels there is lower frequency response.
Table 3.2 Frequency attenuation at -3 dB by scales with fs=500 Hz. Scale 4 5 6
Frequency @ -3dB 7-20Hz 2-5Hz 0.5-1.5 Hz
3.3.2.D. UWT Analysis for QRS Complex (implementation)
(RRCond.vi)
Now that is understood how the UWT works, and what parameters to input according to the theory described previously, the methodology for doing this implementation in practice must be described. In the chapter of Wavelet transform, 109
the arguments for using the UWT were given. Figure 3.23 shows the normalized UWT of a synthetic ECG signal at different normalized scales.
Fig. 3.23 Normalized ECG signals and ECG UWT at different scales.
It can be noticed that when the scale 5 is implemented, frequency components from T-wave and P-wave are also amplified, but in scales 3 and 4 these components are attenuated. It also can be noticed that QRS complex for the different scales remains the same in almost all of them. For the program, the scale selected was scale number 3. This scale gives a good amplification for QRS complex and 110
attenuation for T-wave and P-wave. This figure shows that when a QRS complex’s event occurs at the ECG signal, the UWT’s signal reflects local maxima and local minima, where the zero crossing in the UWT represents the abrupt change in the ECG signal’s R-R interval.
The methodology to implement the measurement of the R-R interval will be explained now. First, the program performs a UWT to the original signal. This transform is then normalized in order to standardize different gain’s selection on ECG signals. Once obtained the transform the program selects a window to obtain the two first peaks and valleys (representing the first two local maximums and local minimums values of the UWT signal from the ECG). This is done with a function on LabVIEW® called Multiscale peak detection located on the advance signal processing category, Wavelet analysis and feature extraction all on the functions palette.
When this data is obtained, a process for zero crossing detection between maximums and minimums has to be done. This process consists of multiplying per iteration two sequentially indexed values from the array given between locals, each iteration indexes are changed and multiplication is done again. When the result converges to a sign value’s change, it would mean that these are the indexes in which the values are changing states between positive and negative (the zero crossing). This zero crossing process will be used later to detect local’s zero crossing points when locals are acquired all over the signal.
Then based on the first R-R interval obtained (between the two locals) an average is done. With this average, next window’s position on the UWT is configured. Once placed the windows, the program detects only one maximum and minimum and then, it implements the zero crossing process to detect the index in which this occurs. These indexes in the original ECG signal represent where the abrupt change for the R-R interval was acquired. At the end of the process new indexes, new averages and
111
new windows locations are acquired, stored and implemented for the next acquisition. Figure 3.24 exemplifies the whole conditioning process.
Fig. 3.24 Whole process of the conditional configuration.
112
At the end of this acquisition, this information must be stored in order to implement signal processing and detection in future states. All this must be done for each phase and each lead. The conditioning phase is in charge of doing all this automatically.
3.3.2.E. Data logging
In order to store the data, it must be converted into a coded structure to reduce memory and file generation. Therefore the data is stored in an array using certain structure. Figure 3.25 shows how data is codified.
First Level Lead Codification
Second Level Codification
Fig. 3.25 Data codification structure.
Indexes acquired of each R peak index were stored first in the codification. Then the R-R measurements were stored and at last an R-R measurement’s averages and cardiac frequency were also stored. This was done for each lead and 113
stored in each phase. After all the phases the complete file storage is done in a *.val file and next phases will be implemented.
3.3.3. Main Menu
(MainMenu.vi)
Ø Description
After codification the way to display the results acquired must be done. There is still missing the main goal of the thesis, the automatic measurement of the QT interval. Therefore, the next step not only allows the user to do more detections, but it also helps to visualize the information and manually change data. Figure 3.26 shows the frontal panel of the main menu. Basically this menu is visually divided in three areas or phases. Each phase concerns to certain data kind.
Fig. 3.26 Main Menu Frontal Panel.
When moving the mouse over each image, at the right corner of the frontal panel, the element’s name is displayed. And when clicking the selected elements
114
start to run to perform the tasks specified. Now each element will be explained in order to understand their functions.
3.3.3.A. R-R Phase
This phase is in charge of all the data collected in the codification phase. It is basically divided in two areas: the Manual Analysis and the R-R Results. Each of these areas performs specific actions which are going to be described next.
3.3.3.A.1.
R-R Manual Analysis
(R1.vi)
Ø Description
At this element, changes in the indexes obtained for the program can be modified. The user has to select the index to be changed and automatically the cursor will be positioned in that index selected. Then user must click on the Select R’s button to perform a change [Figure 3.27].
115
Fig. 3.27 R-R Manual Analysis frontal panel in selection mode.
User can select between leads and phases to do the visualization. When clicking the selection button, the program automatically zoom in at the specific index and allows the user to do changes by clicking on buttons that automatically appears (delete or insert indexes) calling this the modification mode [Figure 3.28].
Fig. 3.28 Modification’s mode on the R-R Manual Analysis.
What the program does is to read the files generated on the conditioning phase, decode them and visualize them in the frontal panel, when changes are done this information must be saved and stored in its respective file on the specified order. The advantage of this panel is that it has a direct button connection to the other 116
element in the R-R interval phase, the R-R result. This is tough to be useful for the user to compare the indexes acquired and the result displayed on the result element. At the end clicking on the Main Menu button the element returns to the main menu panel to select another element on it. 3.3.3.A.2.
R-R Results
(R2.vi) Ø Description Last VI does modifications on the indexes obtained but this element, implements the visualization of the result for the R-R measurement. This element is basically divided in 4 areas. Three of the four areas are graph visualization in which R-R interval, Cardiac Frequency and R-R interval average over the whole acquisition are visualized. The last area informs the user relevant data as R-R average or Cardiac Frequency average. In this area user can move through leads or phases to visualize each of them. As in the R-R Manual analysis, it has a direct button connecting this element to the R-R Manual analysis element [Figure 3.29].
Fig. 3.29 Frontal Panel for the R-R Result element.
117
3.3.3.B. QT Phase
Returning to the main menu, the next level to be implemented is the QT interval phase. This is in fact the main objective of the whole thesis’s work. This phase is basically divided in 3 elements. The first element performs the QT-interval acquisition and is called the QT detection element. The other elements in the phase are as in the R-R phase: one for manual analysis and manipulation and the last one is for interpretation of the data. Each of them will be explained now.
3.3.3.B.1.
QT Detection
(QT.vi)
Ø Description.
This single SubVI is the main function of the entire thesis because is where the automatic measurement for the QT interval is done. This VI receives the original ECG signal. Figure 3.30 shows the frontal panel of this element. It can be noticed that the main change in the frontal panel is the lead section at the right middle section. This modification allows the user to perform the QT interval measurement only in the specified leads.
118
Fig. 3.30 QT Detection’s frontal panel.
After selecting the leads to measure the QT interval, user must click on the begin button to start the detection. As in the conditioning phase this detection is done based on Thakor’s ECG power spectra to select the better level for performance.
Ø UWT Analysis for QT interval
(QT2.vi)
As in the QRS detection, this VI selects the UWT levels in which the Q waves onsets and T waves: peaks and ends, are enhanced. Based on the information obtained from the conditioning concerning to the R indexes’ file it does certain shifting in its respective UWT to find maximum, minimum and zero crossing points that represents information on the original ECG signal. Table 3.3 shows the UWT level used for the detection of each interest point.
119
Table 3.3 UWT level according to the interested ECG points. ECG points
UWT Level
R peak
4
Q onset
4
T peak
6
T end
6
All these different levels give a good advantage according to amplification and attenuation of the characteristics of interest. Based on Thakor’s ECG power spectra, T wave has low frequency components which suppose a high UWT level identical to the one used in the measurement. In the other hand, QRS Complex has medium frequency components (5-20 Hz) which suppose a low UWT level. After obtaining all the different indexes depending on the point of interest, interpretations were given to obtain three measurements: QT, QTp and QTc.
Once the R-R indexes are obtained from the conditioning phase and stored in a file, these indexes help as base to apply windows before (for Q onset) or after (for T wave) and start the measurement of these points. For each R index, Q onset window, T wave peak window and T wave end window are defined. For the Q onset window, 80 ms before R index were considered according to the work done by Laguna in 1990 [98]. If exceed, the algorithm searches the maximum value in the window of the UWT and allocate the Q onset there. For the T wave peak window, a varying window was proposed. Equation 3.1 describes its behavior.
ܴ െ ܴିଵ ሺͲǤͳͷሻቇ ݂ כ௦ ܹ௧௦ ൌ ܴ݅݊ ቆ Ǥ ͷ ோ ିோషభ
ܹ௧ ൌ ܹ௦ ൬
120
Ǥହ
ሺͲǤʹሻ൰ ݂ כ௦
(3.1)
Where, ܴ݅݊ is the index value of the actual R peak. ܴ is the actual R peak position in ms
ܴିଵ is the position of the R peak before the actual R peak in ms ݂௦ is the sampling frequency.
ܹ௧௦ is the window start index for the T peak.
And ܹ௧ is the window end index for the T peak.
And at last for the T wave end window, a varying window was also proposed [Equation 3.2].
ܴ െ ܴିଵ ሺͲǤͲͷሻቇ ݂ כ௦ ܹ௧௦ ൌ ܶ݊݅ ቆ Ǥ ͷ ோ ିோషభ
ܹ௧ ൌ ܹ௧௦ ൬
Ǥହ
ሺͲǤͳͷሻ൰ ݂ כ௦
(3.2)
Where, ܶ݊݅ is the index value of the obtained T wave peak. ܴ is the actual R peak position in ms
ܴିଵ is the position of the R peak before the actual R peak in ms ݂௦ is the sampling frequency.
ܹ௧௦ is the window start index for the T end.
And ܹ௧ is the window end index for the T end.
121
Figure 3.31 shows how the different windows are applied.
Fig. 3.31 a) R indexes detected in conditioning phase. b) Q onset window, T Peak window and T end window start and end.
In the figure is explained only the visual position of the windows according to the original ECG signal, but in fact, these windows are applied in its corresponding UWT selected based on Thakor’s analysis. For example, if there is an ECG signal with sampling frequency of 500 Hz and the QRS complex measurement has already been done, there is a file containing all the R indexes for the QRS complex. The first process to be done is to transform the original ECG signal into the UWT desired for the characteristic interest point. The first R index must have happened somewhere known in the signal, therefore, based on that index a window for the Q onset is proposed 40 indexes before (80 ms) in the UWT of scale level of 4. Once the UWT is windowed, the zero crossing before the R index in the UWT is detected and stored in a file.as the first Q onset index [Figure.3.32].
122
Fig. 3.32 Steps for the Q onset measurement.
Then the same procedure is followed for the T wave peak, where the window is applied later at a different UWT scale. But instead looking for the zero crossing value before R peak it searches for the first zero crossing index in the window [Figure 3.33].
123
Fig. 3.33 Steps for the T peak measurement.
And at last for the T wave end, the window is applied after, based on the T wave peak index previously detected. Then the next zero crossing index after T wave peak is defined as the T wave end index [Figure 3.34].
Fig. 3.34 Steps for the T end measurement.
124
These steps are then repeated for each R index until all the indexes have been detected. At the end with the detections of Q onset, T wave peak and T wave end done, QTp, QTe and QTc are measured and stored [Figure 3.35].
Fig. 3.35 Block diagram for Q onset, T peak and T end measurement.
Ø Data logging
All data has now been collected, therefore a method for coding the data and storage must be proposed in order to avoid excessive file collection. As in the conditioning result, Figure 3.36 shows how this data was coded for its storage.
125
Fig. 3.36 Data codification for Qi, Te and Tp information.
And as in the conditioning phase, this is done for each lead and each phase resulting in a coding file as Figure 3.25. The files in which this data is stored has an extension *.val2 for future processing and result’s visualization.
3.3.3.B.2.
QT Manual Analysis
(Q2.vi)
Ø Description
This VI performs a Manual Analysis of the information obtained by the QT detection element. It is similar to what the R-R Manual Analysis, but index’s manipulation is focused on Qi, Tp and Te. User can search for an index of interest and select it. After clicking, modification mode starts and deleting or adding new indexes can be done. This can be done by phase and lead and after modification, clicking on the return’s button graph returns to selection mode. Figure 3.37 shows both, selection and modification modes.
126
Fig. 3.37 Selection and modification mode in the QT manual analysis’s frontal panel.
This element has also the ability to change to the QT-Results element by clicking one button which makes user’s modifications more flexible and accord to what is expected on the results.
3.3.3.B.3.
QT Results
(Q3.vi)
Ø Description
As its name mentions, this element is where data information concerning QT interval is displayed. Making some similarities with the R-R Result element, this VI is also divided in four sections. Three of this four sections display graph information about the QTp, QTe and QTc intervals. This information is displayed for all the signals. The difference with the R-R Result element is the information displayed on the fourth section. User can change between leads and phases to analyze the information given. Each row is dedicated to show information about each QT interval measured. The information that is displayed is maximum and minimum values with its respective tendency per QTp, QTe and QTc intervals.
127
At the last row information concerning dispersion of intervals can be found. It shows for each interval which is the maximum or minimum value (depending on the max/min check box) through all the leads. It also lets the user know in which lead are found these values and its value. This element also has a QT manual button that allows the user to change between elements for better analysis performance.
3.3.3.C. Squatted Phase
According to what was stated on section A.3.a Squatted description, this phase is in charge of the squatted challenge acquisition. This challenge was proposed by the INC with the support from Dr. Manlio Marquez. His recommendations and proposes, generated the ideas to develop in the program for a successful implementation of this challenge. Next subsections will explain what is done in this phase and the results that can be obtained.
3.3.3.C.1.
Squatted obtaining
Ø Description
It has already stated that in the squatted challenge the patient is oriented in different positions over the whole procedure. What really matters in this challenge experiment are the significant changes between positional phases. Diagram shown on Figure 3.38 explains the important times of each positional phase according to the challenge, the comparison structure and the measurement patterns.
128
Fig. 3.38 Structure diagram of the Squatted Challenge.
As noticed in the figure, not all the phase is important for the squatted challenge. Therefore, in order to obtain the information required each phase must be divided according to its needs. Another important challenge in this phase is the data required to be analyzed. For each of the important times in the different phases, RR, QT, QTc and QTp averages must be obtained. Table 3.4 shows the different values that must be obtained per phase in order to perform a good comparison between phases according to what the INC demanded for its challenge.
129
Table 3.4 Data needed per phase in the squatted challenge. PHASE
Data required
End of first phase (Lying phase) Beginning of second phase (Stand phase) End of second phase (Stand phase) All the squatted phase
Beginning of the fourth phase (Second Stand phase)
Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø
RR, QT, QTp and QTc intervals average. RR, QT, QTp and QTc intervals values in maximum RR interval. RR, QT, QTp and QTc intervals values in maximum QT interval. RR, QT, QTp and QTc intervals values in maximum QTc interval. RR, QT, QTp and QTc intervals average. RR, QT, QTp and QTc intervals values in minimum RR interval. RR, QT, QTp and QTc intervals values in maximum QT interval. RR, QT, QTp and QTc intervals values in maximum QTc interval. RR, QT, QTp and QTc intervals average. RR, QT, QTp and QTc intervals values in minimum RR interval. RR, QT, QTp and QTc intervals values in maximum QT interval. RR, QT, QTp and QTc intervals values in maximum QTc interval. RR, QT, QTp and QTc intervals average. RR, QT, QTp and QTc intervals values in maximum RR interval. RR, QT, QTp and QTc intervals values in maximum QT interval. RR, QT, QTp and QTc intervals values in maximum QTc interval. RR, QT, QTp and QTc intervals average. RR, QT, QTp and QTc intervals values in minimum RR interval. RR, QT, QTp and QTc intervals values in maximum QT interval. RR, QT, QTp and QTc intervals values in maximum QTc interval.
Ø Diagram
(S1.vi)
The Squatted Challenge VI works in the next way. The user must define the lead to work before beginning the data manipulation. Then by clicking on the begin button the process starts. The VI follows a certain pattern in order to finish the task planned. Figure 3.39 shows how this sequence is done per phase. And in each phase what elements must be obtained in numbered order.
130
Fig. 3.39 Processes in the Squatted Challenge data manipulation divided by phase.
This element has two important characteristics besides the lead selection previously explained. The first characteristic is that between averages acquisition it stops for 500 ms in order to observe the data acquired for an instant. The second characteristic is that the VI allows the user in the data required section to select another snapshot than the proposed by the program. Anyway, the program stores the data as indicated by the user. Figure 3.40 shows the frontal panel of the squatted challenge’s data manipulation in which the user is being asked if that is the snapshot in which the data collection must be acquired.
131
Fig. 3.40 Squatted Challenge’s frontal panel for data manipulation.
If this snapshot is correct, user must proceeds to the next data to be analyzed. If not, user is allowed to select the next interval that fulfills the requirement needed. All the data obtained is at the end stored in a file, coding will be explained now.
Ø Data logging
As in previews data logging, if data is stored in different files it can generate many files that can be harder to store, read and interpret. Therefore a coding method must be applied in order to establish standardization for future work. Figure 3.41 will show how this coding is done for each data required and each phase.
Figure 3.41 doesn’t show all the phase’s development but it covered the general idea of how the codification was done. At last it generates a file *.val3 that contains the information obtained in this element.
132
Fig. 3.41 Data codification for the Squatted Challenge.
3.3.3.C.2.
Squatted Results
(S2.vi) Ø Description
The final element to be described is the Squatted Results element. There is not a graph indicator in this VI but it has four columns that represent the data obtained in the squatted challenge (RR, QTp, QTe and QTc). Indicators for comparison can be selected by the user to visualize the information for average, RR interval, QT interval or QTc interval. There’s also a phase selection in which the user can choose to visualize which change of state wants to analyze. This challenge is important because with this information, physiologists and scientists can research about the behavior of the ECG intervals under certain stimulations. Figure 3.42 shows the frontal panel of the Squatted result element.
133
Fig. 3.42 Result of a squatted control challenge visualized in the Squatted Result VI.
After all the visualization is done, the user must return to the main menu and click in the finish button to end the program. Once ended, all data obtained can be retrieved with the *.val files stored.
134
135
Chapter 4-Results and Validation [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98]
4.1. Results
Now that the program is already finished is time to implement it and verify how well it is working. For this purpose, different challenges were proposed and documented in order to obtain what is expected from the program. Basically four challenges were done: Acquisition, QRS complex, QT interval and squatted.
4.1.1. Acquisition
For this challenge four ways of acquiring signal were implemented and stored. The first one was a simultaneous acquisition from the 12 leads ECG. Figure 4.1 shows the graph for the acquisition at a sampling frequency of 500 Hz.
Fig. 4.1 12 Lead’s ECG acquisition.
136
The second challenge was the acquisition and storage of a signal from the Holter’s equipment. This acquisition was also simultaneous done in three leads at a sampling frequency of 500 Hz. Figure 4.2 shows the Holter’s graph.
Fig. 4.2 Holter’s acquisition simultaneously in three leads at 500 Hz.
The last two challenges were intended for acquiring signal from data base files. Third challenge decodes and stores data from the MIT-BIH arrhythmia database from Physionet [Figure 4.3]. Its graph shows the acquisition done with the register number 100 at a sampling frequency of 360 Hz.
Fig. 4.3 MIT-BIH Database Acquisition.
137
And at last the acquisition from database of Holter’s equipment of INC was acquired and stored [Figure 4.4]. This signal was acquired from a patient with Andersen syndrome at a sampling rate of 128 Hz.
Fig. 4.4 INC database acquisition from file.
With these challenges, the acquisition results were satisfactory and fulfill the total scene of different areas in which the program can be applied. Therefore, the acquisition purpose in the program has already been tested and validated.
4.1.2. Synthetized ECG signal
For the next sub-chapters, a synthetized ECG signal was implemented, but first this synthetized signal must be explained in order to understand its behavior, its nature and how it was used.
Figure 4.5 shows the acquisition of this synthetized signal. The values for these signals were obtained from the Physionet database in a program developed in Matlab®. Based on parameters specified, it generates data for a ECG signal using user-settable mean heart rate, number of beats, sampling frequency, waveform morphology (P, Q, R, S, and T timing, amplitude, and duration), standard deviation of the RR interval, and LF/HF ratio (a measure of the relative contributions of the low 138
and high frequency components of the RR time series to total heart rate variability). This realistic ECG waveform generator can be employed to assess biomedical signal processing techniques for clinical statistics of ECG [99].
Fig. 4.5 Synthetized ECG signal.
This synthetized ECG signal is realistic and behaves as an normal ECG acquired, therefore it can be used as a standardized signal for probing the conditioning, QT interval and Squatted results.
4.1.3. QRS Complex
With the synthetized signal, the conditioning phase was probed. Figure 4.6 shows where in the signal the program is detecting the R peak. It can be noticed that the R peak detection in the conditioning phase is satisfactory.
139
Fig. 4.6 Detection of R peak with a synthetized ECG Signal.
4.1.4. QT Interval
Now that the conditioning is done, QT interval results for the synthetized ECG signal must be tested. Figure 4.7 shows how the program detects the points of interest (Qi, Tp, Te). It can be noticed that as in then conditioning phase, the detection of characteristic points of QT interval is satisfactory.
Fig. 4.7 Qi, Tp, and Te points’ detection in synthetic ECG signal.
140
4.1.5. Squatted
At last squatted results were tested. As in the QT interval and QRS complex results, this probe was done with a synthetized ECG signal. First the acquisition was done with the values obtained in the synthetized program. After this phase, mark’s program lets select the intervals in which the squatted protocol was implemented. Then the conditioning was implemented detecting QRS complex successfully for each phase and lead. In the main menu, QT interval detection was also for each lead and phase. Once done, the squatted protocol process was done in times; maximums and minimums values required for each lead were set. And then in the Squatted results the measurements acquired for the challenge were shown. Figure 4.8 shows step by step how to implement the squatted results.
Figure 4.8 Squatted Results: Steps 1 to 9.
141
Squatted results are obtained with a synthetic ECG signal for this result, but it is intended to be implemented in real patients to analyze the information given in the challenge for certain pathologies.
Once tested with the synthetized ECG signal, next probe was done with a healthy subject. The squatted challenge was done as the protocol specifies. The subject started in a lying phase and after 5 minutes, he was told to change to a stand phase. After 5 more minutes the squatted phase began for a duration of 1 minute and at last the subject started 5 more minutes in a second stand phase. Figure 4.9 shows the marking program of this probe in which a change of phase is shown.
Fig 4.9 Marking between squatted and standing phase in the squatted challenge.
When this challenge is done, it can be obtained the information between phases and the indicator of interest. Figure 4.10 compares the results obtained for a healthy subject between phase 1 (lying phase) and phase 2(stand up phase). For this case the indicator of interest was the QTc. This means that for the interval with QTc maximum in each phase it obtains the RR peak, the QTp interval, the QTe interval and the QTc interval.
142
Fig. 4.10 Squatted Challenge result for healthy subject.
4.2. Validation
Now that the results were shown a validation must be done in order to fulfill a concise work that can be used in different areas and supported by specialist work done before to probe that the program is working correctly. This validation compares points and positions given by specialists in the area, against the points and positions obtained by the program.
For the automatic measurement of the QT interval, validation is divided in two, the validation for the QRS Complex and the validation for the QT interval.
4.2.1. QRS Complex
The validation for the QRS complex consists on comparing the data given in manual annotations of the MIT-BIH Arrhythmia Database [100, 101] against the QRS complex detection from the developed algorithm. These annotations were done by [100]
[101]
specialists in the area and stored in *.atr files from the database. Eight recordings from the database were taken with a sample frequency of 360 Hz. Due to the fact that
143
the algorithm is working with UWT’s scales at 500 Hz, these recordings were oversampled to 500 Hz.
Figure 4.11 and figure 4.12 shows two different validations against recordings 105 and 108 from the MIT-BIH Arrhythmia database. These recordings are characterized because its interferences and noises where the program performed a good detection. Movement artifacts and interferences were suppressed letting just sinus beat detections. The green squares are detections done by the annotations from the specialists while the black crosses are the detections done by the program.
Fig. 4.11 Sinus beat detection for MIT-BIH Arrhythmia database record 105.
Fig. 4.12 Sinus beat detection for MIT-BIH Arrhythmia database record 108.
144
Table 4.1 shows the result of the validation. It can be noticed that in 8 records of the MIT-BIH database the QRS complex detection was done with an accuracy of 99.56%. With these results the program is totally validating that the detection of the QRS complex is satisfactory.
Table 4.1 Results of QRS detection algorithm using MIT-BIH arrhythmia database.
ECG Recording Name
100 101 102 103 104 105 107 108 Total
Beats
2272 1864 2187 2084 2229 2571 2135 1753 17095
F.P.
0 0 1 2 1 21 1 10 36
F.N.
1 6 0 0 1 3 0 29 40
False detections Beats
%
1 6 1 2 2 24 1 39 76
0.04 0.32 0.05 0.10 0.09 0.93 0.05 2.22 0.44
F.P. False positive. F.N. False negative.
4.2.2. QT Interval
Now it’s time to start the validation of the QT-interval. This validation was done with the QT database from Physionet. Against the MIT-BIH arrhythmia database, the QT database is sampled at a frequency of 250 Hz. Therefore, these recordings were also oversampled to 500 Hz in order to be used with the algorithm. The QT database includes ECGs chosen to represent a wide variety of QRS and ST-T morphologies in order to challenge QT detection algorithms. The records were chosen for existing ECG databases including the MIT-BIH arrhythmia database. These databases are an excellent source of varied and well characterized data, to which reference annotation
145
markings were added from specialists for the location of waveform boundaries [102] As in the QRS complex validation, this validation is done comparing the annotations given by a specialist against the points detected in the program. For this validation, 15 recordings from the MIT-BIH arrhythmia database with QT annotations were analyzed.
Table 4.2 shows the result for the validation on the 15 ECG recordings. All these data are expressed in milliseconds, and include the beats number for each lead. The mean and standard deviation error of Qi, Tp and Te detections on each recording were obtained. On the QT database, annotations from specialists are specified, where for each annotation the time is compared against the time obtained with the algorithm. This is done with the Qi, Tp, and Te indexes and the results are then compared against recommendations for measurement standards in quantitative electrocardiography [103]. For the Q onset the standard deviation of differences from the references should not exceed 6.50 ms (with this algorithm 5.37 ms was reached). For the T wave peak, the standard deviation error should not exceed 12.64 ms, this value was obtained based on the work done on the paper Wavelet based delineator: Evaluation on standard database [104] (with this algorithm 5.29 ms was reached) and for T wave end 30.60 ms (with this algorithm 6.06 ms was obtained). As for the mean error, the intention was no to exceed one sampling interval [104]. With these results, it can be noticed that compared to the standards, the algorithm is working just as expected.
Figure 4.13 and figure 4.14 are examples of two records in which Qi, Tp and Te were detected. For each record, black crosses are the detections done by the specialists and green squares are the detections done by the algorithm.
146
Table 4.2 Validation results for the Q onset, T peak and T end from 15 QT database records in ms.
Record
Lead
Beats
Sel100
DII
Sel102
Q onset
T peak
T end
Mean
SD
Mean
SD
Mean
SD
30
4.56
4.41
3.99
3.76
7.73
5.23
V2
85
6.18
5.54 10.40
5.26
11.71 6.21
Sel103
V2
30
5.93
4.84
6.07
4.97
9.82
5.81
Sel104
V5
77
10.34 5.98 11.11
6.14
8.58
5.60
Sel114
DII
50
8.30
6.47
5.95
5.30
8.12
5.43
Sel116
DII
50
8.09
5.36
5.26
4.68
9.28
5.33
Sel117
DII
30
7.71
6.23
6.21
4.46
10.40 9.09
Sel123
DII
30
10.34 6.13
7.15
4.73
6.35
Sel213
V1
71
9.30
6.21 10.94
6.24
10.11 5.54
Sel221
DII
30
6.38
5.57
5.77
5.30
9.09
5.40
Sel223
DII
30
9.53
5.40
7.86
5.26
7.76
5.16
Sel230
DII
50
8.57
5.15
5.73
5.03
7.94
4.97
Sel231
DII
50
10.58 4.54
5.37
4.04
11.48 5.85
Sel232
DII
30
14.46 5.23 16.00
7.69
8.99
Sel233
DII
30
15.45 3.44
8.61
6.55
11.17 6.52
673
9.05
7.76
5.29
9.24
Total
Limit Tolerances sd [CSE 1985] Wavelet ECG Delineator[IEEE,2004]*
5.37 6.5
12.64*
4.80
9.89
6.06 30.6
147
Fig. 4.13 Qi, Tp and Te detection for record sel117.
Fig. 4.14 Qi, Tp and Te detection for record sel123.
148
149
Chapter 5-Conclusions
QT interval is one important electrocardiographic parameter that quantifies the duration of ventricular depolarization and repolarization. Several studies have shown that its abnormal prolongation and increased dispersion are associated with high risk of ventricular arrhythmias and sudden cardiac death in various clinical conditions. However, there are discrepancies in different studies on its prognostic significance, basically due to lack of standardization in the measurement of this interval. In this thesis an algorithm for the automatic measurement of the QT interval based on LabVIEW was developed reaching performances accord to the standards, so that it can be used to characterize QT interval and its dispersion in the squatted challenge in order to compare different phases in the autonomic nervous system.
In order to achieve these measurements the algorithm has its respective human interface for the detection, manipulation and storage of the Q wave onsets, T waves: peaks and ends and R peaks. These measurements were done applying the undecimated wavelet transform at different scales for amplification and attenuation of the ECG’s signal characteristics. Its results proved that this technique can achieve a good estimation similar to what specialists indicates. It also showed a good performance against artifacts, interferences and noise which gives reliability to the algorithm. Depending on the waveform to be detected and Thakor ECG’s power spectra an undecimated wavelet transform level was proposed. By applying the correct window and transformation, local maximums and minimums were detected and zero crossing points between them were identified. All this information represented in the original ECG signal the exact point desired without dependence of other factors such as noise, interference or artifacts. With this methodology a 99.56% of exactitude in R peaks detections was reached in the MIT-BIH database. The algorithm detects only the R peak independently for its amplitude. If there are Q waves or S waves greater than R peak, the algorithm is intended to detect only R peak, but Q-Q intervals or S-S intervals are also valid for cardiac frequency purposes, 150
but for the QT detection algorithm new methodology must be implemented. For the detection of QRS complex onset the average error reached was of 9.05 ms and 5.37 ms of standard deviation; for the detection of the T wave peak the average error reached was of 7.76 ms and 5.29 ms of standard deviation and for the detection of the T wave end the average error reached was of 9.24 ms and 6.06 ms of standard deviation. The algorithm is capable of detect positive, negative or biphasic T wave morphologies. These detections were done in 15 recordings of two leads, analyzed on the QT database.
This work was also intended to satisfy the necessity of a program for the acquisition of this interval for the “Instituto Nacional de Cardiología Ignacio Chávez”. Its implementation was for a challenge used in patients with Brugada or Andersen syndrome in order to understand the phenomena involved in the prolongation of the QT interval between changes of positions. Therefore, this work leaves an antecedent for clinic implementation.
The human machine interface done in this work is also a great approach to acquire signals from different sources, not only by files found in databases, but also to acquire data with equipment commonly used in the laboratory where this thesis work was started. Between the equipment’s compatibility a Holter and a 12 leads ECG systems can be found. Both equipments were preview thesis works which resulted in a successfully ECG’s acquisition method. The integration of these works (equipments and algorithm) can lead in the first steps for future works for a complete ECG analyzer and the creation of database for further research.
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104]
151
References [1] [2]
[3] [4] [5]
[6] [7] [8] [9]
[10] [11] [12]
[13]
[14] [15] [16] [17] 152
Sistema Nacional de Información en Salud, Daños a la salud, Boletín de información estadística, Secretaría de Salud, México, 2009. Instituto Nacional de Estadística y Geografía, Estadísticas a propósito del día de muertos. Datos nacionales, INEGI. Estadísticas Vitales. Base de datos, México, 2007. Instituto Nacional de Estadística y Geografía, Pirámide Poblacional, INEGI. Cuéntame, Población, México, 2005. Roger G. Mark. Clinical Electrocardiography and arrhythmias, nº Massachusetts Institute of Technology, 2004. Carlos Alvarado Serrano. Análisis de la variabilidad de intervalos de tiempo del ECG. España: Universidad Politécnica de Cataluña. Departamento de Ingeniería Electrónica, 2001. Rudolf Zuckermann. Electrocardiografía, México: Instituto Nacional de Cardiología, 1946. National Instruments, Why use LabVIEW?, LabVIEW, National Instruments corporate. Manual, USA, Versión 11. Hudson Garrison, Fielding. An introduction to the History of Medicine, Barnes & Noble, 1997. Florencio B. Garofalo. Historia de la cardiología de Rosario, Argentina: Sociedad de cardiología de Rosario. Homenaje a la sociedad de cardiología de Rosario en su 50° Aniversario. María Cristina Butteri Editores. Rosario, Argentina, 1994. Santamaría Fernández MB. Evolución histórica de la enfermería y la cardiología. Enfermería en la cardiología, nº 40, pp. 21-28. 2007 Fraile Huertas R. Cardiograma. El corazón en la historia, Madrid: You & Us, 2005. Susan E. Lederer. Flesh and Blood: Organ transplantation and blood transfusion in twentieth-century America, New York: Oxford University Press, 2008. Arabia FA, Copeland JG, Smith RG, et. al. CardioWest Total Artificial Heart: A Retrospective Controlled Study.Artificial Organs. Health Sciences Center, University of Arizona, Tucson. vol. 23, nº 204-207, 1999. Robert Henry Anderson. Atlas fotográfico de anatomía cardiaca, Barcelona: Ediciones Doyma, 1981. Bernardo A. Houssay. Fisiología Humana, Buenos Aires, Argentina: El Ateneo, 1954. Guyton Hall. Tratado de Fisiología Médica, México: McGraw Hill Interamericana. Décima edición, 2001. Arthur C. Guyton. Fisiología Humana, México: Interamericana. Segunda edición, 1967.
[18] Fox Stuart Ira. Human physiology, The McGraw-Hill Companies. Eighth Edition, 2003. [19] Tate Seeley Stephens. Anatomy and physiology, The McGraw-Hill Companies, Sixth Edition, 2004. [20] Eduardo Salman Álvarez. Diseño y construcción de los preamplificadores para electrocardiografía, para uso clínico, instalados en la unidad de cuidados intensivos de la clínica-hospital del Instituto Mexicano del Seguro Social de Irapuato, Guanajuato, México: CINVESTAV-IPN. Departamento de Farmacología y Toxicología. CINVESTAV, 1979. [21] Jaako Malmivuo. Bioelectromagnetism: principles and applications of bioelectronic and magnetic fields, New York: Oxford University, 1995. [22] Richard E. Klabunde. Cardiovascular Physiology Concepts, Lippincott Williams & Wilkins, 2005. [23] William F. Ganong. Review of medical physiology, Los Altos, California, USA: Lange Medical. Fifth Edition, 1971. [24] Nick Sperelakis. Electrogenesis of biopotentials: in cardiovascular system, Boston, USA: Kluwer Academic Publisher, 1995. [25] John T. Shepherd. The human cardiovascular system: facts and concepts, New York: Raven Press, 1979. [26] Society of General Physiologists, The sodium pump: structure, mechanism, and regulation, New York: Rockefeller University Press, 1990. [27] Arnold M. Katz. Physiology of the heart, New York: Raven Press, 1992. [28] Robert M. Berne. Cardiovascular Physiology, St. Louis: C.V. Mosby Co, Second edition, 1972. [29] Rafael Gómez Rodríguez. Sistema de electrocardiografía de 12 derivaciones para el estudio de la variabilidad espacial de los intervalos de repolarización ventricular del ECG, México: CINVESTAV-IPN. Departamento de Ingeniería Eléctrica. Sección Bioelectrónica. Cinvestav, 2009. [30] Harry A. Fozzard. The Heart and cardiovascular system: scientific foundations, New York: Raven Press, Second Edition, 1991. [31] L.A. Galvani. De viribus electricitatis in motu musculari commentarius, Italy: De Boloniensi Scient. Et art. Instituto atque academia, 1791. [32] Zywietz, Chr. A brief History of Electrocardiography – Progress through Technology. Biosignal Institute for Biosignal Processing and Systems Research. Hannover, Germany. 2003 [33] Juan Ignacio Valle Racero. Una breve historia de la electrocardiografía, Enfermería en cardiología. Primer cuatrimestre, 2001. [34] Bruce Fye W. A History of the Origin, Evolution, and Impact of Electrocardiography. The American Journal of Cardiology. Historical Studies. University of Wisconsin, Madison, USA. Vol. 23, n°12, May 15, pp. 937-949, 1994. [35] John G. Webster. Bioelectrodes. Encyclopedia of Medical Devices and Instrumentation, Wiley-Interscience. University of Wisconsin-Madison. Second 153
[36] [37] [38]
[39]
[40] [41] [42] [43]
[44]
[45] [46]
[47] [48] [49] [50]
154
edition, vol. 1, pp. 120-166. USA, 2006. A.D. Waller. A demonstration on man of electromotive changes accompanying the heart’s beat. J. Physiol, October, 8(5): pp. 229-234, 1887. Baker L.F. Electrocardiography and phonocardiography, A collective review. Bull Johns Hopkins Hospital, pp. 358-389. USA, December, 1910. WM. Bayliss, EH Starling. On the electromotive phenomena of the mammalian heart. Joint Lecturer on physiology at guy's hospital. London University College. Proceedings of the Royal Society of London. London, UK. pp. 211-214, 1892. W. Einthoven. Über den Einfluß des Leitungswiderstandes auf die Geschwindigkeit der Quecksilberbewegung im Lippmann’schen Capillarelectrometer und: Über die Form des menschlichen Ecg, Netherlands: Pflügers Arch. Ges. Physiol. vol. 60, pp. 91-100, 1895. Einthoven, W. Ueber die Form des menschlichen Electrocardiogramms, Netherlands: Arch fd Ges Physiol. vol. 60, pp. 101-123, 1895. Henson JR. Descartes and the ECG lettering series, J Hist Med Allied Sci. vol. XXVI, n° 2, pp. 181-186, 1971. G.E. Burch, N.P. de Pasquale. A History of Electrocardiography, Chicago: Year Book Medical, 1964. W. Einthoven., G. Fahr, A. de Waart. Über die Richtung und die manifeste Grösse der Potentialschwankungen im menschlichen Herzen und über den Einfluss der Herzlage auf die Form des Elektrokardiogramms, Pflügers Arch. Ges. Physiol. vol.150, pp. 275-315. Netherlands, 1913. Corday E. Historical vignette celebrating the 30th anniversary of diagnostic ambulatory electrocardiographic monitoring and data reduction systems, J Am Coll Cardiol, Jan; 17(1) pp. 286-292. USA, 1991. Safar P. History of cardiopulmonary-cerebral resuscitation, Cardiopulmonary Resuscition. New York: Churchill Living-stone, pp. 1-53. USA, 1989. PW, Macfarlane. A brief history of computer-assisted electrocardiography, Meth Inf Med, University Department of medical cardiology. Sep. 29(4) pp. 272-281. Glasgow, Scotland, 1990. Francis Morris. William Brandy J., John Camm. ABC of Clinical Electrocardiography, BMJ Books. Stackwell Publishing. Second Edition, 2008. Hugo Hernando Aréchiga Urtuzuástegui. Fisiología Médica, México: La Prensa Médica Mexicana, Segunda edición, 1977. Kalyani Premkumar. The Massage Connection Anatomy and Physiology, Baltimore, Maryland, USA: Lippincott Williams & Wilkins. Second Edition, 2004. Pentti M. Rautaharju, Borys Surawicz and Leonard S. Gettes. AHA/ACCF/HRS Recommendations for the Standardization and Interpretation of the Electrocardiogram: Part IV: The ST Segment, T and U Waves, and the QT Interval: A Scientific Statement From the American Heart Association Electrocardiography and Arrhythmias C, Dallas Texas: Circulation Journal of the American Heart Association. American Heart Association, vol. 119 n°10, pp. e241-e250. March 17, 2009.
[51] Thom. V. W. Rooke, Harvey Sparks. Medical Physiology, Rhoades. Second Edition, 2003. [52] Roberto Zayas Molina. Rosa E. Díaz Garriga. Margarita Dorantes Sánchez. Dispersión del intervalo QT: Un predictor de arritmias ventriculares malignas, La Habana: Instituto de Cardiología y Cirugía Cardiovascular. Revista Cubana Cardiol Cir Cardiovasc, vol. 14, n°2, pp. 116-123. Cuba, 2000. [53] Jaok Han, Gordon K. MOE. Nonuniform Recovery of Excitability in Ventricular Muscle, American Heart Association. Circulation Research. vol. 14 pp. 44-60. USA, 1964. [54] J.C. Sylven, B.M. Horacek, A. Spencer, G.A. Klassen, T.J. Montague. QT interval variablility on the body surface, J. Electrocardiol., vol. 17, pp. 179-188, 1984. [55] D.M. Mirvis, Spatial variation of QT intervals in normal persons and patients with acute myocardial infraction, J.Am. Coll. Cardiol., vol. 5, pp. 625-631, 1985. [56] J.C. Cowman, K. Yusoff, M. Moore, et al. Importance of lead selection in QT interval measurement, Am. J. Cardiol. , vol. 61, pp. 83-87, 1988. [57] C.P. Day, J.M. McComb, R.W. Campbell. QT dispersion: an indication of arrhythmia risk in patients with long QT interval, Br. Heart J., vol. 63, pp. 342344, 1990. [58] Borys Surawics, Eugine Lepeschkin. The measurement of the QT interval of the electrocardiogram, American Heart Association. Circulation Research. vol. 6 pp. 378-388. USA, 1952. [59] Alejandro Miranda Cid. Sistema de adquisición y almacenamiento de larga duración del ECG utilizando arquitectura digital embebida reconfigurable para el estudio del segmento ST, México: CINVESTAV-IPN. Departamento de Ingeniería Eléctrica. Sección de Bioelectrónica. Cinvestav, 2009. [60] John Bullock. Joseph Boyle III. Michael B. Wang. NMS Physiology, Lippincott Williams & Wilkins. The Science of Review. 4th Edition., 2001. [61] Robert E. Mason, Ivan Likar. A new system of multiple-lead exercise electrocardiography, American Heart Journal, Department of medicine, The Johns Hopkins University School of Medicine. vol. 71, n°2, Feb. pp. 196-205. Baltimore, Md. USA, 1966. [62] J Antonio G. Hermosillo. Los síndromes de intolerancia ortostática, Distrito Federal: Departamento de Electrocardiografía y Electrofisiología. Instituto Nacional de Cardiología “Ignacio Chávez”., 2001. [63] Elizabeth Silva Salas. Prueba de inclinación, Distrito Federal: Servicio de Electrofisiología, Instituto Nacional de Cardiología Ignacio Chávez, 2006. [64] Cecilia Pérez Mejía. Manual de métodos diagnósticos en electrofisiología cardiovascular. Prueba de la mesa inclinada o basculante, Bogotá: Sociedad Colombiana de Cardiología y Cirugía Cardiovascular, 2006.
[65] Mario Montoya Toro. Fundamentos de Medicina, Cardiología., Medellín: Equipo Médico del Centro Cardiovascular Colombiano. Clínica Santa María., 155
[66] [67]
[68] [69] [70] [71]
[72]
[73] [74]
[75]
[76]
[77]
[78]
[79]
156
2004. Espino Vela, Ed. Méndez Oteo. Tetralogía de Fallot, en Cardiología pediátrica. Méndez editores, Segunda edición. pp. 31. México, 1994. TAI TAKAHASHI. ICF Illustration library "Activities and Participation", International Classification of Functioning, Disability and Health. Universidad internacional de Salud y Bienestar. Chapter 4, Mobility, Changing and maintaining body position, d410 Changing basic body positions. http://www.icfillustration.com/icfil_eng/d/d410.html. Polikar Robi. The Story of Wavelets, Rowan: Dept. of Electrical & Computer Engineering Rowan University, 2001. Santij K. Mitra. Digital Signal Processing, USA: McGraw-Hill, 2001. Dennis Gabor. Theory of Communications, Budapest: British ThompsonHuston, 1945. P.J. Loughlin, J.W. Pitton, L.E. Atlas. Proper time-frequency energy distributions and the Heisenberg uncertainty principle, Seattle: Time-Frequency and Time-Scale Analysis, 1992., Proceedings of the IEEE-SP International Symposium, Conference Publications, 4-6 Oct., pp. 151-154. Seattle ,WA, USA. 1992 Ingrid Daubechies. Where do wavelets come from? A personal point of view. Department of Mathematics and program in applied and computational mathematics. Proceedings of the IEEE special issue on Wavelets, vol. 84, n° 4, pp. 510-513. April, Princeton, USA, 1996. Robert X. Gao, Ruqiang Yan. Wavelets: Theory and Applications for Manufacturing, Connecticut: Springer, 2010. Rakhi C. Motwani, Mukesh C. Motwani, Frederick C Harris Jr. Eye Detection using Wavelets and ANN, Reno: University of Nevada. Proceedings of GPSx, 2004. C. Sidney Burrus, Ramesh A. Gopinath, Haitao Guo. Introduction to wavelets and wavelet transforms, Huston: Electrical and Computer Engineering Department and Computer and Information Technology Institute, 1998. Aglika Gyaourova, Chandrika, Imola Kamath Fodor, George Bebis. Undecimated Wavelet Transform for Image Denoising, Reno: Computer Science Department, 2002. R. Zaciu, C. Lamba, C. Burlacu and G. Nicula. Image compression using an overcomplete discrete wavelet transform, Appl. Electron. Dept., Polit. Univ. vol. 42, nº 3, pp.800-807. Bucharest, Romania, Aug. 1996. M. Lang, H. Guo, J. E. Odegard, C.S. Burrus, and R. O. Wells Jr. Non-linear processing of a shift invariant DWT for noise reduction. IEEE Sig. Proc. Letter vol. 3 n°1 pp.10-12. January 1996. M. Unser. Texture classification and segmentation using wavelet frames. Image processing IEEE Trans. Nat. Inst. of Health, vol. 4, nº 11, pp. 1549-1560. Nov. Bethesda, MD, USA, 1995.
[80] M. Holschneider, R. Kronland-Martinet, J. Morlet, and P. Tchamitchian. A real-time algorithm for signal analysis with the help of the wavelet transform, In Wavelets: Time-Frequency Methods and Phase Space, Jean-Michel Combres, Alexander Grossman and Philippe Tchamitchian. Springer-Verlag, pp. 286-297. Berlin, Germany, 1989. [81] P. Dutilleux. An implementation of the algorithme à trous to compute the wavelet transform, In Wavelets: Time-Frequency Methods and Phase Space, Jean-Michel Combres, Alexander Grossman and Philippe Tchamitchian. Springer-Verlag, p. 298. Berlin, Germany , 1989. [82] James E. Fowler. The Redundant Discrete Wavelet Transform and Additive Noise. IEEE Signal Processing Letters, vol. 12, nº 9, pp.629-632. Sep. 2005. [83] M.J. Shensa. The discrete wavelet transform: Wedding the à trous and Mallat algorithm. US Naval Ocean Syst. Center. IEEE Transactions on Signal Processing, vol. 40, nº 10, pp. 2464-2482. San Diego, CA, USA, Oct. 1992. [84] G. Beylkin. On the representation of operators in bases of compactly supported wavelets. University of Colorado. Society for Industrial and Applied Mathematics. SIAM J. Numer. Anal. vol. 6, nº 6, pp. 1716-1740. Boulder, Colorado, USA, Dec. 1992. [85] National Instruments, Undecimated Wavelet Transforms, LabVIEW® Professional Development System, Version 9.0, 2009. [86] M. Lang, H. Guo, J. E. Odegard, C. S. Burrus. Noise Reduction Using an Undecimated Discrete Wavelet Transform, Department of Electrical and Computer Engineering, Houston, TX, 1995. [87] Peter A. Blume. The Labview Style Book, Crawfordsville, Indiana: Prentice Hall, 2007. [88] Rick Bitter, Taqi Mohiuddin, Matt Nawrocki. Advanced Programming Techniques, Boca Raton, FL: CRC Press, 2007. [89] Ronald W. Larsen. Labview for Engineers, Upper Saddle River, New Jersey: Pearson, 2011. [90] Riccardo de Asmundis. LabVIEW- Modeling, programming and simulations, Preface. Rijeka, Croatia: INTECH, 2011. [91] National Instrument Corporation, History of NI, NI, 2011. [En línea]. Available: http://www.ni.com/company/history.htm. [Último acceso: 5 Agosto 2011]. [92] Folea, Silviu. LabVIEW- Practical Applications and Solutions, Preface. Rijeka, Croatia: INTECH, p. IX, 2011. [93] Tech Smart Systems, TECH smartsys, Tech Smart Systems, 2011. [En línea]. Available: http://www.techsmartsys.com/index.php?page=where-is-labviewused. [Último acceso: 18 Agosto 2011]. [94] National Instrument, How to design a front panel vector indicator (display). NI Discussion Forums, http://forums.ni.com/t5/LabVIEW/How-to-design-a-frontpanel-vector-indicator-display/td-p/1563926, May. 2011.
157
[95] N.V. Thakor, J.G. Webster, W.J. Tompkins. Estimation of QRS complex power spectra for design of a QRS filter, IEEE Trans. Biomed. Eng., pp. 31, 702-706, 1984. [96] Channappa Bhyri, Kalpana. V, S. T. Hande, and L. M. Waghmare. Estimation of ECG features using LabView, TECHNIA- International Journal of Computing Science and Communication Technology, vol. 2 n° 1, pp. 320-324. July, 2010. [97] Ali Shoeb, Gari Clifford. Wavelets: Multiscale Activity in Physiological Signals, MIT, Biomedical Signal and Image Processing, Spring 2005. [98] P. Laguna, N.V. Thakor, P. Caminal, R. Jané, Hyung-Ro Yoon. New Algorithm fot QT interval analysis in 24-hours Holter ECG: performance and applications, Med. & Biol. Eng. & Comput, vol. 28, pp. 67-73, 1990. [99] PE McSharry, GD Clifford, L Tarassenko, L. Smith. A dynamical model for generating synthetic electrocardiogram signals, IEEE Transactions on Biomedical Engineering , pp. 50(3): 289-294, March 2003. [100] GB Moody, RG. Mark. The impact of the MIT-BIH Arrhythmia Database. Hardvard-MIT Div. of Health Sci. & Technol., IEEE Engineering in Medicine and Biology Magazine, vol. 20, nº (3), pp. 45-50. Cambridge, MA, USA, May-June 2001. [101] Al Goldberger, LA Amaral, L Glass, JM Hausdorff, PC Ivanov, RG Mark, JE Mietus, GB Moody, CK Peng, HE Stanley. PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals. Circulation, vol 101, n° 23, pp. E215-E220. June 13, 2000. [102] P. Laguna, RG Mark, AL Goldberger, GB Moody. A Database for Evaluation of Algorithms for Measurement of QT and Other Waveform Intervals in the ECG, Computer in Cardiology, 1997 Conference 7-10 Sep 1997. pp 673-676. [103] The CSE working Party, Recommendations for measurement standards in quantitative electrocardiography, European Heart Journal, vol. 6, pp. 815-825, 1985. [104] Juan Pablo Martínez. Rute Almeida. Salvador Olmos et al. A Wavelet-Based ECG Delineator: Evaluation on Standard Databases, IEEE Transactions on Biomedical Engineering, vol. 51, nº 4, pp. 570-582, 2004.
158