HRV in Smartphone for Biofeedback Application



Similar documents
Electrocardiography I Laboratory

AUTONOMIC NERVOUS SYSTEM AND HEART RATE VARIABILITY

Diagram 2(i): Structure of the Neuron

Heart and Vascular System Practice Questions

Integration and Coordination of the Human Body. Nervous System

Exchange solutes and water with cells of the body

Chapter 6: HRV Measurement and Interpretation

INTRODUCTORY GUIDE TO IDENTIFYING ECG IRREGULARITIES

Heart Rate and Physical Fitness

Time series analysis of data from stress ECG

Equine Cardiovascular Disease

The heart then repolarises (or refills) in time for the next stimulus and contraction.

Chapter 15. The Autonomic Nervous. The Autonomic Nervous System. Autonomic Motor Pathways. ANS vs. SNS

Reflex Physiology. Dr. Ali Ebneshahidi Ebneshahidi

Overactive bladder is a common condition thought to. women, and is a serious condition that can lead to. significant lifestyle changes.

D.U.C. Assist. Lec. Faculty of Dentistry General Physiology Ihsan Dhari. The Autonomic Nervous System

Research on physiological signal processing

Chetek-Weyerhaeuser High School

Brain & Mind. Bicester Community College Science Department

Autonomic Nervous System Dr. Ali Ebneshahidi

Activity 4.2.3: EKG. Introduction. Equipment. Procedure

Introduction. What is syncope?

Chapter 13. The Nature of Somatic Reflexes

Chapter 15. Autonomic Nervous System (ANS) and Visceral Reflexes. general properties Anatomy. Autonomic effects on target organs

Summary. Master-/Bachelor Thesis

Functions of Blood System. Blood Cells

Vascular System The heart can be thought of 2 separate pumps from the right ventricle, blood is pumped at a low pressure to the lungs and then back

PSIO 603/BME Dr. Janis Burt February 19, 2007 MRB 422; jburt@u.arizona.edu. MUSCLE EXCITABILITY - Ventricle

Chapter 20: The Cardiovascular System: The Heart

The P Wave: Indicator of Atrial Enlargement

Chapter 15 Anatomy and Physiology Lecture

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Efficient Heart Rate Monitoring

Heart Rate Data Collection Software Application User Guide

Nerves and Nerve Impulse

HEART HEALTH WEEK 3 SUPPLEMENT. A Beginner s Guide to Cardiovascular Disease HEART FAILURE. Relatively mild, symptoms with intense exercise

Please read chapter 15, The Autonomic Nervous System, complete this study guide, and study this material BEFORE coming to the first class.

Lecture Outline. Cardiovascular Physiology. Cardiovascular System Function. Functional Anatomy of the Heart

Short Duration High-Level Exposure to Halon Substitutes: Potential Cardiovascular Effects

Catheter Ablation. A Guided Approach for Treating Atrial Arrhythmias

AP Biology I. Nervous System Notes

Estimation of Sympathetic and Parasympathetic Level during Orthostatic Stress using Artificial Neural Networks

Slide 4: Forebrain Structures. Slide 5: 4 Lobes of the Cerebral Cortex. Slide 6: The Cerebral Hemispheres (L & R)

Doppler. Doppler. Doppler shift. Doppler Frequency. Doppler shift. Doppler shift. Chapter 19

APA National Standards for High School Psychology Curricula

Introduction to Electrophysiology. Wm. W. Barrington, MD, FACC University of Pittsburgh Medical Center

Distance Learning Program Anatomy of the Human Heart/Pig Heart Dissection Middle School/ High School

CHAPTER 6 PRINCIPLES OF NEURAL CIRCUITS.

HTEC 91. Topic for Today: Atrial Rhythms. NSR with PAC. Nonconducted PAC. Nonconducted PAC. Premature Atrial Contractions (PACs)

Chapter 7: The Nervous System

Reavis High School Anatomy and Physiology Curriculum Snapshot

Role of Electrodiagnostic Tests in Neuromuscular Disease

The Fourier Analysis Tool in Microsoft Excel

Cardiovascular Physiology

Feature Vector Selection for Automatic Classification of ECG Arrhythmias

Evaluation copy. Analyzing the Heart with EKG. Computer

Electrocardiogram and Heart Sounds

QRS Complexes. Fast & Easy ECGs A Self-Paced Learning Program

AUTONOMIC NERVOUS SYSTEM

CHAPTER 2 ANATOMY AND PHYSIOLOGY OF UTERUS AND FOETAL HEART

Exercise, the Electrocardiogram, and Peripheral Circulation

Electronic Communications Committee (ECC) within the European Conference of Postal and Telecommunications Administrations (CEPT)

Chapter 15. Neurotransmitters of the ANS

Physiology Chapter 1 Lecture

Fainting - Syncope. This reference summary explains fainting. It discusses the causes and treatment options for the condition.

Electrocardiogram analyser with a mobile phone

FEATURE. Heart Rate Variability Biofeedback as a Strategy for Dealing with Competitive Anxiety: A Case Study

Functional neuroimaging. Imaging brain function in real time (not just the structure of the brain).

Introduction to Electrocardiography. The Genesis and Conduction of Cardiac Rhythm

Anatomy and Physiology

By the end of this continuing education module the clinician will be able to:

Job stress bio-monitoring methods: heart rate variability (HRV) and the autonomic response

Diagnostic and Therapeutic Procedures

Anatomy and Physiology: Understanding the Importance of CPR

Detection of Heart Diseases by Mathematical Artificial Intelligence Algorithm Using Phonocardiogram Signals

North Bergen School District Benchmarks

Electrocardiography Review and the Normal EKG Response to Exercise

Biology 347 General Physiology Lab Advanced Cardiac Functions ECG Leads and Einthoven s Triangle

Section Four: Pulmonary Artery Waveform Interpretation

ANATOMY & PHYSIOLOGY MODULE 2015/16

Effect of Coughing on Heart Rate. Evaluation copy

Anatomi & Fysiologi The cardiovascular system (chapter 20) The circulation system transports; What the heart can do;

Emergency Scenario. Chest Pain

Monitoring EKG. Evaluation copy

Snoring and Obstructive Sleep Apnea (updated 09/06)

Chapter 10 Introduction to Time Series Analysis

Practical class 3 THE HEART

Atrial Fibrillation (AF) March, 2013

Obtaining Knowledge. Lecture 7 Methods of Scientific Observation and Analysis in Behavioral Psychology and Neuropsychology.

Norepinephrine Effects On the System

Signal to Noise Instrumental Excel Assignment

Chapter 12. Temperature Regulation. Temperature Regulation. Heat Balance. An Overview of Heat Balance. Temperature Regulation. Temperature Regulation

Nervous System: PNS and CNS

ZEBRAFISH SYSTEMS SYSTEMS ZEBRAFISH. Fast, automatic analyses

Nervous System: Spinal Cord and Spinal Nerves (Chapter 13) Lecture Materials for Amy Warenda Czura, Ph.D. Suffolk County Community College

ANALYZER BASICS WHAT IS AN FFT SPECTRUM ANALYZER? 2-1

Name: Teacher: Olsen Hour:

Neurophysiology. 2.1 Equilibrium Potential

trust clinical guideline

Movement artifacts electrical noise caused by the movement of the sensor surface with respect to the skin surface

Transcription:

HRV in Smartphone for Biofeedback Application Michel Maurício Mendes Cânovas Dissertation for obtaining the Master s Degree in Biomedical Engineering Jury President: Supervisors: Member: Prof. Paulo Jorge Peixeiro de Freitas Prof. João Miguel Raposo Sanches Prof. Fernando Henrique Lopes da Silva Prof. Patrícia Margarida Piedade Figueiredo November 2011

Acknowledgments I would like to thank Prof. João Sanches, for his support and enormous insight. Also to Andreia Duarte and Alexande Domingues, as he was almost one of my fingers: the one that hit the backspace and then helped the others rebuild a better piece. I owe them both a lot, not only for spared hours of sweat dealing with Murphy laws applied to software behavior, but also for their endless availability, encouragement and kindness. I thank the world to my family. We are like the fantastic four, except all four of us can be invisible, bend, burn and still be an unwavering rock for each other. Without them and their powers nothing of this could be possible. Also I would like to thank Dureza: João Jorge, Miguel Rodrigues and Ricardo Figueiredo; Pedro Monteiro, my java oracle; and Henrique Nemésio, in spite the distance. They are indeed my second family. This thesis is dedicated to all my family and closest friends. They are like small contributions in the spectrum of my heartbeat: some speed it up, some slow it down. Ultimately, in their absence I would have none: not in the time domain, nor in the life domain. i

Abstract Biofeedback is the process of inducing a physiological state change by conveniently displaying accurate information of the body s current state. Heart Rate Variability (HRV) is related to several physiological factors. In particular, it is consensual that the HRV reflects the Autonomic Nervous System (ANS) activity, namely in its Low Frequency (LF) and High Frequency (HF) spectral components which relate to the activity of the ANS sympathetic and parasympathetic components. This makes HRV analysis a window to the ANS state that can be used to biofeedback. Real-time HRV spectral analysis for biofeedback purposes, though are usually performed in full size computers, which withdraw liberty to the protocols. Thereby, the purpose of this thesis was to overcome the lack of freedom imposed by the hardware to these biofeedback procedures, with an application that uses a wireless monitoring belt to gather the HRV information and the ubiquitous smartphone to process and display real time information for biofeedback purposes. Application outputs reveal results coherent with bibliography concerning HRV analysis, which enabled the successful implementation of a Resonant Frequency Training (RFT) biofeedback feature, hopefully bringing this form of therapy closer to the general population. Keywords Heart rate variability, Physiological Monitoring Belt, Mobile Phone, Biofeedback. iii

Resumo Biofeedback consiste no processo de indução de uma mudança de um estado fisiológico através da visualiação de informação correcta e conveniente acerca do estado actual do corpo. A variabilidade do ritmo cardíaco, HRV (do inglês, Heart Rate Variability), está relacionada com vários factores fisiológicos. Em particular, é consensual que a variabilidade do ritmo cardíaco reflecte a actividade do Sistema Nervoso Autónomo nomeadamente nas suas componentes de baixa (LF) e alta (HF) frequências que se relacionam com a actividade dos sistemas simpático e parasimpático do ANS, fazendo, assim, com que a análise espectral de HRV seja uma janela para o ANS que pode ser usada em biofeedback. No entanto, a análise espectral de HRV em tempo real para propósitos de biofeedback são normalmente feitos em computador, o que retira aos protocolos de biofeedback uma liberdade considerável. Nesse sentido, o propósito desta tese é, precisamente, ultrapassar a falta de liberdade imposta aos procedimentos de biofeedback com uma solução que usa uma cinta de dados, sem fios, para capturar a informação sobre o ritmo cardíaco, e um telemóvel para processar e exibir a informação conveniente. Os resultados obtidos com a aplicação desenvolvida estão em concordância com os esperados considerando a bibliografia, o que permitiu a implementação, com sucesso, de uma rotina de biofeedback com base em RTF (do inglês, Resonant Frequency Training), na esperança de aproximar o uso deste tipo de terapia do das mais convencionais. Palavras Chave Variabilidade do ritmo cardíaco, Cinta Cardíaca, Telemóvel, Biofeedback. v

Contents 1 Introduction 1 1.1 Objectives and Motivation................................ 2 1.2 Original Contributions.................................. 3 1.3 Problem Definition.................................... 3 1.4 Thesis Scope....................................... 4 2 Fundamentals and Background 5 2.1 Basic Cardiac Electrophysiology............................ 6 2.2 Nervous System..................................... 8 2.3 Heart Rate Variability.................................. 9 2.3.1 Time and Frequency Domain Methods..................... 10 2.3.2 Spectral and Physiological components.................... 11 2.3.3 Cardiovascular System and Resonant Frequencies.............. 12 2.4 Biofeedback........................................ 12 2.4.1 Efficacy Evaluating Criteria........................... 14 2.4.2 HRV Biofeedback................................ 15 2.5 Autoregressive (AR) model............................... 17 2.6 Physiological Monitors.................................. 19 2.7 Mobile phones...................................... 20 3 System Framework 23 3.1 System Architecture................................... 24 3.1.1 Development environment setup........................ 24 3.1.2 Bioharness R monitoring belt and Connection................. 25 3.1.3 Android device.................................. 27 3.1.4 Signal processing................................ 27 3.1.5 User Interface.................................. 31 3.1.5.A Real Time HRV Analysis....................... 31 3.1.5.B Orthostatic Test............................ 33 3.1.5.C RF Biofeedback Training....................... 36 vii

Contents 4 Application Testing and Outputs 39 5 Conclusions and Future Developments 45 Bibliography 47 viii

List of Figures 2.1 Heart electrical system (from [1])............................. 6 2.2 ECG and the cardiac cycle (adapted from [1])..................... 7 2.3 Typical wireless heart rate monitor........................... 19 2.4 Android running smartphone and tablet, respectively.................. 20 3.1 System architecture.................................... 24 3.2 Zephyr R BioHarness: (A) overview (B) posterior and anterior view.......... 25 3.3 Transmitted R to R raw and real data (from [2])..................... 28 3.4 AIC values for model orders of 1 to 30 for a random sample of R-to-R interval data 29 3.5 Signal processing performed to access the HRV s spectral information....... 30 3.6 HRV Application first menu: (A) Before the establishment of a connection; (B) Connected........................................... 32 3.7 Display in the Real Time HRV Analysis functionality of the application........ 33 3.8 Orthostatic test display: (A) before start, (B) after start, in rest position....... 34 3.9 Orthostatic test display: (A) stand up dialog, (B) head up 90 o tilt position recording screen........................................... 35 3.10 Orthostatic test results display.............................. 36 3.11 Resonant Frequency Training biofeedback interface: (A) first dialog, (B) during training session...................................... 37 4.1 R to R interval series (top panel): tachogram at rest and during 90 o head up tilt. AR spectra of the above time series (bottom panel), (From [3]).............. 40 4.2 R to R interval series (top panel): tachogram at rest and during 90 o head up tilt. AR spectra of the above time series (middle panel). Pie charts (top panel) show the relative distribution together with the absolute power of the two components represented by the area (From [4])........................... 41 4.3 Display during (A) rest and (B) 90 o head up tilt..................... 42 4.4 Orthostatic test results.................................. 43 4.5 HRV oscillation...................................... 43 ix

List of Figures 4.6 Display during RFT biofeedback session: (A) in the very beginning, (B) after a while breathing at the resonant frequency........................... 44 x

List of Tables 3.1 Zephyr R BioHarness Bluetooth transmitted data description (from [5])....... 26 3.2 Zephyr R BioHarness Bluetooth streaming packets description (from [5])...... 26 4.1 Reproducibility of the Effects of Tilt on HRV (adapted from [3])............ 41 xi

List of Tables xii

List of Abbreviations 1 ADHD AIC ANS API AR BPM CNS ECG EEG FFT HRV OS PES PNS RFT SA UI Attention Deficit Hyperactivity Disorder Akaike Information Criterion Autonomic Nervous System Application Programming Interface Autoregressive (model) Beats Per Minute Central Nervous System Electrocardiogram Electroencephalogram Fast Fourier Transform Heart Rate Variability Operating System Prediction Error Sequence Peripheral Nervous System Resonant Frequency Training Sinoatrial (node) User Interface 1 Note: This list is in alphabetic order xiii

List of Abbreviations xiv

List of Symbols a opt optimal prediction coefficients xv

List of Symbols xvi

1 Introduction Contents 1.1 Objectives and Motivation.............................. 2 1.2 Original Contributions................................ 3 1.3 Problem Definition................................... 3 1.4 Thesis Scope...................................... 4 1

1. Introduction Stimuli invade our senses on a constant basis. It is a central nervous system (CNS) responsibility to treat and produce a real-time adequate response to that information, in order to provide an effective and efficient fit of the organism to the environment[1]. However, though a great portion of this information and adaption process may be conscious, specific situations or stimuli produce particular sensations and responses that we can not always understand, and rarely control. This falls in the jurisdiction of the autonomic nervous system. What if we could access real-time state information about the autonomic nervous system (ANS), could we induce a transition to a different state? Variations of the heart rate are directly related with the ANS through both its main efferent pathways: Symphatetic and Parasymphatetic nervous systems. Measuring or indirectly estimating the activity of the ANS can be valuable in the diagnosis of several pathologies. In a first approach, abnormal heart rate variation patterns reflect malfunctions of the ANS, called Dysautonomia. These variations may also be related with malfunctions of other systems involving the ANS, such as the cardio-vascular or cardio-respiratory systems. Heart Rate Variability (HRV) is nowadays one of the preferred non-invasive methods to assess and monitor the activity of the ANS[6]. However, as mentioned before, the ANS also depends on the Central Nervous System and therefore the HRV can be used to infer pathological or non pathological conditions related with brain. Several publications on the literature correlate the HRV with anxiety [7], panic [8] or Attention Deficit Hyperactivity Disorder (ADHD) [9]. As an answer to our previous question, another field of research and clinical applications where HRV is used is Biofeedback (BF)[10]. Bio and Neuro feedback are frameworks where physiological information is provided, through appropriated computer user interfaces, mainly to help the improvement of brain features and skills, e.g. short term memory, or to help inducing changes on certain brain states, such as, relaxation or concentration. 1.1 Objectives and Motivation Considering the rhythm and modern lifestyle, more and more pathologies, formerly of little significance, are gaining expression. Conditions such as anxiety, depression, stress, fatigue, hypertension, hypotension, among others (asthma, hyperventilation syndrome, fibromyalgia), are chronical in nowadays society. Alongside, alternative and less conventional approaches to the treatment of such disorders are gaining supporters, specially those that imply less expensive methodologies and reduction or even complete withdrawal of drugs from the treatment. Biofeedback can be considered part of that group of unconventional methodologies. However, the technology needed and the restrictions imposed by their architecture still affect and condition the results and effectiveness of procedure. A few years ago, heart rate and other physiologic functions monitoring was expensive and 2

1.2 Original Contributions unpractical, whereas wireless monitoring devices, such as belts and monitoring wrist watches, were only available for high performance athletes. Nowadays the reality has changed: wireless monitoring devices are better, smaller and affordable, thus available for everyone, everywhere. Likewise, mobile phones became smaller and more powerful. New processors, sensors, operating systems, and developed applications that make use of such features have brought them closer to computers. This new perspective of smart (mobile) phone and the encouragement of third party development of mobile applications has opened the doors for this new practical technological tiny world, where even the software development is accessible for everyone. Combining the aforementioned, it was obvious what needed to be done. The use of practical, discrete, wireless communicating, state-of-the-art, long-life battery feeded devices gives HRV biofeedback the degree of freedom it was lacking in order to evolve. The presented system enables real-time HRV assessment in time and frequency domains for biofeedback purposes. This not only enables the performance of established protocols, but also, due to its simplicity and versatility, provides means for the improvement of such methods, and opens space for the easy development of new methodologies to be tested in the biofeedback field. 1.2 Original Contributions This thesis presents original contributions to knowledge, which have been published or submitted: A mobile acquisition platform for Real Time HRV assessment with smartphone, established recurring to a physiological data belt and a mobile phone, submitted and accepted as an extended abstract for the RecPad 2011 national conference in Porto. A mobile acquisition platform for Real Time HRV assessment with smartphone, established recurring to a physiological data belt and a mobile phone presented in IX Encontro de Engenharia Biomédica IST/FMUL, in Lisbon. 1.3 Problem Definition The pursuit of new treatments for conditions such as stress, anxiety, panic, depression or even hyper and hypotension, that make use of fewer drugs and cheaper procedures, is growing. Biofeedback, specifically, implement non invasive, drug free procedures that can help greatly in the ease, control and treatment of the mentioned pathologies in just a few sessions[11, 12]. However, the same protocols that help the patients, can sometimes get on their own way, making difficult, either to monitor/train in normal daily conditions, or to access, due to the technologic hardware architectures involved. 3

1. Introduction In the particular case of HRV biofeedback, the subject has to get out of the normal routine and environment to enter a lab where the procedure takes place. This not only deprives him to train under daily realistic conditions but may also disfigure the condition, since the subject may feel worse or not feel at all the effects of the disorder looking to be treated; not to mention the need to make time for the appointment. 1.4 Thesis Scope This thesis presents a simple structure beginning with an introductory chapter for the HRV biofeedback contextualization, with the needed fundamental and background information. In this context, the nervous system, and cardiac basic functions related to the topic are explored, along with the unveiling of the heart rate variability and its physiological correlates. Further, a view over the psychophysiological feedback (or biofeedback, as these terms can be used interchangeably), is introduced, in order to better understand where does the system explained in the fourth chapter fit; continuing to the autoregressive model, and ending with a brief discussion about the kind of devices needed in the system implementation, as are the physiological monitoring belt and mobile phone. A system architecture is presented that tries to solve the problem defined in last section. There, one can find the methodology implemented as well as the present work components, features and interface. In the fifth chapter, the system is tested to validate its capabilities. Furthermore, a balance is made in the last chapter along with a future work discussion in order to draw the attention to the system importance and potential. 4

2 Fundamentals and Background Contents 2.1 Basic Cardiac Electrophysiology.......................... 6 2.2 Nervous System.................................... 8 2.3 Heart Rate Variability................................. 9 2.4 Biofeedback...................................... 12 2.5 Autoregressive (AR) model............................. 17 2.6 Physiological Monitors................................ 19 2.7 Mobile phones..................................... 20 5

2. Fundamentals and Background This chapter attempts to provide the fundamental concepts needed to better understand further reasoning in the present thesis and the context of the notions behind the work s motivation. Starting with a physiological point of view, basic concepts of cardiac electrophysiology and nervous system are exposed further on, narrowing the view into more specific topics, as are the ones related to heart rate variability and its components and correlates. The second half of the chapter continues with an even less general chain of thought, presenting the AR modeling technique, used in signal processing and ends with an overview on the kind of devices used in the system s architecture presented further: the physiological monitoring devices and mobile phones. 2.1 Basic Cardiac Electrophysiology Figure 2.1: Heart electrical system (from [1]). The heart acts in the body as a blood pump, contracting rhythmically to maintain a blood flux to the lungs for oxygenation and from the lungs into the general circulation and it is the spread of electrical currents through the heart muscle, produced both by pacemakers cells and specialized conducting tissue within the heart and by the heart muscle, that compound the signal for contraction. Under normal circumstances the signal for electrical stimulation starts at the sinoatrial (SA) node, in the right atrium, as it functions as the pacemaker of the heart and spreads through here into the left atrium. First the muscle is electrically stimulated leading into a contraction of the atria and simultaneous pump of blood through the tricuspid and mitral valves into the ventricles. This 6

2.1 Basic Cardiac Electrophysiology Figure 2.2: ECG and the cardiac cycle (adapted from [1]). stimulus then spreads to specialized conduction tissues in the atrioventricular (AV) junction (which includes the AV node and bundle of His), and from there into the right and left bundle branches, transmitting, then, to the ventricular muscle cells. Acting as a sort of electrical bridge connecting the atria and the ventricles, the AV junction is located at the base of the interatrial septum and extends into the interventricular septum (see figure 2.1). Just as the spread of electrical stimuli through the atria leads to atrial contraction, so the spread of stimuli through the ventricles leads to ventricular contraction, with pumping of blood to the lungs and into the general circulation [1, 13]. Electrical currents, generated as action potentials propagate through the heart, can be detected at the surface of the body. An electrocardiogram (ECG) is nothing more than a recording of these electrical signals, i.e., a composite record of the action potentials produced by all the heart muscle fibers during each heartbeat that arrive to the electrodes. Each heartbeat produces a characteristic wave that is, a deflection from the baseline that represents some cardiac event (see figure figure 2.2). For instance, the P wave represents atrial depolarization. A segment is a specific portion of the complex as it is represented on the ECG. For example, the segment between the end of the P wave and the beginning of the Q wave is known as the PR segment. An interval is the distance, measured as time, occurring between two cardiac events, and so, the R-R interval is the time interval that takes from one R wave to the R wave of the next heartbeat[1, 14]. 7

2. Fundamentals and Background 2.2 Nervous System Specialized for rapid conveyance of signals over long distances in a very precise manner, the neuron is the essential building block of the nervous system. In the brain, billions of this kind of cells form complex and highly organized networks for communication and information processing. Information from an individual s surroundings and body, is passed to the nervous system, from where it extracts essentials, stores what may be needed and emits a command to muscles or glands if an answer is appropriate. The answer may come as a reflex or automatic response (within milliseconds), or it may take longer, as a cooperation among many parts of the brain and conscious process may be required. Regardless of the time between stimulus and response, ensuring the optimal adaptation of the organism to the environment is the main task of the nervous system. All the information that arrives to the nervous system is gathered by sense organs, receptors, that react to various forms of sensory information or stimuli, transmitting them in the form of nerve impulses. These tiny electric discharges compound the conveyed signals from the receptors to regions of the nervous system where information is processed. The nervous system can elicit an external response only by acting on effectors, which are either muscles or glands, being the response a movement or secretion, respectively. Obviously, muscle contraction can have different expressions, from communication through speech, facial expression, body posture, respiratory movements and changes in heart rate and blood pressure. Mainly, the idea to retain is that nervous system can only act on effectors to express its will, and so, if we are to judge the activity going on in the brain of another being we have to focus on the expressions produced by muscle contraction and secretion. Anatomically the nervous system can be divided into central nervous sistem (CNS) and peripheral nervous system (PNS), which in turn, although without sharp transitions, can be divided into parts: the somatic nervous system, which is concerned primarily with the more or less conscious adaptation to the external world, and the autonomic nervous system that concerns with the regulation of the visceral organs and internal milieu [15]. The ANS usually operates without conscious control, via reflex arcs. It includes autonomic sensory neurons, integrating centers in the Central Nervous System (CNS) and autonomic motor neurons. A continuous flow of nerve impulses from autonomic sensory neurons in visceral organs and blood vessels propagates into integrating centers in the CNS. Then, impulses in autonomic motor neurons propagate to various effector tissues, thus regulating the activity of smooth muscle, cardiac muscle and many glands. Although it was named autonomic, since it was thought to function autonomously without control by the CNS, it is known that centers in hypothalamus and brain stem do regulate ANS reflexes. Autonomic motor neurons regulate visceral activities by exciting or inhibiting ongoing activities 8

2.3 Heart Rate Variability in their effector tissues. Events like dilation and constriction of the pupils and blood vessels, as well as adjustment of rate and force of the heartbeat are examples of autonomic motor responses. Unlike skeletal muscle, some tissues innervated by ANS often function to some extent, even if their nerve supply is damaged: the heart continues to beat when it is removed for transplantation into another person[1]. A person can not voluntarily slow their heartbeat to half its normal rate, as most ANS responses cannot be consciously modified to any great extension. Howsoever, practitioners of yoga or other meditation techniques can learn, through long practice, how to control some of their autonomic activities to some extent. Biofeedback enhances the ability to learn such conscious control by displaying information about body function in monitoring devices (see chapter 2.4. The ANS output part is divided in two: the sympathetic and parasympathetic. Therefore, most organs have dual innervation; in general, impulses from one division stimulate the organ to increase its activity (excite), and the ones from the other division stimulate the organ to do the opposite (inhibit). For example, an enhanced rate of impulses from the sympathetic division increases heart rate, as in the other hand, if originated by the parasympathetic division, slows the heart rate. The first one is often called the fight-or-flight division: sympathetic activities result in enhanced alertness and metabolic activities, in order to prepare the body for an emergency situation. Such response often occurs during physical activity or emotional stress, in which the heart and breathing rates increase, the mouth dries and vessels dilate, for example. The parasympathetic division is referred as the rest-and-digest division, as its activities conserve and restore body energy during times of rest or digesting a meal. Albeit being both divisions concerned with maintaining health, the way they do so is dramatically different [1]. 2.3 Heart Rate Variability Heart rate Variability (HRV) is the variation over time of the period between two consecutive heartbeats, or correspondingly, the variation in the instantaneous heart rate. Its clinical relevance was noted for the first time in the mid 60 s when Hon and Lee [16] observed that alterations in interbeat intervals preceded fetal distress, even before any appreciable change on the heart rate could be noticeable. Almost 20 years later, Akselrod et al. [17] introduced power spectral analysis of heart rate fluctuations, to quantitatively evaluate beat-to-beat cardiovascular control [6]. Nowadays, HRV is thought to reflect the heart s ability to adapt to changing circumstances by detecting and quickly responding to unpredictable stimuli. Its analysis is the ability to assess overall cardiac health and state of the ANS which is responsible for regulating cardiac activity[18]. 9

2. Fundamentals and Background 2.3.1 Time and Frequency Domain Methods The evaluation of the variations in heart rate can be done by various methods. Probably, the simplest to perform are in the time domain, namely instantaneous heart rate, or the mean normal-to-normal (NN) interval (time interval between adjacent QRS complexes), mean heart rate, difference between the longest and shortest NN interval, difference between night and day heart rate, and so on. Other measurements include variations in heart rate secondary to breath, body tilt, Valsalva maneuver or phenylephrine infusion[6]. Mainly, two types of HRV indices are distinguished in time domain analysis: short-term variability indices, which represent fast changes in the heart rate, as opposed to long-term indices, which concern slower transitions. Both of them are calculated from R-R intervals within a predefined window. From the original R-R intervals, a number of statistical parameters can be calculated, namely the SDNN, as in standard deviation of the NN intervals; the standard error, or standard error of the mean SENN, the standard deviation of differences between adjacent NN intervals. RMSSD, the square root of the squared differences of successive NN intervals; NN50, the number of interval differences of successive NN interval greater than 50 ms, and pnn50, the proportion of NN50 in the total number of NN intervals. All of these measurements estimate high-frequency variations in heart rate and are highly correlated [6, 18] Other approach to the analysis of the HRV in the time domain are the geometrical methods, which present RR intervals in a geometric pattern, such as the sample density distribution of NN interval durations, sample density distribution of differences between adjacent intervals, Lorenz plot of NN or RR intervals, and so forth. A simple formula is used, that judges the variability on the basis of the geometric or graphic properties of the resulting pattern[6]. Basically, three general approaches are used in geometric methods. First, a basic measurement of the geometric pattern is converted into the measure of HRV; next, the geometric pattern is interpolated by a mathematically defined shape and the parameters of this mathematical shape are used; then the geometric shape is classified into several pattern-based categories that represent different classes of HRV[6, 18, 19]. The Poincaré plot is another time domain method that displays each RR interval as a function of the next one. This is a technique taken from nonlinear dynamics and portrays the nature of the RR interval fluctuations. Resembling the geometric methods, the shape of the plot is categorized into functional classes that indicate the degree of the heart failure in a subject[18, 19]. In spite of the computational simplicity of the time domain methods, they lack the ability to discriminate between sympathetic and parasympathetic contributions of HRV, hence, they are not very helpful in the ANS assessment. Spectral analysis gives information about the frequency content and sources of variation in a time series. Methods to access this information may be generally classified as parametric and nonparametric. In general, both methods provide comparable results[6, 20]. 10

2.3 Heart Rate Variability Nonparametric methods generally have simpler algorithms and high processing speed. Considering them, the most used method is the fast Fourier transform (FFT), but these methods suffer of spectral leakage due to windowing. The spectral leakage leads to masking of weak signals that are present in the data[6, 19]. The parametric (model based) methods avoid the problem of leakage and provide better frequency resolution than nonparametric methods. The AR model, which is discussed further in section 2.5, fits in the latter and is an alternative to Fourier transform, being also the method for high-resolution spectral estimation of a short time series[6, 20]. 2.3.2 Spectral and Physiological components Generally, in a spectrum calculated from short-term recordings (no more than 5 minutes), three main components are distinguished: very low (VLF; 0.04Hz), low (LF; 0.04 0.15Hz) and high (HF; 0.15 0.4Hz) frequency components[3, 6, 17, 21]. Autonomic modulations of heart period may produce variations in the distribution and central frequency of LF and HF components. The physiological process explanation of the VLF component is much less defined, that is, if there is one, since its existence is questioned. It is somehow consensual that the VLF part of HRV spectrum has as its major constituent the nonharmonic component and, therefore, is a dubious measure when assessed from short-term recordings. When analyzing sequences of entire 24-hour periods, in addition to the other three, one more component may be considered, the ultra low frequency (ULF) component[6]. The HF component is mainly composed by efferent vagal activity, proven by clinical and experimental observations of autonomic maneuvers such as electrical vagal stimulation, muscarinic receptor blockade and vagotomy[6, 21 23]. Less consensual is the interpretation of the LF component which is considered as marker of sympathetic modulation for some and as a parameter that is composed by both sympathetic and vagal activity for others. This discrepancy is due to the fact that a decrease in the absolute power of the LF component is observed in some conditions associated with sympathetic excitation. Consequently, the LF/HF ratio is considered by some investigators to mirror sympathovagal balance or to reflect the sympathetic modulations[6]. During sympathetic activation the resulting tachycardia is usually accompanied by a marked reduction in the total power, while the reverse occurs during vagal activation. When expressed in absolute units, changes in total power influence LF and HF components in the same direction, what prevents the appreciation of the fractional distribution of energy. So it is useful to use normalized units in order to emphasize the relative changes between each component[4, 6]. A circadian pattern can be found in spectral analysis from 24-hour recordings, namely in LF and HF components when expressed in normalized units, showing higher values of LF during the daytime, and of HF by night. Nevertheless, these patterns become undetectable if a single spectrum of the entire 24-hour session is plotted. In long-term recording, the slice of the total 11

2. Fundamentals and Background power LF and HF account for is approximately 5%. This means that the ULF and VLF components account for the remaining 95%, though, their physiological correlates are still unknown[6]. 2.3.3 Cardiovascular System and Resonant Frequencies Over thirty years ago, research made in Russia found that very high oscillations in heart rate could be induced when breathing at frequencies around 6 breaths per minute. This resonant frequency represents a natural rhythm that has been observed for many decades. Its control by the ANS has been matter of great debate, since, although many investigators defend they reflect sympathetic activity, or a combined both sympathetic and parasympathetic activities, as discussed in the previous section about the LF component of HRV spectra, opinion seems to be shifting into the entirely parasympathetic activity interpretation. However Lehrer and Vaschillo[11] state that this particular issue has not been resolved because of the very complex nature of autonomic nervous system s control of HRV and the complex structure of the ANS[11, 24]. Notwithstanding, it is somehow consensual that this resonant frequency, also called 10-second wave or.1hz wave, is greatly affected by activity of the heart rate baroreflex, that is the reflex mechanism by which blood pressure lability is controlled and modulated. This reflex modulates blood pressure through two main pathways: heart rate, the one responsible for the.1hz wave, and vascular tone[11]. A blood pressure rise detected by baroreceptors in the carotid artery, causes a baroreflex response which is a heart rate drop. Lowering the heart rate decreases the volume of blood pumped through the vascular system, which translates into a blood pressure fall. Analogously, the opposite happens when the blood pressure falls too much. This is how the baroreflex modulates changes in the blood pressure through the heart rate pathway[11]. Now, the blood pressure change resulting from the heart rate changes is delayed by several seconds due to the inertia in the blood coursing through the vascular system. Since inertia increases with mass, this delay is grater in taller people than in shorter, and in men than in women, and thus, this 10-second wave actually ranges from 9 to 13 seconds[11]. Stimulating the cardiovascular system at this frequency activates and strengthens the heart rate baroreflex pathway and, thereby, strengthens an important source of ANS modulation. Increased gain in the baroreflex is found both acutely and chronically after biofeedback training[24, 25]. HRV training appears to bestow a number of benefits to the system, which, among other things, are discussed further in section 2.4.2. 2.4 Biofeedback Although not taken very seriously in early beginnings, biofeedback has matured to a modality closer to mainstream treatment, nowadays. Aimed at helping individuals take responsibility 12

2.4 Biofeedback for their well being, including responsibility for the cognitive, emotional, and behavioral amendments necessary to effect healthy physiological change, biofeedback, also referred to as applied psychophysiological feedback, refers to both a process and the instrumentation needed in that process[26, 27]. The process is one of displaying involuntary physiological processes, and learning to voluntarily influence those monitored and fed back processes by making changes in cognition. This provides a visible and experimental demonstration of autonomic functions for improving health. The term was coined in 1969 to describe laboratory procedures, developed almost 30 years earlier, in which subjects learned to modify heart rate, blood flow and other physiologic functions that were not normally thought of as consciously controllable[26, 27]. McKee[27], even states that feedback itself has been present through much of human history, particularly through the use of mirrored surfaces to practice the expression of emotion. One or more physiological processes are monitored by biofeedback instruments as they measure and transform that information into simple, direct, immediate, human readable/sensible signals. Typically, biofeedback equipment is noninvasive and current computerized instruments can provide simultaneous displays and recordings of multiple channels of physiologic information. This enables the individual being monitored to change some physiologic process under the biofeedback equipment guidance. The number of sessions needed may vary from a few to 50 or more, depending on the individual and the disorder. Normally, though, the great majority of patients obtain benefit in 8 to 12 sessions[27, 28]. Only ones imagination and technological capabilities can limit how and which real-time physiologic data to feedback. Early noncomputerized equipment for this purpose provided feedback through the onset and offset of sounds, varying tones and volume; or the turning on and off of lights, and digital numeric displays indicating both the direction of change and absolute values. Nowadays, computerized equipment uses such feedback features as computer games, that the patient wins by reaching a goal, which is related to a physiological change accomplishment[27]. Neurofeedback (Electroencephalographic biofeedback) has become a separate area of study and application, in which a baseline electroencephalogram (EEG) is used to identify abnormal patterns, and follow-up training is provided to teach the patient to healthily change them. More recently, HRV has grown into use as a measure of adaptability or autonomic balance. Working with cosmonauts in measuring autonomic function, Soviet scientists were the first to study HRV biofeedback. Because diminished HRV is a predictor of increased risk for cardiac mortality, teaching patients to increase the this variability made sense. Training involves instruction in breathing at a frequency related to optimal low-frequency band power, i.e., a resonant frequency[25, 27]. This topic is discussed further in section 2.4.2. 13

2. Fundamentals and Background 2.4.1 Efficacy Evaluating Criteria In order to evaluate the clinical efficacy of biofeedback/psychophysiologic interventions a criteria was created and published by a task force of the Association for Applied Psychophysiology and Biofeedback and the Society for Neuronal Regulation[28, 29]. These criteria, adapted from McKee[27], are detailed below: Level 1: Not empirically supported - This designation applies to interventions supported only by anecdotal reports and/or case studies in non-peer-reviewed venues (not empirically supported). Level 2: Possibly efficacious - This applies to interventions supported by at least one study of sufficient statistical power with well-identified outcome measures but which lacked randomized assignment to a control condition internal to the study. Level 3: Probably efficacious - This applies to interventions supported by multiple observational studies, clinical studies, wait-list-controlled studies, and within-subject and intra-subject replication studies that demonstrate efficacy. Level 4: Efficacious - 1. In a comparison with a no-treatment control group, alternative treatment group, or sham (placebo) control using randomized assignment, the intervention is shown to be statistically significantly superior to the control condition, or the intervention is equivalent to a treatment of established efficacy in a study with sufficient power to detect moderate differences, and 2. The studies have been conducted with a population treated for a specific problem, for whom inclusion criteria are delineated in a reliable, operationally defined manner, and 3. The study used valid and clearly specified outcome measures related to the problem being treated, and 4. The data were subjected to appropriate data analysis, and 5. The diagnostic and treatment variables and procedures were clearly defined in a manner that permits replication of the study by independent researchers, and 6. The superiority or equivalence of the intervention has been shown in at least two independent research settings. Level 5: Efficacious and specific - 14

2.4 Biofeedback This designation applies when the intervention has been shown to be superior to credible sham therapy, pill therapy, or alternative bona fide treatment in at least two independent research settings. These were used recently (2008) by Yucha et al. in an article rating available evidences on the efficacy of biofeedback interventions e various diseases and conditions[28]. 2.4.2 HRV Biofeedback HRV biofeedback is designed to control oscillatory variability in heart rate, thus exercising and focusing in the physiological control mechanisms of the own body. Generally, other biofeedback methods influence these pathways more indirectly by teaching people to control tonic level of various physiological functions (as muscle tension, finger temperature, heart rate, blood pressure, etc.). However, controlling tonic levels is noticeably more difficult than learning to increase HRV[30]. Moreover, HRV feedback is much simpler and straightforward to learn and use, compared to neurofeedback, which facilitates rapid improvement[12]. Whenever the cardiovascular system is stimulated (by anything: physical exercise emotionallyrelevant events or even thoughts, changes in posture or head tilt, breathing, etc.), a set of oscillations take place which gradually decrease in amplitude over time. This oscillations are caused by the interplay of the heart rate and blood pressure and the baroreflex mechanism[11]. As discussed in section 2.3.3, the cardiovascular system is characterized by specific resonance frequencies of HRV that exist at a particular frequency for each individual, within the lowfrequency range of the HRV spectra. The resonance frequency for each individual lies at the frequency at which the system, when rhythmically stimulated, produces the maximum HRV. Usually this resonance frequency is around 0.1Hz or about 6 cycles per minute, for most individuals. Depending on the timing of the stimulus (i.e., if it comes when the heart rate is rising or falling), if the system is stimulated at the resonant frequency, its effects will either smooth the amplitude of the heart rate or oscillation or augment it. When a person breathes at sensibly 6 breaths per minute (the resonant frequency), due to phase relationships between heart rate and blood pressure at this frequency, the respiratory stimulus causing heart rate to rise occurs precisely at the same time as the baroreflex impulse causing heart rate to rise. The same occurs in the inverse direction, causing heart rate to fall. This causes a persistence of the augmented heart rate oscillation at the resonant frequency. At this frequency, and only at this frequency, heart rate and respiration are perfectly in phase with each other and heart rate oscillations become very large. Additionally, heart rate and blood pressure oscillate in perfectly opposite directions. This means that the baroreflexes are stimulated with every breath, causing an increase in heart rate oscillations[11]. The stimulation of the baroreflex with every breath, as in the exercise of any reflex, leads to an evolution of the reflex, making it more efficient. Lehrer and Vaschillo[11] found that in healthy 15

2. Fundamentals and Background people practicing HRV biofeedback daily for about three months, the gain in resting baroreflex increases (i.e., a bigger change in heart rate for each mm Hg change in blood pressure), which means a stronger modulation of blood pressure[11]. It is only normal to expect that HRV biofeedback would decrease blood pressure lability, and conditions associated with it. It is reasonable to expect that everything related to neural substrates of blood pressure reactivity also will be modulated, including emotional reactivity. In fact, stimulation with stress hormones of brain centers involved in baroreflex control, has been found to cause a decrease in baroreflex gain, in animal research, with a consequent increase in blood pressure lability. Hence, emotional lability relationship with blood pressure lability and baroreflex control may explain the variety of disorders that seem to respond well to HRV biofeedback, as are asthma, hyperventilation syndrome, hypertension, hypotension, anxiety, depression, fatigue, pain, etc[7, 8, 11, 24, 30 32]. Some of this research has yet to be validated by controlled research, nonetheless, it is consensual that this biofeedback training features benefits to the system which include maximizing respiratory efficiency, decreasing hypoxic ventilatory response while improving oxygen saturation and increasing resistance to hyperventilation, increasing efficiency of the baroreflex that indirectly modulates general emotional reactivity, and improving the ability of the cardiovascular system to adapt to circulatory requirements. Not to mention the enhancement of athletic performance associated with all this energy efficiency and metabolic energy savings[24, 25, 33, 34]. There are a few HRV training strategies which can be used to increase cardiac variability in a health enhancing way including psychophysiological or heart rhythm coherence feedback, or oscillatory biofeedback, and resonant frequency training (RFT)[12, 35, 36]. In the psychophysiological or heart rhythm coherence, the coherent mode, which is the mode at aim by the subject, is represented by a sine wave-like pattern in the heart rhythms and a narrow-band, high-amplitude peak in the low frequency range of the HRV power spectrum, at about 0.1Hz[12, 36]. In comparison to other training criteria, according to Surtarto et al. [12], resonant breathing appears to become the most promising strategy being applied at workplace. All of HRV biofeedback strategies are essentially directed to augment the amplitude of HRV. However over other strategies, RFT biofeedback demonstrates how to obtain the high amplitude instead of simply producing a smooth sine wave-like pattern of heart rhythm. Unlike in psychophysiological coherence, RFT technique works by allowing subjects to gain control of their physiology rather than relax under pressure[12]. Lehrer et al. [35], published a manual procedure for HRV biofeedback training. The main concept of the training is to assist the subjects to determine their resonant frequency at which maximum amplitudes of HRV are generated and to teach them to breathe according to their specific frequency. A combination of slow abdominal breathing and a positive emotion maximizes 16

2.5 Autoregressive (AR) model HRV in the LF spectrum because it superimposes the effects of three oscillators: breathing, autonomic activity blood and pressure regulation. As the training continues, they can voluntarily maintain the changes in their heart rhythm patterns, which generally become more regular, with greater amplitude and sine wave-like. The subject breathes for intervals of 2-3 minutes at frequencies ranging from 6.5 to 4.5 breaths/min, at steps of 0.5 breaths/min. The resonant frequency is then determined as the respiratory frequency producing the highest power peak[12, 35]. 2.5 Autoregressive (AR) model In biomedical engineering, AR model is used specially in the spectral analysis of heart rate variability and electroencephalogram tracings, because it can take advantage of the noise inherent in a biological system and extract information from propagation of that noise in a signal[6, 20]. The model assumes that the process to be studied is stationary and stochastic, and predicts the current values of a time series from its past values. This future dependency on past values is demonstrated by an autocorrelation function, that is the average of the product of a data sample with a version of itself advanced by a lag: r xx [k] = 1 N N k i=1 x[n]x[n + k] (2.1) where r xx is the autocorrelation value of x at sample delay k, and N the number of data points[6, 20]. The AR model may be seen as a set of autocorrelation functions: the modeling of a time series is based on the assumption that the most recent points possess more information than the older data points. For a small advance, the values of the two signals at any given instant will be similar, and as the lag increases, so does the difference between their values. If a signal has both a periodic and a random component, the latter will gradually disappear as the lag increases, which is useful for extracting periodic signals from random noise. This approach transforms the view of a signal into a weighted sum of the previous values of the same series plus an error term. The AR model is defined by: x[n] = M a i x[n i] + ɛ[n] (2.2) i=1 in which x[n] is the current value of the time series a 1,...,a M are the weighting AR coefficients, M is the model order, and ɛ[n] the difference between the predicted value and the current value at this point, i.e. the prediction error[20]. The AR model determines an analysis filter, through which the time series is filtered. If we manipulate the equation 2.2, we get the filter with an impulse response [1, a 1,..., a M ], that 17

2. Fundamentals and Background produces the prediction error sequence (PES), M ɛ[n] = x[n] a i x[n i] (2.3) The coefficients are estimated aiming to minimize the error ɛ[n] through the least-squares minimization technique. So, from equation 2.2, if we write the expressions for the M estimates, we get the set of linear equations: i=1 x = x[m] x[m 1]... x[1] x[m + 1] x[m]... x[2]...... x[n 1] x[n 2]... x[n M] a + ɛ = Xa + ɛ (2.4) with a and ɛ being a = a 1. a M, ɛ = ɛ[m + 1]. ɛ[n] (2.5) Optimum predictor coefficients (a opt ) can be obtained applying the orthogonality principle in the least-squares minimization technique. This will minimize the mean-square error. Now ɛ is independent of the data X, this means that ɛ is the portion of the time series that can not be explained by previous data, namely the last M data points[20, 37]. From eq. 2.3 we can see that: X T ɛ = X T (x Xa opt ) (2.6) Where a opt represents the optimal coefficients. Now, since the first term is zero due to the orthogonality of its constituents, we get, Which is called the covariance method. X T Xa opt = X T x a opt = (X T X) 1 X T x (2.7) When dissected we can see that, the matrices X T X and X T x, due to their likeness with these others, can be approximated to r(0) r( 1)... r(1 M) X T X N R = r(1) r(0)........... r( 1) r(m 1)... r(1) r(0) (2.8) And X T x N r = r(1) r(2). r(m) (2.9) 18

2.6 Physiological Monitors From the combination of the equations 2.8 and 2.9, we conclude from eq. 2.7 that a opt = R 1 r (2.10) Which is called the Yule-Walker equation[20, 37]. 2.6 Physiological Monitors Figure 2.3: Typical wireless heart rate monitor In order to get physiological data transformed into analogic or digital signals they need to be harvested from the body. Physiologic monitors have been in regular commercial production since the 1950 s, though their practicality in the early beginnings were close to none. Only 20 years later, the first wireless heart rate monitor was born, in Finland. Regardless its basic architecture, consisting of a monitoring box and a set of electrodes attached to the chest, such devices became increasingly popular among athletic circles, considering that they allowed train monitoring, enabling performance improvement[38]. Nowadays, physiological monitoring devices, in particular heart rate monitors, are available at reasonable prices. There are a myriad of architectures for these monitors, ranging from wristwatches with two electrodes, to sports bra for women, with embedded electrodes. The most popular, though, consist of a chest monitor and a wrist bracelet display (see figure 2.3) that, besides heart rate, may measure temperature, complete ECG, breathing rate, and even posture and acceleration[39]. Even though the contact between electrode leads and skin was an issue for a long time, limiting and compromising the freedom of movement achieved by the wireless architecture, state of the art monitors designed with conductive smart fabric and built-in microprocessors, analyze the ECG at a rather high sampling rate, calculating the heart rate and R-R interval[39]. Finally, the most recent devices, besides recording and storing the physiological information, are able to transmit it through Bluetooth R wireless technology into a suitable device (that can be a desktop or laptop personal computer or even a mobile phone) for real-time computational advanced signal processing[39]. 19

2. Fundamentals and Background 2.7 Mobile phones Figure 2.4: Android running smartphone and tablet, respectively. Long gone are the times when a mobile phone could simply serve as a phone. Their late evolution has made them smaller, lighter, more efficient and autonomous, computationally better and virtually ubiquitous. The latest are called smartphones, and their built-in sensors and late applications have transformed them into a technological Swiss knife. Over the last few years mobile phones have evolved into attractive platforms for novel types of applications. Yet, when compared to the design and prototyping of desktop software, mobile phone development still requires programmers to have a high level of expertise in both phone architectures and their low-level programming languages. Nowadays, almost every mobile phone operating system (OS) enters the market accompanied by its own developing platform and Application Programming Interface (API) and associated programming language, not only enabling but also encouraging open source and third party development. Examples of this are Java J2ME, that, although lacking of some freedom of in-depth phone control, is still very frequent in present day devices, or C++ Symbian from Nokia R, or Objective C, in which iphone R applications are written, or even C and Java used by Android OS[40]. Android is a mobile OS that is based on a modified version of Linux. Its code was released under the open-source Apache License, making it open and free. Moreover, vendors, like hardware manufacturers, can add their own proprietary extensions to Android customizing it to differentiate their products from others. The main advantage of using Android is that it offers a unified approach to application development. Developers need only to develop for Android. Their applications should be able to run on different devices, regardless of the manufacturer, as long as they are powered using Android[41]. Another popular category of devices that manufacturers are rushing out is the tablet (see figure 2.4). An Android running tablet, is in almost every way like a smartphone, only bigger (sizing typically seven inches, diagonally) and with more powerful processors which grant a better computational performance. 20

2.7 Mobile phones In spite of the obstacles typically associated with mobile applications development, as are the emulator and/or on-device testing and debugging processes, for example, and all the other challenges related to hardware programmatic manipulation, the advantages and possibilities exclusive to mobile phone applications overcome the pain of developing them. This is particularly true as far as the development of Android applications is concerned, as it considerably eases the amount associated pain. 21

2. Fundamentals and Background 22

3 System Framework Contents 3.1 System Architecture................................. 24 23

3. System Framework 3.1 System Architecture Figure 3.1: System architecture. The application hereby presented is basically composed by three main parts: the bluetooth connection, for data exchange; the signal processing; and the processed data display. These are directly associated with the three biofeedback cycle intervenients: the monitoring device, the smartphone and the subject (see Figure 3.1). 3.1.1 Development environment setup In order to start the project development, a whole system setup had to be performed. This setup is composed mainly of three parts: 1. Installing the Integrated Development Environment (IDE): This kind of software development is made easier when performed in an IDE. There are a few available for free download, like Netbeans or Eclipse, for example. We chose the Pulsar version of the latter, which is specially designed for mobile applications development, and can be found in the site http://www.eclipse.org/pulsar/ for download. Its installation is very simple and consists of simply unzipping the downloaded file. 2. Installing the Software Development Kit (SDK): To enable the Android application development and debug we need to instal the Android SDK that comes with an emulator, for debugging purposes. The following steps describe what must be done: 24

3.1 System Architecture Download and instal the Java Development Kit (JDK), available in http://www.oracle. com/technetwork/java/javase/downloads/index.html; Download and instal the Android SDK itself, available in http://developer.android. com/sdk/index.html; Configure Eclipse IDE, installing the Android Developmente Tools (ADT) Plugin, as explained in the site http://developer.android.com/sdk/eclipse-adt.html#installing. 3. Installing the monitoring belt software: The ZephyrRBioHarness monitoring belt is provided with its own software CD. In it can be found among other tools the Bioharness BT Config Tool and BioHarness Log Downloader, which are self explanatory. 3.1.2 Bioharness R monitoring belt and Connection Figure 3.2: Zephyr R BioHarness: (A) overview (B) posterior and anterior view. As stated before, the system has in its composition a wireless physiological monitoring device: the Zephyr R BioHarness (see figure 3.2), which is made of two parts, the Smart Fabric chest strap, and the Bioharness Module which contains infra-red temperature sensor for monitoring skin temperature and a 3-axis accelerometer for posture and activity monitoring. The latter can be detached from the first for recharging and/or cleaning purposes, since the chest strap, though incorporating sensors to monitor ECG signals and respiration rate, can be washed with no harm done[39]. The recharging cradle also serves as vessel for USB connection between the module and a personal computer for configuration and/or stored session log data download. Raw sensor data is filtered, processed and analyzed within the device, which can operate in three modes: Transmit mode, Record mode and Transmit & Record mode, which are reported by the LED indicator flashing pattern. In Transmit mode, data is transmitted by a Class II Bluetooth R 25

3. System Framework to a corresponding receiver device over a 10 meter range. This allows physiological data to be monitored using any suitably-configured Bluetooth R device. In Record mode, data is logged into internal memory for later download. The third mode is self-explanatory[39]. The strap is properly used placed just below the chest muscles. It should be fasted in the back, adjusting the chest strap tension until tight but comfortable, and the Bioharness Module must be turned on by a long press on the power button before coupled to the strap, right in the middle of the chest[39]. Each type of physiologic information measured by the Zephyr R BioHarness system has its proper sampling and transmission settings. The description of the transmitted data and associated default settings is presented in Table 3.1. Table 3.1: Zephyr R BioHarness Bluetooth transmitted data description (from [5]) Parameter f s (Hz) Range Units Description Heart Rate 1 0-240 bpm Beats per Minute ECG Waveform 250 0-1024 bits - Heart Rate R-R 18 Minimum 250 ms alternate ± sign at new detection Breathing Rate 1 0-70 bpm Breaths per Minute Breathing Waveform 18 0-4095 bits breathing depth not available Skin Temperature 1 0-60 C Degree Celsius Posture 1 ± 180 Degress Vertical = 0 Activity Level 1 ± 3.3 VMU (g) - X axis Acceleration 50 ± 3.3 VMU (g) Vertical Axis Y axis Acceleration 50 ± 3.3 VMU (g) Lateral Axis Z axis Acceleration 50 ± 3.3 VMU (g) Sagittal Axis The different types of physiological data are streamed through the Bluetooth R wireless link in the form of packets. These are a segment of ASCII character corresponding to decimal codes carrying samples of information. There are five of this kind: General Data Packets, ECG Data Packets, R to R Data Packets, Breathing Data Packets and Accelerometer Data Packets[5, 42]. These streaming packets are periodically sent after enabled and their description is presented in Table 3.2. Table 3.2: Zephyr R BioHarness Bluetooth streaming packets description (from [5]) Packet Type Transmission Period (ms) f s (Hz) N Description General 1008 1 1 Skin Temperature, Heart and Breathing Rate and Posture Breathing 1008 18 18 Breathing Waveform R to R 1008 18 18 Calculated from the ECG ECG 252 250 63 ECG Waveform Accelerometer 400 50 20 X, Y and Z accelerometer waveforms Finally, the Bluetooth R Serial Port Profile connection and received information is handled in the device using a Java library, the BioHarnessBT.jar, released by Zephyr R Technology for this 26

3.1 System Architecture sole purpose[43]. 3.1.3 Android device The second limb of the system is the Android running device. Although this application may be deployed and ran in any Android, 2.2 or later, supporting device, the development and debug phases were carried out using an LG-P350 mobile phone and an ASUS Eee Pad Transformer TF101 tablet. Concerning this architecture, the mobile device terminal is responsible for three main tasks: the establishment and manipulation of the Bluetooth R connection with the monitoring belt; the received physiological data treatment, or signal processing; and the treated human readable physiological data display. If in the Transmission mode, the Zephyr R BioHarness immediately starts transmitting data after switched on in the power button; this data can only be monitored if a Bluetooth R connection is indeed established. Notwithstanding their late evolution, mobile devices are not designed for very challenging mathematical calculations and have yet a lot to evolve before they can be compared, in terms of computational robustness, with actual computers. Having this in mind, the signal processing, in this particular case, has to be done using the minimum resources possible. Next section exposes the way this optimization is done, ensuring a simple but effective real time signal processing. 3.1.4 Signal processing Only the R to R data transmitted needs processing, for HRV biofeedback purposes. As aforementioned, each R to R data packet sent by the belt contains samples of R to R intervals. The R to R interval is stored within the BioHarness every 56ms; therefore the values in this packet are static until another QRS wave complex has been recognized. When the raw data is plotted (figure 3.3), one can see that the raw data (blue dotted trace) changes sign every time the R to R period is changed (when a new QRS complex has been recognized). Therefore the sign must be removed from the raw data to view the actual R to R period (in milliseconds), as seen in the solid red trace[43]. Approximately every second (1008ms), a packet containing 18 samples of the R to R interval is received. Thus, this physiological information is sampled at approximately 18Hz (see Table 3.2). As we saw in section 2.3.2, the HRV spectrum from short term recordings ranges from 0.015Hz to 0.4Hz. This means that the signal is clearly oversampled, since it is sampled at 18Hz and the physiological processes of interest expressed in the HRV spectrum, vary, at most, at a frequency of 0.4Hz. 27

3. System Framework Figure 3.3: Transmitted R to R raw and real data (from [2]). Now, the Nyquist sampling theorem states that in order to sample a signal without losing information, the sampling frequency must be higher or equal to the double of the highest frequency of the original signal[37]. Hence, we can downsample the signal by a factor superior to 15 and still have a sampling frequency superior to twice the highest frequency, i.e., 18/15 = 1.2Hz, 1.2 0.4 2 = 0.8Hz. In opposition, if the sampling theorem is not satisfied, besides the inherent data loss, a phenomena called aliasing occurs, in which frequencies higher than the sampling frequency are mirrored back contributing to lower frequencies and, thus, defiling the original signal[37]. This means that preceding the downsampling, the signal must be filtered with a low pass filter, cutting frequencies higher than the new sampling frequency, or, in other words, submitted to an anti-aliasing filter. Due to the signal characteristics, a simple first order filter is enough to avoid aliasing, therefore allowing for a less demanding computational effort in the filtering process. Then we proceed to the downsampling itself, which consists in picking one out of every K samples of the filtered series. Let the filtered signal be denoted y[n], the downsampled signal is given by d[n] = y[kn] (3.1) where K is the downsampling factor, which is in this particular case equal to 15. The frequency content of the downsampled time series can be accessed using the AR model. As explained in section 2.5, AR modeling uses the time history of a signal to extract important information. The model predicts the current values of a time series from its past values, assuming that the most recent data contain more information than the older, and that each value of the series can be predicted as a weighted sum of the previous values of the series, plus an error 28

3.1 System Architecture term. The AR model determines an analysis filter, through which the time series is filtered. The AR coefficients are calculated in order to minimize the PES using the least squares minimization technique. Having the AR coefficients, the spectrum of the modeled time series, R(e jω ) is obtained by multiplying the PES variance with the square of the transfer function H(e jω ) of the filter: R(e jω ) = H(e jω ) 2 σp 2 (3.2) = σ 2 p 1 a 1 e jω... a M e jmω 2 (3.3) The higher the M chosen, the better will the identified model fit the measurements. The frequency resolution grows with M, however, a greater M means a greater computational effort and less robust power estimates. The ideal model order for this sampling frequency has been determined using Akaike s information Criterion[44] (AIC), that is formulated as follows: AIC(M) = Nln(σp) 2 + 2M (3.4) 900 895 890 AIC value 885 880 875 870 865 0 5 10 15 20 25 30 Model order Figure 3.4: AIC values for model orders of 1 to 30 for a random sample of R-to-R interval data in which σp 2 is the prediction error variance associated with the model order M, used to model the spectrum of the signal of lenght N. The model orderm to be selected minimizes the value of the criterion. Submitting a sample of R-to-R interval data of the length used to plot the real time spectra and varying the model order under the AIC, it was found that the order which minimized the criterion was M = 7 (see Figure 3.4). Such an order is considered ideal, not only because it minimizes the aforementioned criterion, but also because, once it is not too high, it does not compromise the computational speed needed for the real time calculations. 29

3. System Framework Figure 3.5: Signal processing performed to access the HRV s spectral information. 30

3.1 System Architecture Figure 3.5 summarizes conceptually the whole processing done in the smartphone to deliver the HRV s spectral information. Since the application displays information in a real-time basis, all these methods have to be continuously performed over time. The way this is done is explained further in the next section. 3.1.5 User Interface The user interface (UI),since it is the part with which the user interacts, is one of the most crucial parts of the system. When the application is first started a simple menu is displayed with six buttons. As the application needs to be connected to the monitoring belt in order to function, before it is connected, the only enabled buttons are the Connect, About and Exit. Just below the Connect button is the status of the connection (see Figure 3.6). Once connected, the buttons Real Time HRV Analysis, Orthostatic Test and RF Biofeedback Training, become active, enabling their self-explanatory functions (Figure 3.6-B). Pushing the first of these last three buttons leads to another screen. Here a real time HRV analysis is displayed through several plots containing different information. 3.1.5.A Real Time HRV Analysis Stepping back a little, although R to R data is sampled at 18Hz by the Zephyr R BioHarness belt, only once a second a packet arrives to the signal processing device. This means that the highest frequency at which the UI can be usefully refreshed is 1Hz. In the very beginning, when the Bluetooth R connection is established and data starts to arrive to be processed, there is not enough information to treat, and therefore a few seconds have to be recorded before any processing takes place. Fifteen seconds after the start of the acquisition, a draft of the spectrum and dependent information can be drawn. Since the lowest plotted frequency is 0.015Hz, the spectrum will only be completely reliable after, sensibly, a minute and seven seconds of flawless acquisition. A window is filled with R to R interval data and processed (as explained in Section 3.1.4), for the first time, fifteen seconds after the arrival of the first data samples. This circular window retains data and continues to grow up until it covers a minute and ten seconds, moment when it starts to let go older samples at the same rate as new ones enter, thus reaching its full size. Figure 3.7 shows the display after pushing the Real Time HRV Analysis button. As soon as there is enough data recorded, the R to R interval plot starts to be displayed (top plot) along with other physiological information (displayed in the down left corner), such as heart rate in beats per minute (BPM), respiration rate in breaths per minute, body temperature, posture and acceleration. The two bottom plots concern the frequency domain information. The one in the left displays the real time modeled power spectra of HRV of the aforementioned window of seventy seconds. 31

3. System Framework Figure 3.6: HRV Application first menu: (A) Before the establishment of a connection; (B) Connected. 32

3.1 System Architecture Figure 3.7: Display in the Real Time HRV Analysis functionality of the application. The last plot displays the relationship between the HF component of the power spectrum and its components ratio LF/HF, since these are thought to express the parasympathetic and sympathetic modulations, respectively (see Section 2.3.2). All the routines that are used to display all this information keep on running on the background as long as the application is running connected to a monitoring device. Although this functionality alone could be used to test the system robustness and to perform biofeedback procedures, as psychophysiological coherence, this available information can be manipulated and made useful for more specific controlled protocols as are the Orthostatic Test and RF Biofeedback Training. 3.1.5.B Orthostatic Test The orthostatic test is a simple test implemented, mostly, to test the system itself and its reliability when compared with similar known procedures results in bibliography. It consists, basically, in recording the behavior of the HRV during time span that comprises a brief period (2 mins) of rest, in the horizontal position; the stand up; and another brief period 90 o of head up tilt. Pressing the Orthostatic Test button of the main menu starts a screen that guides the user through the whole procedure, giving the instructions to follow, in order to successfully accomplish the test, achieving meaningful results. Right after entering this functionality, the user is told to lay down and press OK. This will start the test (see Figure 3.8). A screen is then displayed encouraging the user to breathe normally and wait while the system records. Likewise, a dialog then tells the user to carefully stand up and press OK to signalize it and continue the procedure, in standing position (see Figure 3.9). Results are displayed automatically as soon as the recording ceases. Figure 3.10 shows how the results are displayed: The top plot exhibits the R-R Interval time series of the whole process, 33

3. System Framework Figure 3.8: Orthostatic test display: (A) before start, (B) after start, in rest position. 34

3.1 System Architecture Figure 3.9: Orthostatic test display: (A) stand up dialog, (B) head up 90 o tilt position recording screen. 35

3. System Framework which provides means to analyze the heart rate behavior not only during the static positions of the subject, but also while he stands up changing from one position to another. Below, a configuration similar to the one used to display spectral information presented in the previous section, is used providing means to compare the HRV behavior in rest and 90 o tilt positions easily. Figure 3.10: Orthostatic test results display. 3.1.5.C RF Biofeedback Training The RF Biofeedback Training UI is designed in order to implement, as well as possible, the procedure proposed by Lehrer [11, 30, 35] and discussed in the end of Chapter 2.4. Since the resonant frequency is known to be around 0.1Hz and the process of finding the specific resonant frequency of a subject may be lengthy, when starting this functionality of the application, a dialog asks the user if he wants to skip the searching process and start training breathing at 0.1 Hz (Figure 3.11-A). Breathing can be easily synchronized with the requested frequency with the assistance of an oscillating blue bar, that represents the course of the breathing process (see Figure 3.11-B). Alongside, two more bar plots can be found. The middle plot (in green) has information about the HRV spectra. The goal is to maximize both green-filled bars, maximizing the HRV total spectral power, and optimizing the sinusoidal shape of the R-R interval series. The right plot shows the largest and the last R-R interval oscillations achieved in that session, respectively. Choosing to find the resonant frequency, the system then records the HRV total spectrum power at the different breathing rates and starts a training session at the frequency which produced the highest value. 36

3.1 System Architecture Figure 3.11: Resonant Frequency Training biofeedback interface: (A) first dialog, (B) during training session. 37

3. System Framework 38

4 Application Testing and Outputs 39

4. Application Testing and Outputs Although the HRV analysis alone is not the main focus of this application, in order to grant that it properly fulfills its purposes, namely display the correct information for biofeedback features, HRV spectral analysis made with the system, as it is built, has to lead to results physiologically coherent, thus consistent with studies in bibliography. A study made by Pagani et al.[3] may serve as a simple test to the system reliability. In this study, the HRV of several experimental subject is analyzed in the frequency domain during two different circumstances: rest and 90 o head up tilt. This study shows that the HRV spectra has a distinct and very characteristic behavior in each of the two circumstances (see figure 4.1). At rest, the presence of two major spectral components is very clear, the LF and HF components. The LF component is slightly predominant with a LF/HF ratio around 3.6 (Table 4.1). During tilt the results show a great change, revealing a largely predominant LF component with an HF component barely present. Consequently the LF/HF ratio increases to a value around 21. Figure 4.1: R to R interval series (top panel): tachogram at rest and during 90 o head up tilt. AR spectra of the above time series (bottom panel), (From [3]). Lombardi et al.[4] found very similar results in a study made ten years later. Graphical representation of their results can be found in Figure 4.2. Figure 4.3 shows the display of the system during rest and 90 o head up tilt. Results are in agreement with those found by Pagani and Lombardi. Notice that not only the heart rate is higher when standing up, but also that the posture measurement is changed. Posture is measured by 40

Table 4.1: Reproducibility of the Effects of Tilt on HRV (adapted from [3]). R-R R-R LF LF HF HF interval interval Normalized frequency Normalized frequency (ms) (ms 2 ) power peak (Hz) power peak (Hz) Rest 1 st study (n=10) 885 ± 43 3246 ± 464 62.0 ± 5.0 0.11 ± 0.01 28.5 ± 3.3 0.26 ± 0.02 2 nd study (n=10) 858 ± 32 3508 ± 766 61.4 ± 4.6 0.10 ± 0.01 29.0 ± 3.7 0.25 ± 0.02 3 rd study (n=4) 914 ± 34 4201 ± 781 56.1 ± 2.6 0.12 ± 0.01 31.3 ± 3.8 0.31 ± 0.03 Tilt 1 st study (n=10) 672 ± 24 2612 ± 528 89.5 ± 1.4 0.09 ± 0.01 6.0 ± 0.5 0.30 ± 0.04 2 nd study (n=10) 676 ± 33 1955 ± 303 89.2 ± 2.2 0.10 ± 0.01 6.9 ± 0.07 0.26 ± 0.03 3 rd study (n=4) 700 ± 25 3381 ± 250 87.0 ± 2.0 0.10 ± 0.01 7.7 ± 1.3 0.27 ± 0.02 Average delay in time between the first and the second study: 138 days. Average delay in time between the second and third study: 127 days. *Value during tilt significantly different from value at rest (p < 0.05) Figure 4.2: R to R interval series (top panel): tachogram at rest and during 90 o head up tilt. AR spectra of the above time series (middle panel). Pie charts (top panel) show the relative distribution together with the absolute power of the two components represented by the area (From [4]). 41

4. Application Testing and Outputs the angle of the belt module. In head up tilt it is indeed measured 91 o, yet, when in rest 118 o are registered instead of 180 o. This happens because, even though lying down, in resting position, the module might be slightly tilted due to the chest anatomy of the subject. Similar results were found through the orthostatic test, as shown in Figure 4.4. Figure 4.3: Display during (A) rest and (B) 90 o head up tilt. Regarding the biofeedback features, as explained in the beginning of the last chapter, the Real Time HRV Analysis tool not only serves as an immediate display of the system potentialities but can also be used for biofeedback purposes. HRV training strategies similar to heart rhythm coherence can be easily reproduced, since the real time R-R interval is displayed. Figure 4.5 shows the display during a procedure where the subject was told to try and produce the highest oscillations in his heart rate by controlling the respiration rate. Moreover, in the RF Biofeedback Training functionality, results clearly show that the HRV to- 42

Figure 4.4: Orthostatic test results. Figure 4.5: HRV oscillation 43

4. Application Testing and Outputs tal spectrum power increases at breathing frequencies near 0.1Hz, as expected. Figure 4.6-A illustrates the application status when the subject starts the biofeedback training and is not yet breathing at the blue bar s pace, in opposition to the results after a brief period of training (Figure 4.6-B). It can also be seen, from the second green bar, that the shape of the R-R interval series approximates a sinusoidal wave, and that the oscillations are higher than in the beginning of the session. However, although this results meet the expectations regarding the bibliography they were produced after only two training sessions. It is possible that more expressive results can be found after a higher number of longer sessions. Figure 4.6: Display during RFT biofeedback session: (A) in the very beginning, (B) after a while breathing at the resonant frequency. 44