0% found this document useful (0 votes)
38 views

Real-Time ECG For Objective Stress Level Measurement: David Andersson

This master's thesis examines stress measurement using electrocardiogram (ECG) signals. The document contains two studies. The first compares four ECG-based stress measures - RMSSD, heart rate, and two frequency domain measures - to determine which best identifies changes in stress levels during relaxation periods. The second study compares two respiratory components in ECG signals - beat-to-beat heart rate and R-peak amplitude - to determine which is best suited for biofeedback applications to lower stress through breathing exercises. The thesis aims to help Linkura identify and decrease stress in people's daily lives using their wearable ECG device.

Uploaded by

Esteban
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Real-Time ECG For Objective Stress Level Measurement: David Andersson

This master's thesis examines stress measurement using electrocardiogram (ECG) signals. The document contains two studies. The first compares four ECG-based stress measures - RMSSD, heart rate, and two frequency domain measures - to determine which best identifies changes in stress levels during relaxation periods. The second study compares two respiratory components in ECG signals - beat-to-beat heart rate and R-peak amplitude - to determine which is best suited for biofeedback applications to lower stress through breathing exercises. The thesis aims to help Linkura identify and decrease stress in people's daily lives using their wearable ECG device.

Uploaded by

Esteban
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

Linköping University | Department of Biomedical Engineering

Master thesis, 30 ECTS | Medicinsk Teknik


2017 | LIU-IMT-TFK-A--17/546 --SE

Real-time ECG for


objective stress level
measurement

David Andersson

Supervisors : Anders Johansson, Marcus Larsson


Examiner : Göran Salerud

Linköpings universitet
SE-581 83 Linköping
+46 13 28 10 00 , ww.liu.se
Abstract
Today’s endeavor of performance and accomplishment might bring more effi-
ciency in many ways, but it has a price. Stress related diseases have increased
in numbers the last decades and the field of stress is an exceptionally live issue.
Linkura is a company which partly works towards identifying and decreasing
stress. To be able to monitor and detect stress in people’s daily life, an ECG-
device is used.
This thesis is divided into two parts. The first part consisted of analyzing
and comparing four different ECG based stress measures. These stress measures
were RMSSD, Heart Rate, high frequency (HF) band and ratio between low and
high frequency bands (LF/HF), last two based in frequency domain. These were
taken from healthy test subjects for periods of relaxation where the stress level
presumably would decrease. What could be seen for all measures was that
they all showed a statistical significant decrease in stress level (p<0.05) during
the relaxation period. LF/HF ratio was the one performing best and showed
clearest decrease in stress.
Biofeedback is a growing treatment, or rather, health monitoring, which pur-
pose is to gain awareness of physiological functions to manipulate them at will.
The second part of the thesis compared two ECG-related respiratory compo-
nents, to find out which one would be most suited for biofeedback purpose to
lower stress in the form of breathing exercises. The two respiratory components
investigated were beat to beat heart rate and R-peak amplitude. For this part,
a real-time application in the form of a mobile application was created and
connected to the ECG-device. This enabled real-time measurement, which was
crucial for the second part. Different time and frequency based algorithms were
made to compare the two respiratory components. What could be seen was
that the beat to beat heart rate signal was the respiratory component following
breathing pattern the most.

2
Acknowledgements
This thesis work was performed at Linkura AB in collaboration with Depart-
ment of Biomedical Engineering at Linköping University.

Special thanks go to:


Supervisor : Anders Johansson, Marcus Larsson
Examiner : Göran Salerud

I would also like to thank Linkura for the opportunity to write this interest-
ing thesis. In addition, many thanks goes to the volunteers who attended my
studies.

3
Contents
1 Introduction 6
1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2 Aim and research questions . . . . . . . . . . . . . . . . . . . . . 7
1.3 Hypotheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Theory 9
2.1 Stress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 The Heart physiology . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Heart signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.1 Cardiac conduction system . . . . . . . . . . . . . . . . . 12
2.3.2 Electrocardiogram (ECG) . . . . . . . . . . . . . . . . . . 13
2.4 ECG and stress . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4.1 Frequency domain measures . . . . . . . . . . . . . . . . . 18
2.4.2 Time domain measures . . . . . . . . . . . . . . . . . . . 19
2.5 HRV applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.5.1 Medicine importance of heart rate variability . . . . . . . 20
2.5.2 Biofeedback . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.6 Respiratory effects on ECG components . . . . . . . . . . . . . . 22
2.6.1 RSA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6.2 R peak-to-peak value . . . . . . . . . . . . . . . . . . . . . 24
2.7 Linkura’s ECG device . . . . . . . . . . . . . . . . . . . . . . . . 25

3 First study 27
3.1 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4 Second study 39
4.1 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.1.1 The app . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.1.2 Test group . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.1.3 Measurements . . . . . . . . . . . . . . . . . . . . . . . . 39
4.1.4 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5 Conclusion 55

6 References 56

7 Appendix 1 - The app 59

4
List of abbreviations
ANS Autonomic Nervous System
AV Atrioventricular
ECG Electrocardiogram
EEG Electroencephalography
EMG Electromyography
GAS General Adaptation Syndrome
HF High Frequency component of HRV
HR Heart Rate
HRV Heart Rate Variability
LF Low Frequency component of HRV
PNS Parasympathetic Nervous System
RAS Renin-Angiotensin System
RMSSD Root Mean Square of Successive Differences (of NN intervals)
RSA Respiratory Sinus Arrhythmia
SA Sinoatrial
SDANN Standard Deviation of the averages of NN intervals
SDNN Standard Deviation of NN intervals
SNS Sympathetic Nervous System
VLF Very Low Frequency component of HRV

5
1 Introduction
1.1 Background
With a society filled with competition, perfection, and performance, it is easy
to get stuck in periods of stress. Stress is a defensive behaviour from the body
when danger, real or imaginary, is present. It turns on an automatic process
known as the ”fight-or-flight” reaction. Unfortunately, stress damages the body
in ways which usually are underestimated. It can have effects in many ways
such as emotional, cognitive, physical and behavioural.
Stress can be divided into mental and physical. Physical stress is usually a
positive effect from physical exercise, while mental stress being the one affecting
the body in a negative way. Depending on the duration, mental stress can also
be classified as temporary or chronic. Chronic stress can eventually lead to a
large quantity of health problems such as depression, fatigue syndrome, and
heart disease. [1]
In order to cope with this stress, the body needs recovery. Recovery is a
period of time when the body can recover from stressful moments and restore
the systems to prevent any stress-related diseases. Lack of periods with recovery
and physical exercise in today’s stressful society is one of the reasons why stress
is one of the most common health problems.
This increasing problem with stress is something that Linkura wants to ad-
dress by identifying people in the ”danger zone” in regards to the balance be-
tween stress and recovery, and coaching them into a healthier lifestyle. In order
to do this, Linkura has developed their own wearable ECG device, which from
parameters extracted from the ECG-signals measures stress-levels. The ECG
device is used on all individuals in groups, to objectively find those at risk.
Potential candidates are then selected for 4-6 month health coaching.
During the coaching period, the ECG device is used to follow the progress
for a restored balance. Currently, individuals use the ECG device one day every
week throughout the coaching period. As a future implementation, it is also
desired by Linkura to use the ECG device for shorter exercises in real time for
coaching purposes. Such exercises may include mindfulness, yoga, breathing
exercises or relaxation.
Currently, there are plenty of more or less scientifically proven exercises and
techniques to help people relax and recover the body. However, there is a lack of
studies whether these methods have any actual physiological effects. To measure
ECG in real time during such exercises is a good and objective way to investigate
their physiological effect. In this thesis, different stress measures derived from
the ECG will be investigated during breathing and relaxation exercises.
A majority of the exercises which are proposed for relaxation includes regu-
lar deep breathing in order to trigger the parasympathetic system, the body’s
recovery mode. This thesis will also consist of investigation of different respira-
tory components in the ECG-signals, gathered from real-time measurements.

6
1.2 Aim and research questions
There are two aims of this thesis. The first part will consist of evaluating
different ECG-based stress measures during recovery. These measures will be
taken during recovery exercises in a group of test subjects. The aim is to find the
measure which correlates best with the stress-level. This measure of stress-level
will then be implemented in the second part of the thesis.
In the second part of the thesis, two essential respiratory components in the
ECG-signal will be investigated. The purpose is to eventually be able to use
one of these as a real-time feedback during recovery exercise. One measure is
based on beat to beat heart rate, which primarily is controlled by the nervous
system. The other measure is based on the amplitude of the R-peaks, which
is more ”mechanically” controlled in its nature. The two measures will be
investigated with the help of real-time measurements on a group of test subjects.
Currently, Linkura’s hardware supports real-time measurement but there is no
software to perform such functionality. Therefore, a mobile application will be
developed as part of the thesis work, that reads the information sent from the
ECG-device and illustrates the measurements on a mobile device. To have the
opportunity to monitor a persons stress-level in real-time would be of great
value for Linkura, especially during coaching. This allows the health coaches to
easier see improvements and results.
The bullet lists below summarize the aims of this thesis.

• Evaluate various known ECG-based stress measures, using Linkuras ECG


device

• Build a mobile app which, in real time, shows the most stable measure
• Purpose: Provide Linkura with the opportunity to objectively measure
stress during coaching.

• Also add functionality in the app to view respiratory impacts on the heart
in real time, as support during recovery exercises
• As a part of this, investigate two different ways of measuring respiration
from ECG.
• Purpose: Create a good exercise which Linkuras coach clients can use to
reduce their stress, in real time.

7
1.3 Hypotheses
The first hypothesis is that a stress measure based on frequency analysis of the
time intervals between heartbeats is more strongly linked to increased parasym-
pathetic activity (decrease in stress) during longer recovery exercises, as com-
pared to time domain calculations based on shorter time windows.
The second hypothesis is that the respiratory variation in beat to beat heart
rate is stronger and more stable than the respiratory variation in the R-peak
amplitude, for real-time measurements during shorter breathing exercise with
the purpose of triggering the parasympathetic system.

1.4 Limitations
The measurements in this study were done on a group of test subjects, narrowed
down with some criteria to exclude potential sources of error. The test group
consisted of healthy men in the age between 20 and 50.
For the measurements, a one-lead ECG device with two electrodes was used,
as compared to the more typical approach at hospitals with clinical 12 lead sys-
tems. Due to the signals read from the heart are the time intervals between every
beat and the strength differences between beats, the limitation of 2 electrodes
should not have any major affects on the results.
In addition, the duration of the measurements is limited to a maximum of 30
minutes. This time period should be enough to identify changes in stress levels,
however, different results might have been achieved for a longer duration.
Lastly, stress related features which were taken into account were solely
physiological ones, mental related features such as depression were not treated
in this thesis.

8
2 Theory
In this chapter, necessary theory related to stress will be gathered from various
literature. A physiological explanation about the term ’stress’ will be given
with the focus on how stress can be measured from an ECG signal. Together
with this, there will also be some focus around signal processing and limitations
which may be present.

2.1 Stress
Stress is a highly subjective phenomenon which actually defies definition. It was
firstly introduced by Hans Selye 1936 who defined it as ”the non-specific response
of the body to any demand for change”. What Selye was not aware of was that
the definition stress had been used already for centuries in physics to describe
elasticity; a materials ability to retain its original size or shape while being
stretched or compressed by an external force. Proportional to stress is strain,
which describes the change in size or shape of an object due to externally-applied
forces. This created much confusion when his research were to be translated into
foreign languages, since he was actually describing strain [1],[3].
Since stress is a wide and highly subjective area, it can be divided into
different types. Most commonly, it is divided into eustress and distress. Eustress
is a preparation state which prepare the body for an upcoming challenge and
therefore is referred to as the positive kind of stress. Distress on the other hand
is a more long-lasting stress which is harmful [2]. To be able to monitor this
harmful stress would be desired, and is partly the foundation of this thesis.
To counterattack stress, the body uses mechanisms to remain in homeostasis.
Homeostasis is a state where the body’s internal environment is in balance. This
is achieved by regulatory processes which are constantly interacting with each
other. The regulatory processes mainly consist of maintaining the volume and
composition of various body fluids. To adapt to new conditions, the body’s
equilibrium can shift slightly between points in a narrow band which is still
compatible with maintaining life. As an example, the glucose level in blood
usually varies between 70 and 110 milligrams of glucose per 100 milliliters of
blood. These small changes in the body can be used as parameters to identify
stress, which will be done in the first study.
The body responds to stress by sending out specific stimuli to the body.
The causes of these responses are called stressors. Stressors include different
disturbances to the body such as; extreme temperatures, heavy bleeding, envi-
ronmental poisons, or strong emotional reactions. These stimuli creates some-
thing called a stress response or general adaptation syndrome (GAS), and are
controlled mainly by the hypothalamus. The stress response begins with a so
called fight-or-flight response. This response is triggered by adrenaline which
is produced by adrenal glands after receiving a message from the brain. In
this step, an initial response to a perceived threat is made by impulses sent
from the hypothalamus to the autonomic nervous system (ANS). The ANS is a
nervous system in the body which works unconsciously and regulates functions

9
such as heart rate, respiratory rate, and digestion. During this first step, organs
which are more active while confronting the incoming danger are in need of an
increased amount of oxygen. Therefore, the cardiac activity needs to be in-
creased. This results in an increase of heart rate, which is one of the parameters
which will be analyzed further in combination with varying stress levels in the
first study [2].
In addition, organs which are not as active during the threat are inhibited,
and a lesser blood flow will be present to them. The kidneys are usually included
to these organs, and a reduction of blood flow promotes release of renin, which
starts the renin-angiotensin system (RAS). RAS is a hormone system which
regulates the plasma sodium concentration and arterial blood pressure. By
retaining the sodium in the kidneys, water is conserved, which also helps the
body against severe bleeding due to body fluid being preserved.
Following the fight-or-flight response is a more long-lasting resistance re-
action. During this phase, nerve impulses from the hypothalamus initiate the
release of hormones. A big part of these hormones stimulates the adrenal glands
to secrete cortisol to combat stress. The cortisol breaks down triglycerids into
fatty acids, creates glucose by gluconeogenesis and stimulates catabolism of pro-
tein into amino acids. These three components are used by tissues all around
the body to produce ATP or to repair damaged cells. Typical symptoms for
this stage include increased blood pressure, increased heart rate, conservation
of water, and cravings for energy (carbohydrate).
The release of cortisol is a good short term solution to stress. However, when
the solution becomes long term, it can result in severe damage to the body.
After being activated for too long, the adrenal glands secreting the cortisol get
fatigued. When this happens, other organs of the body are used as resource,
which ultimately results in depletion of the body.
In short, the body reacts to stressors by sending out adrenaline and cortisol
into the blood, as well as increasing the sympathetic activities in ANS. The
heart is one of the organs which is heavily influenced by this, which we later on
in this thesis will show how it can be seen in an ECG signal. Easily explained,
stress-related disease is when these two reactions to stressors are active and
burden the body during a longer period without sufficient recovery.

2.2 The Heart physiology


The heart surge for the transportation of blood throughout the body. There are
three main purposes of the circulatory system. The first and most obvious one
is the distribution of oxygen, which is taken from the lungs and transported out
to all the organs and cells. In return, carbon dioxide is sent back to the lungs
for exhalation. In the same way, nutrients and hormones are also transported
in the blood to areas where they are needed.
The second purpose is defense towards diseases and wounds of the circula-
tion. Inside the blood vessels are numerous of white blood cells that protect the
body from attacks. The white blood cells travel through the blood vessels and
leave the vessels to go to the area where they are needed.

10
The last main purpose is to regulate the heat in the body. The liver con-
tributes to the heat production, which then is transported in the circulatory
system to the vital organs. This is an extremely important purpose since the
organs are only functioning properly within a specific temperature range.
The heart is located between the lungs in the middle of the chest, slightly
more to the left. Surrounding the heart is the pericardium. It encloses the
heart’s shape, while still allowing sufficient freedom for contraction and relax-
ation.
Figure 1 below shows the different parts of the heart. The heart consists
of four chambers; left and right atrium, and left and right ventricle. When
the blood first enters the heart, it goes through the superior or inferior vena
cava and enters the right atrium. From there, the blood first enters the right
ventricle before it enters the pulmonary artery. This is the vessel taking the
blood to the lungs for the oxygen-carbon dioxide exchange. When the blood is
oxygenated, it enters the heart once again through the pulmonary veins. Here,
the blood travels through the left- atrium and ventricle before it enters the aorta
to distribute the oxygen to all the organs and cells around the body.
Between the atrium and the ventricle there are atrioventricular valves named
mitral and tricuspid valves. These valves control the flow between the different
chambers. In addition, there are semilunar valves for blood flow to the aorta
and pulmonary trunk. These valves are called the aortic valve and pulmonary
valve.
In order for the blood to flow, a pressure needs to be created. This pressure
is created by filling up the atria and ventricles, respectively, with closed output
valves. To empty the heart on blood, the muscles in the heart contract. This
contraction is created by action potentials in the cells of the heart, originally
created in the sinoatrial node (SA-node). These action potentials interact in
an intricate way in the electrical conduction system of the heart, which we will
take a closer look at in the next section. Unlike action potentials in skeletal
muscle cells, the action potentials in the heart are created automatically [2].

11
Figure 1: Figure showing the heart physiology [21].

2.3 Heart signals


The test studies in this thesis will both consist of ECG measurements and
further analyzing of ECG parameters. With more knowledge about the heart
physiology, it is now time to look into heart signals, or rather, the cardiac
conduction system, and how these signals can be monitored in ECG.

2.3.1 Cardiac conduction system


Cardiac excitation is automatic and normally begins in the SA-node, which is lo-
cated in the right atrial wall, close to the superior vena cava. The cells located in
the SA-node do not have a stable resting potential, instead, they spontaneously
depolarize (voltage becoming more positive) to a threshold. This spontaneous
depolarization is called a pacemaker potential. When the depolarization reaches
the threshold, an action potential is triggered.
The action potential can be seen as an electrical signal propagating through
the heart. The electrical signal from the SA-node stimulates the atria to con-
tract. The signal then travels from the atria to the ventricles through the
atrioventricular node (AV-node). In the AV-node, the conduction of the signal
is slowed down. This allows the ventricles to fully fill with blood before contrac-
tion. The signal then passes down through the antrioventricular bundle, located
between the ventricles, to continue through the right and left bundle branches.
Finally, the signal reaches the Purkinje fibers, which are located at the apex
(bottom) of the heart, and travels upward through the remainder of the ven-

12
tricular myocardium. This signal propagation around the ventricle makes the
ventricles contract, which will push the blood upward toward the semilunar
(aortic and pulmonary) valves.

2.3.2 Electrocardiogram (ECG)


Electrical currents are generated from the propagating action potentials. These
electrical signals can be detected and measured at the surface of the body. A
recording of these signals is called an electrocardiogram (ECG). The instrument
used to record these signals is an electrocardiograph. ECG readings will be used
for both test studies, which will be seen later on in this thesis.
The foundation of ECG is to measure the potential difference between two
points on the skin surface. The electrical field created from the action poten-
tials are 3 dimensional, hence, the ECG signal will have different appearance
depending on which two points the potential is measured between. The most
standard ECG is the 12 lead. Here, 6 electrodes are placed at various positions
around the heart and 4 electrodes are placed on the limbs, as illustrated in
figure 2 below.

Figure 2: Figure showing the placement of electrodes for the standard 12 lead ECG
measurement [25].

The 12 lead ECG provides spatial information of electrical activities from the
heart in three approximately orthogonal directions. This enables the monitoring
of many specific parts of the heart, in comparison to the one lead ECG which
measures the potential difference between two central horizontal points on the
chest. However, the one lead ECG gives all necessary information needed for
this thesis. Figure 3 below is a typical look of a one lead ECG signal. As will
be seen later in this thesis, it is this kind of signal which Linkura works with.
For every heartbeat, there are three recognizable waves appearing. The first
one is the P wave which represents the depolarization of the atria where the ac-

13
tion potential spreads from the SA node through fibers in both atria. Following
the P wave is the QRS complex, which is the result from the ventricular depolar-
ization and atrial repolarization. Here, the action potential spreads through the
fibers around the ventricles. Repolarization is the opposite to a depolarization,
when the membrane potential returns to a negative value after a depolarization
phase of an action potential. The last noticeable wave is the T wave which
indicates the ventricular repolarization.
In addition to the three different waves, it is also common to analyze different
time segments in the ECG. As for the waves, there are three main intervals which
often are analyzed. The first one being the P-Q interval. This corresponds to
the time between the beginning of the P wave and the beginning of the QRS
complex, and represents the conduction time for the action potential to travel
through the atria, AV node, and the fibers remaining in the conduction system.
The second interval of interest is the S-T segment. This segment contains the
time between the end of the QRS complex and the beginning of the T wave and
represents the time when both ventricles are completely depolarized. Lastly, the
Q-T interval could also be of interest to analyze. This interval ranges between
the start of the QRS complex and the end of the T wave, and represents the time
for both ventricular depolarization and repolarization to occur. In other terms,
it roughly represents the duration of an average ventricular action potential [2].

Figure 3: Figure showing the different sequences of a normal and typical ECG signal
[22].

14
In this thesis, the two main parameters which will be investigated in the
ECG recordings are R-R interval and R-peak amplitude. The R-R interval
corresponds to the time between R-peaks, while the R-peak amplitude refers
to the magnitude between R-peaks. A typical ECG signal showing the R-R
interval and the R-peak amplitude can be seen in figure 4 below.

Figure 4: Figure showing a part of a typical ECG recording, illustrating the R-R
interval and R-peak amplitude [26].

2.4 ECG and stress


This far, knowledge regarding stress, and the hearts physiology and signals have
been gathered. It is now time to combine this knowledge and link stress together
with the heart. This is needed to understand how stress can be identified by
examining ECG signals.
The SA-node is responsible for the rhythm of the contractions of the heart.
The timing and strength of each heartbeat can then be modified by blood-
borne hormones and ANS. Therefore, by looking at recordings of the timing
and strength of each heartbeat, it is possible to monitor the ANS. According
to Sansanee Boonnithi and Sukanya Phongsuphap [4], the most widely used
method for monitoring the variation of the timing for every heartbeat is by
looking at the Heart Rate Variability (HRV). Heart Rate Variability is defined as
the variation between consecutive heartbeats. The ANS can be categorized into
the sympathetic nervous system (SNS) and the parasympathetic nervous system
(PNS), and is responsible for adjusting the heart rhythm (HRV) in response to
external or internal physical or emotional stimuli [5].
As described in [6], the SNS can be seen as a accelerator pedal in a car. It
triggers the stress response, which provides the body with energy as a response

15
to what the body comprehends as danger. The PNS works opposite to the
SNS and can be seen as the brake. It calms the body down after danger has
passed and promotes the ”rest and digest” state. Both nervous systems are
connected to the same effector, but have the opposite functions. Effector refers
to the parts or mechanisms of the body which are affected, for example heart
rate, respiration, skeletal muscles, size of pupils etc. As an example, the PNS
releases acetylcholine, which slows down the depolarization rate of the SA-node,
resulting in a lowering of heart rate. While, on the other hand, the SNS releases
norepinephrine, which speeds up the depolarization and, thus, increases the
heart rate. Figure 5 below gives an overview of SNS and PNS, and how they
work opposite to one another.

Figure 5: Figure showing the different functionalities of SNS and PNS [24].

According to Gary G. Berntson, J. Thomas Bigger, Jr., Dwain L. Eck-


berg, Paul Grossman, Peter G. Kaufmann, Marek Malik, Haikady N. Nagaraja,
Stephen W. Porges, J. Philip Saul, Peter H. Stone, Maurits W. van der Molen
[8]; Kline, Kronhaus, Moore, and Spear [32] did a research on heart period
responses to brief bursts of sympathetic and parasympathetic activities. The

16
results showed that parasympathetic activities had its maximum effect after
around 0.5 seconds, and returning to baseline within 1 second. In comparison
to this, a sympathetic activity had its maximum decrease in R-R interval after
approximately 4 seconds, and returning to baseline within 20 seconds. Accord-
ing to these measures, a rough estimation of the upper bounds of sympathetic
and parasympathetic activities can be calculated. In the following calculations,
the heart rate is assumed to be a linear combination of single pulses and have
a sinusoidal behaviour. The upper bounds are estimated to the following:
1
fP N S,max = = 0.5Hz (1)
4 ∗ 0.5s
1
fSN S,max = = 0.0625Hz (2)
4 ∗ 4s

During relaxation periods, there is a balance between sympathetic and parasym-


pathetic activities in order for the system to be prepared for any input. Where,
according to Lehrer, Paul M.; Gevirtz, Richard [7], parasympathetic activities
usually are a component in the ”relaxation response”. This altering between
the two systems results in a higher time variation between the heartbeats, which
means a higher heart rate variability (HRV).
When stress occurs, the SNS is activated through signals sent from the ANS
to the adrenal glands. The adrenal glands respond by sending out the hormone
epinephrine. The release of epinephrine results in an increase in heart rate and
blood pressure. In addition, the SNS keeps the body in a more prepared and
focused state with a more monotonic regulation of the heart, which leads to
a lower HRV. Hence, by monitoring the HRV, the balance in sympathetic and
parasympathetic activities can be described, and as desired in this thesis, stress
might be able to be identified [6].
Heart Rate Variability can be measured in both the frequency domain and
the time domain. Measures in frequency domain normally consist of looking at
different frequency bands of the R-R intervals. These frequency bands are; low-
frequency band (LF), high-frequency band (HF), and the ratio between LF/HF.
These bands will be explained further in the next section.
Time domain measures usually include root mean square of successive dif-
ferences (RMSSD), proportion of NN intervals that differ by more than 50 ms
(pNN50), standard deviation of NN intervals (SDNN) and standard deviation of
the averages of NN intervals (SDANN), all based on the time interval between
R-peaks in the ECG (R-R interval). NN interval simply means R-R intervals
from a period with normal heartbeats without disturbance. These time domain
measures will be further described later on in the thesis.
Furthermore, a more simple way of measuring stress might be to monitor
the heart rate (HR). During stressful periods, the body gets into a preparation-
mode, as mentioned earlier. This usually results in an increase in HR. Respon-
sible for the increase in HR is the SNS, which during stress gets more active. In
this study, both HR and HRV will be investigated.

17
2.4.1 Frequency domain measures
The frequency domain of the R-R intervals can be classified into different fre-
quency bands. The highest frequency band ranges from 0.15 Hz to 0.4 Hz, and
is called the high frequency (HF) band. This band includes the highest frequen-
cies of the R-R interval, although, the upper limit may go up to about 1 Hz for
infants, and also adults during exercise. The HF band is closely related to respi-
ration. Respiration creates fluctuations in R-R intervals, something which will
be described more in depth later on in the thesis. Since breathing frequencies
normally range in the HF band, these fluctuations coincide in this band.
According to [8], HF is generally believed to provide an index of vagal activ-
ity, which is the degree of activity within the PNS. In addition, from equation 1
and 2, it is also shown that the HF band is dominated by parasympathetic
activities, due to sympathetic activities having an estimated frequency upper
bound under the HF band.
Frequencies in the range between 0.05 Hz and 0.15 Hz are said to be in the low
frequency (LF) band. Activities within the LF band are considered to mainly
reflect sympathetic activities. Although, most investigators claim that the LF
band represents activities from both the sympathetic and the parasympathetic
system [8]. The lowest frequency band is in the range from 0.003 Hz to 0.05 Hz,
and is referred to as the very low frequencies (VLF). Activities in this frequency
band have not been studied as much as the other higher bands. The band
reflects many determinants and has important clinical applications, however,
due to unclear mechanisms and origins, VLF will not be further analyzed in
this report.
A commonly used measure for monitoring sympathetic activities is the ratio
between LF and HF.

LF = Sympathetic ∗ P arasympathetic (3)

HF = P arasympathetic (4)

LF Sympathetic ∗ P arasympathetic
= = Sympathetic (5)
HF P arasympathetic
As are shown in the equations above, the ratio between LF and HF is used
to identify sympathetic activities. This ratio together with the HF band are the
two frequency domain measures which will be analyzed in this thesis, since they
are suggested to monitor SNS and PNS, respectively.
Figure 6 below shows two typical R-R interval signals taken at two different
occasions. The one to the left taken during rest and the second one taken after
90◦ head-up tilt, which means an upright sitting position. The second figure
shows the distributions among the frequency bands for these two recordings.

18
Figure 6: Figure showing two typical R-R interval recordings. The left one (a) taken
during rest and the right one (b) taken after 90◦ head-up tilt [26].

Figure 7: Figure showing the frequency domain of the two R-R interval recordings
above and how the signal is distributed among the different frequency bands. The left
one (c) taken during rest and the right one (d) taken after 90◦ head-up tilt [26].

As can be seen in the graphs, during resting, there’s a greater area in the
high frequency band. While for a more stressful state, the area decreases in the
high frequency band and increases in the low frequency band.

2.4.2 Time domain measures


The different measures done in the time domain are based on the R-R inter-
vals. The most straight forward time domain measure is the SDNN, which is
the standard deviation of all normal R-R intervals. SDNN is measured in mil-
liseconds, and usually, over 24 hours. There are two variants of SDNN where
the 24 hour recording is divided into periods of 5 minute segments. The first
one, SDNN index, is calculated by taking the mean of all the 5 minute standard
deviations of the normal R-R intervals. The second variant, SDANN index,

19
is instead calculating the standard deviation of all the 5 minute R-R interval
means [26].
Compared to SDNN and SDANN, the two following methods, RMSSD and
pNN50, make it possible to show short term results of the HRV. RMSSD stands
for the root-mean-square of successive differences. This method calculates the
square root of the mean of the squared differences between successive R-R in-
tervals [9]. RMSSD will be used as one of the potential stress measures in the
first study.
The last time domain measure mentioned in this section will be the pNN50.
pNN50 calculates the proportion of pairs of R-R intervals which differ more
than 50 ms divided by the total amount of R-R interval pairs. Compared to the
three earlier measures in units of ms, pNN50 is calculated in percentage.
All these measures are based upon HRV. Hence, a high value of these mea-
sures corresponds to a high HRV. Since a low value of HRV indicates a prepared
”stressful” period, a high value of these time domain measures would indicate
relaxation and less stress.
In contrast to the previously mentioned time domain measures which are
based on heart rate variability, plain beat to beat heart rate is another measure
which supposedly is related to stress. Here, the R-R interval itself is in focus,
in comparison to the other measures which are based on the variability of the
R-R interval. When sympathetic activities are increased during stress, the body
prepares itself for eventual dangers partly by increasing heart rate. The beat to
beat heart rate is simply calculated by taking 60 divided by the time interval
between two heartbeats in seconds, to get the unit beats per minute. Together
with RMSSD, the heart rate will be the second time domain stress measure
which will be analyzed further in the first study.

2.5 HRV applications


HRV is a way of monitoring the body’s regulatory systems and their efficiency
and health. Hence, HRV may have many useful applications which can be
applied in the sake of health monitoring or treatment.

2.5.1 Medicine importance of heart rate variability


Monitoring of heart rate variability has been more commonly used the last
decades, mainly for being a non-invasive method that solely depends on an
adequate ECG recording [17]. Especially, HRV can identify imbalance in the
autonomic nervous system, which in many cases might be caused by some un-
derlying medical condition. One of many disorders which can be detected and
analyzed through HRV is panic anxiety. Panic anxiety symptoms includes pal-
pitations, tachycardia, chest pains, shortness of breath, shaking, and sweating
[16]. All together, these features suggest disturbances in the ANS. Monitoring of
HRV has also provided interesting insights for the psychophysiology of emotion
and attention.

20
Furthermore, according to [17][18], studies have showed that HRV is af-
fected by myocardial infarction (heart attack). Cardiovascular disease is one
of the most common causes of death world-wide with 17 million deaths every
year. Myocardial infarction accounts for 7 million of those deaths [18]. Higher
sympathetic activity after an infarction is a sign of poor progress and increased
mortality. Hence, HRV works as a prognostic tool for detection of high sym-
pathetic activities which interfere with cardiovascular parameters such as heart
rate.
Showed in studies [19][20], depression is another medical condition which
can be rapidly and objectively screened using HRV. In addition, its severeness
can be evaluated.

2.5.2 Biofeedback
The purpose of the second study is to compare two different respiration param-
eters to find the best suitable one for biofeedback usage. For better understand-
ing, this section will give an explanation about biofeedback.
Biofeedback is a technique where body processes which once were thought
to be involuntary are voluntarily controlled by patients. Examples of body
processes which can be regulated are heart rate, blood pressure, muscle tension,
and skin temperature. One of the purposes of this technique is to train people
to improve their health. With the uprising of wearables, smartphones, AI, etc.,
biofeedback will likely be a very popular future area, not just something used by
researchers and therapists. This would allow more easy accessibility the method
which previously only been used in labs or at clinics.
By connecting the patient to electrical sensors, information (feedback) about
these processes can be measured and displayed on a monitor. Observing this
monitor makes it possible for the patient to develop control over their own body.
This technique is performed with the supervision and support of a biofeedback
therapist who guides the patient through the exercise. The most commonly
used biofeedback includes:

• Electromyography (EMG), measurement of muscle tension

• Thermal biofeedback, measurement of body temperature


• Electrocardiography (ECG), measurement of electrical activity of the heart

• Electroencephalography (EEG), measurement of electrical activity in the


brain

Biofeedback can be used to improve many different health related problems.


EMG can be used against chronic pain, tension headache, temporomandibular
joint dysfunction, and spasmodic torticollis. Using EEG, ADHD and epilepsy
patients can be helped to a certain degree.

21
Another purpose of biofeedback therapy is to lower sympathetic activity
which usually is related to stress. Examples of variables influenced by sympa-
thetic activities are heart rate, heart rate variability, respiration rate, skin sur-
face temperature, and skin conductance. These variables are usually monitored
and tried to be controlled for diseases related to sympathetic activities, such as
hypertension, anxiety, and stress-aggravated medical conditions. Biofeedback is
also a very intuitive way for the patient to be aware of the behaviours, feelings,
and thoughts related to his medical conditions.
The second study in this thesis consists of comparing two respiratory com-
ponents in the ECG signal. The purpose being to find one that potentially
might be used for biofeedback. The idea is to monitor the component while
performing controlled breathing, trying to get as clear fluctuations as possible
in the signal. This is done to lower sympathetic activities, related to stress [28].
There are two types of biofeedback training, operant conditioning and feed-
back learning, and psychophysiological psychotherapy. Operant conditioning
and feedback learning is based upon the patient doing different exercises while
monitoring biofeedback and trying to improve the physiological data. This type
of training is very rewarding for the patient due to seeing progression. Psy-
chophysiological psychotherapy on the other hand is based upon stress manage-
ment and other psychotherapeutic interventions to make the patient aware of
how the stress effects physiology.
Biofeedback therapy usually consists of some kind of electrodes being at-
tached to the patients body. These electrodes measure signals from the body
and send the information to a monitor which translates the measurements into
either lines in a graph displayed on a computer screen, a tone that varies in pitch,
or a meter which varies depending on the brightness. The measures are then
observed and described by the biofeedback therapist, and by trying different
approaches, mental activities which bring forth desired results in the measures
are identified. Biofeedback therapy should rather be seen as a training than
treatment [14][15].

2.6 Respiratory effects on ECG components


The biofeedback which will be used in this study is controlled breathing with
the intent to lower sympathetic activities. Two ways of deriving respiration
from the ECG signal will be investigated as potential biofeedback parameters.

2.6.1 RSA
The frequency of respiration usually ranges between 0.2 Hz up to 0.33 Hz for
humans, which corresponds to a breathing frequency between 12 and 20 breaths
per minute. This frequency band is referred to as the respiratory frequency
band. During respiration, a natural variation in heart rate is occurring called
respiratory sinus arrhythmia (RSA). RSA is believed to origin from vagal-cardiac
nerve traffic fluctuations, and therefore, could be seen as a monitoring of vagal
activities [8]. Vagal activities are biological processes originating in the medulla

22
oblongata of the brainstem. These activities serve as a key component of the
parasympathetic branches on the ANS. Hence, during stress with increased
sympathetic activities, these fluctuations would decrease. Thus, by training
with the purpose to increase the fluctuations, sympathetic activities could be
lowered.
During inhalation, vagal activities are suppressed which results in an imme-
diate increase in heart rate. When exhalation is performed, vagal activities are
continued and the heart rate is decreased. The reason for this synchronization
between respiration and heart rate is not fully understood, but it is believed
that RSA minimizes mechanical work done by the heart while maintaining a
healthy concentration of gases in the blood and to optimize gas exchange while
breathing [11]. The effect of RSA on HRV may differ depending on many factors
such as general health, breathing frequency, tidal volume, and age. Hence, it
can be complicated to investigate the connection between the two components.
Figure 8 below shows a typical example of a heart rate signal during respiration,
where clear fluctuations can be seen.

Figure 8: The figure shows an example of a typical beat by beat heart rate signal
during respiration, taken from

A second factor which contributes to the connection is the fact that ANS
regulates the cardiorespiratory system by a coupled feedback control system.
Included in the cardiorespiratory system are respiration, heart rate and blood
pressure. Hence, interference in one of the systems has a direct impact on the
others. As a result, during respiration, the heart rate will be affected [11].

23
2.6.2 R peak-to-peak value
R peak-to-peak value varies with breathing. This can be seen in figure 9 below,
which are R peak-to-peak values measured during respiration.

Figure 9: The figure shows a typical R peak-to-peak amplitude signal, taken during
respiration exercise of 6 breaths per minute.

The reason for these fluctuations in R peak-to-peak values during respiration


are not known, but there are many hypotheses.
Three of the most debated hypotheses are the following:

• According to the study in [12], it is suggested that R-peak amplitude


variations are highly correlated to respiratory variations in arterial pulse
pressure. Pulse pressure is the pressure difference of the systolic and di-
astolic blood pressures. Pulse pressure and stroke volume are related, due
to a higher pressure is created with a larger volume of blood in the ven-
tricle. Therefore, by varying the pulse pressure, respiration also induces
variation in left ventricular stroke volume, if arterial compliance remains
stable during a respiratory cycle. Left ventricular chamber size (preload)
is supposedly related to the amplitude of a R-peak. Thus, due to respira-
tory variations in left ventricular preload and stroke volume, it might be
possible to follow breathing pattern from R-peak amplitude.
• While breathing, the heart is slightly rotated in relation to the electrodes
on the chest. This rotation creates a cyclic change of signal strength of
the amplitude signal. In addition, during inhalation, the heart is lift up
slightly to a position closer to the chest. This will also result in an increase
in R-peak amplitude. Moreover, the impedance of the thoracic cavity is
also varied due to filling and emptying of the lungs while breathing [23].

• According to [13], the right ventricle preload is reduced due to a decrease


in the pressure gradient of the returning venous blood, which is related to

24
the increase in pleural pressure induced from inspiration. In addition, in-
spiration increases the transpulmonary pressure which increases the right
ventricular afterload. Both the reduction of right ventricular preload and
increase of right ventricular afterload lead to an increased right ventricular
stroke volume. Thus, after an inspiration period, the stroke volume is at
its minimum. As before, the stroke volume is supposedly related to the
R-peak amplitude.

The hypothesis for this thesis is that the variation in R peak-to-peak ampli-
tude is not as sensitive induced as RSA, therefore, the two are highly interesting
to compare in a biofeedback system.

2.7 Linkura’s ECG device


To identify and monitor changes in stress, Linkura has developed an advanced
wearable ECG-device for long term measurement of ECG in the daily life. The
device is used for shorter screenings of health, lifestyle, and stress. In addition,
it is used for objective measurements during health coaching. The ECG-signal
makes it possible to measure heart rate variability with sufficient precision, and
hence, being able to measure stress, recovery, sleep, activity, and sedentary
behaviour [10].
The ECG-device is worn in a chest band and clipped on with two snap fas-
teners. The location of the ECG-device is of high importance. A misplacement
of the device will lead to a distorted signal. The snap fasteners are connected to
two carbon rubber electrodes on the opposite side of the band, tightly in con-
tact with the skin. By measuring the surface potential difference on the skin,
between the electrodes, the electrodes can monitor the electrical activity of the
heart. Due to the very low signal detection range, the device uses an amplifier
for amplification of the signals.
For QRS detection of the signal in the ECG device, Pan-Tompkins real-time
QRS detection is used [29]. Shortly described, a bandpass filter is first used on
the signal to attenuate noise. Following the filter is differentiation and squaring
of the signal, which makes all values positive and provide slope information to
the QRS complex. Lastly, moving window integration is made to get the width
information of the QRS complex. By coupling the result with the original signal,
the location of the QRS complexes can be marked.
Before the data is stored, the data is pre-processed already in the device.
Measures currently collected from the device are R-R intervals calculated through
the time difference between each detected heartbeat, R peak-to-peak differences
calculated from the magnitude difference between every beat, noise calculated
from the signal, motion calculated from an accelerometer, and direction (which
way the device is facing) also calculated from the accelerometer. It would how-
ever be possible to receive the whole ECG signal, but for the current use, these
measures are sufficient. For this thesis, only the two first measures will be used.
For collection of data, the device is connected to a computer where all data
can be transferred through USB. However, for this thesis, real-time collection of

25
the data will be necessary. The device is equipped with BLE version 4.0. BLE
stands for Bluetooth Low Energy, and is a low energy version of the regular
Bluetooth. In comparison to the regular Bluetooth which is active all the time,
BLE goes on and off to save energy and does not announce it self all the time.
Instead of sending data regularly, it sends a data package with a set frequency.
This way, the BLE device does not require as much battery as the regular
Bluetooth device. It is through this BLE device that the signals will be received
to the mobile app in the second study.
ECG-signals are stored with a sampling frequency of 256 Hz together with a
battery time and storage space for up to seven days. Data transfer is done with
Bluetooth or USB. The device is manufactured in Sweden (Eskilstuna Elektron-
ikpartner AB).

Figure 10: The figure shows Linkuras ECG device from the top.

Figure 11: The figure shows Linkuras ECG device from the bottom.

26
3 First study
For the first part of the study, different stress measures were compared against
each other to find the most accurate one. These stress measures were based
on ECG components in an ECG-signal which was obtained from a healthy test
group of people. The different stress measures used were RMSSD, beat to beat
heart rate, and different frequency bands in the frequency domain of the R-R
interval signal. The recordings were taken during a set period of time where
the person being measured on was told to relax, which meant sitting still, not
talking and simply trying to feel as comfortable as possible. During this period
of recovery, the different stress measures preferably would indicate low stress
load, and possible to be compared against each other.
In addition, there were two breathing exercises, one before and one after the
relaxation period. This was partly made for the test subject to relax, but also to
investigate how the stress measures behave during controlled breathing exercises
and if there were any differences between parameters taken during controlled
breathing in a normal compared to a recovered state.

3.1 Method
A healthy test group of men aged between 20 and 50 was recruited. An in-
vitation to participate in the test study was sent out to potential candidates,
containing a general description about the study and how the procedure of the
test study would look like. In addition, the candidates were also informed that
all data would be handled without personal identification and only be presented
on group level. The volunteers were also asked if they had done any recent ex-
hausting activities, whether they take medication which may have influence on
the heart or respiration, and whether they have any previous experience in med-
itation, mindfulness, breathing exercises or yoga. A total of 8 volunteers were
recruited in the age between 23 and 46, with a mean age of 29,6. None of the
volunteers had any special medical conditions which would have any influence
on the measurements.
The measurements were made with Linkura’s own ECG-device (section 2.7).
Parameters gathered from the ECG-device which were further used in this study
were the time interval between every heartbeat (R-R interval), and the ampli-
tude of each heartbeat (R-peak amplitude). After the measurements, all data
collected on the ECG-device was transferred to a computer.
Immediately from the start of the measurements, the ECG-device was at-
tached to the volunteers. The reason for this was to generate as good connection
as possible between the ECG electrodes and the skin of the volunteer. Prefer-
ably, the surface between the band and skin should be slightly warm and moist
(sweaty), which lowers the impedance of the skin and makes the signal stronger.
Before the measurement, it was confirmed that signals were received by check-
ing the lights on the device, green light indicating signals being received. The
measurement in whole consisted of 30 minutes. The first and last 5 minutes
consisted of a breathing exercises where the volunteer followed a given breath-

27
ing pattern for relaxation. The breathing pattern was displayed on a mobile
device. In the remaining 20 minutes in between the breathing exercises, the
volunteer was asked to simply relax while listening to calm music. During the
entire measurement, the volunteer was asked to be seated, not to speak and not
to do any major movements.

Figure 12: Figure illustrating the time division of the measurement. The red part
represents the 5 minutes breathing exercises and the white part in between represents
the relaxation part.

Figure 12 above illustrates the different parts of the measurement. Before


starting the measurements, it was assured that the ECG-device was located cor-
rectly. Starting- and end time for both breathing exercises were noted. During
the measurement, the volunteer was asked to be seated in an empty room and
trying to relax. During the two breathing exercises, a breathing pattern with
the frequency of 7 breaths per minute was displayed on a mobile phone placed
in front of the volunteer. This was used simply to guide the volunteer through
a controlled breathing.
After the measurements were done, a questionnaire was filled in to check if
the volunteers experienced a lowering in stress-level after the relaxation period.
The volunteers were asked to choose a number between 1 and 5 to quantify how
relaxed they felt, 1 representing no lowering of stress-level felt.
All analysis in study one was made offline, that is, after all measurements
of the test group were done. Before the data could be further analyzed, it
was pre-processed. Abnormal peaks in the R-R interval which most probably
were a result from a false identified heartbeat were manually erased after visual
inspection. This could also have been made automatically, although, since the
amount of peaks were as few as they were, more control was given by doing it
manually. The data was also divided into data sets of each volunteer. When
the data was divided into these sets, the data sets were further divided into 3

28
different parts, using the time stamps noted down for each measurement. These
3 parts were the two breathing exercises and the 20 minutes relaxation period
in between. The relaxation period was then further divided into four parts, 5
minutes each. The reason for this division was to be able to monitor the progress
of the stress measures during the relaxation period.
The different stress measures were then calculated for the different parts
of the data sets, using functions created in MatLab. For the frequency domain
analysis, Welch’s power spectral density estimate was used for Fourier transform
of the signal. In the frequency domain, there are two frequency bands of interest,
the LF band (0.05 - 0.15 Hz) and HF band (0.15 - 0.4 Hz). The analysis was
made for the HF band and the ratio between LF and HF band.
Box plots were then used for visualizing the stress measures. A box plot is a
graph which illustrates the range of values within a data set, together with a line
which represents the median of the data set. Differences between groups were
statistically investigated using Student’s paired t-test with significance level set
to p<0.05

3.2 Results
All stress measures in this study are based on the time between every heartbeat
(R-R interval). A part of a typical R-R interval signal can be seen in figure 13
below.

Figure 13: This signal is taken during controlled breathing and the rapid variation
seen is the respiratory R-R interval variation.

29
The signal consists of values representing the amount of seconds between
every heartbeat, where a new value is given for every new heartbeat. Hence,
the x-axis represents heartbeat numbers.
Table 1 below shows statistics of what the volunteers answered on the ques-
tion if they felt more relaxed after the measurement.

Relaxation level (1-5) Percentage of volunteers


1 0
2 0
3 12.5%
4 62.5%
5 25%

Table 1: Table of the experienced relaxation among the volunteers. 5 representing


full relaxation and 1 representing no relaxation felt.

The first stress measure analyzed in the first study was the heart rate. Fig-
ure 14 shows a box plot of the mean heart rate values taken from the volunteers
for each of the six 5 minute parts. The first and last part represents the breath-
ing exercises, while the four parts in the middle are the relaxation period in
between, divided into four parts. Following this box plot is figure 15, which is
a normalized box plot of the values in the previous figure. The normalization
was made for each volunteer.

Figure 14: Figure illustrating a box plot of the heart rate values from first study.
Y-axis representing heart rate values and X-axis representing the six different parts
of the test. Each box represents a data set. The red line in the middle of a box
represents the median of the values. Everything above the median represents the top
50% of the values, and everything under the median represents the bottom 50% of
the values. Within in box are values +/- 25% of the median value. Those values in
the top/bottom 25% are shown by the top/bottom ”whiskers” and the crosses. The
crosses represents values a lot more or a lot less than normal (outliers).

30
Figure 15: Figure illustrating a box plot of the normalized heart rate values from
first study. Y-axis representing normalized heart rate values and X-axis representing
the six different parts of the test. For further explanations regarding box plots, see
figure 14.

Seen in these two figures, especially for the normalized plot, is that the
heart rate decreases during the relaxation period, and slightly between the two
breathing exercises.
To look at the trend during relaxation, the first and last 5 minutes of this
period was compared (groups 2 and 5). This difference showed a p-value of
0.0057, and thus was significant (p<0.05). However, there was no significant
difference between the two breathing exercises.

Figure 16 is a box plot of the RMSSD values calculated for each data set
for each part. The figure following this box plot is figure 17, which is a nor-
malized box plot of the previous one, where the data set for each volunteer was
normalized in the same manner described above.

Figure 16: Figure illustrating a box plot of the RMSSD values from first study. Y-
axis representing RMSSD values and X-axis representing the six different parts of the
test. For further explanations regarding box plots, see figure 14.

31
Figure 17: Figure illustrating a box plot of the normalized RMSSD values from first
study. Y-axis representing normalized RMSSD values and X-axis representing the six
different parts of the test. For further explanations regarding box plots, see figure 14.

The box plots, especially the normalized, show an increase of RMSSD during
the relaxation period. It can also be seen that the boxes increases in size during
this period.
For the t-test between the first and last part of the relaxation period, a
p-value of 0.0398 was given, which is significant for p<0.05. No significant
difference was shown between the two breathing exercises.
Figure 18 shows a box plot illustrating the intensity in the HF-band for each
part of the test for each data set. Figure 19 following this is another box plot
showing normalized intensity of the HF-band for each part. Normalization was
made in the same manner as above.

32
Figure 18: Figure illustrating a box plot of the distribution of R-R interval signals
within the HF-band from first study. Y-axis representing HF-band intensity and X-
axis representing the six different parts of the test. For further explanations regarding
box plots, see figure 14.

Figure 19: Figure illustrating a box plot of the normalized distribution of R-R
interval signals within the HF-band from first study. Y-axis representing normalized
HF-band intensity and X-axis representing the six different parts of the test. For
further explanations regarding box plots, see figure 14.

Seen in the box plots for the HF-band is an increase of HF-band content
during the relaxation period. Although, compared to the previous two stress
measures, the trend is not as regular.
The t-test between the first and last part of the relaxation period gave a
p-value of 0.0108, which results in a significant difference for p<0.05. For the
breathing exercises, there was no significant difference.

33
Figure 20 represents a box plot illustrating the ratio between the intensity
of the LF-band and HF-band. Following this box plot is figure 21, which also
represents the ratio between the intensity of the LF-band and HF-band, but
where the intensities have been normalized among each volunteer data.

Figure 20: Figure illustrating a box plot of of the distribution of R-R interval signals
within the ratio LF/HF band from first study. Y-axis representing the ratio between
the two frequency bands and X-axis representing the six different parts of the test.
For further explanations regarding box plots, see figure 14.

Figure 21: Figure illustrating a box plot of of the normalized distribution of R-R
interval signals within the ratio LF/HF band from first study. Y-axis representing
the normalized ratio between the two frequency bands and X-axis representing the six
different parts of the test. For further explanations regarding box plots, see figure 14.

A decrease in LF/HF ratio can be seen for both the relaxation period and
also between the two breathing exercises.

34
A t-test between the first and last part of the relaxation period gave a p-
value of 0.0036, which is a significant difference for p<0.005. For the breathing
exercises, a p-value of 0.0467 was recorded, which shows a significant difference
for p<0.05.
A summary of the p-values from the t-test between the first and last part of
the relaxation period is shown in table 2 below. Also, illustrating the median
of the first and last part of the relaxation period for the normalized values.

Table 2: Table of the the median for the first and last part of the relaxation period.
Last column shows the p-value of a t-test between the two groups. ⋆ : p < 0.05, ⋆⋆ :
p < 0.005, ⋆ ⋆ ⋆ : p < 0.0005, ns : non − signif icant.

Stress measure Median (First part) Median (Last part) p-value


HR 0.1703 0.1616 ⋆
RMSSD 0.1309 0.1512 ⋆
HF 0.1369 0.2561 ⋆
LF/HF 0.1294 0.0475 ⋆⋆

According to the table, all stress measures shows a significant difference dur-
ing recovery, with expected directions of change, where LF/HF ratio showed the
most significant difference.

Furthermore, a similar comparison was made between the breathing exer-


cises. This is illustrated in table 3 below.
Table 3: Table of the the median for the first and last breathing exercise. Last
column shows the p-value of a t-test between the two groups. ⋆ : p < 0.05, ⋆⋆ : p <
0.005, ⋆ ⋆ ⋆ : p < 0.0005, ns : non − signif icant.

Stress measure Median (First part) Median (Last part) p-value


HR 0.1724 0.1674 ns
RMSSD 0.1865 0.1990 ns
HF 0.0813 0.0829 ns
LF/HF 0.3298 0.2911 ⋆

The table above tells us that there was only a significant difference between
the breathing exercises for the LF/HF ratio stress measure. But the trend in
all changes followed expected directions.

35
3.3 Discussion
According to table 2 and 3, all stress measures show a significant difference dur-
ing the recovery period. This means that each of the stress measures analyzed
in this study registered values indicating less stress during a period of recov-
ery and could potentially be used as a parameter to identify stress. Showing
the greatest difference, comparing the first part of the recovery period with the
last, is the LF/HF ratio, however, this stress measure does not show as steady
development as the HR. In fact, HR is the only stress measure which shows a
continuous lowering of stress level throughout the whole recovery period, look-
ing at the median values for each stress measure. Although, looking at the
boxes, RMSSD also shows a steady decrease in stress level. It is conceivable
that the stability of HR is due to the fact that the volunteers were at rest and
we did not introduce any influence of physical activity. It could also be that the
volunteers would have needed even more time before the measurements to calm
down physically.
It can also be seen that the normalized box plots show clearer development of
the stress measures. The reason being that even though the development of the
stress measures follow the same trend for the different volunteers, the magnitude
of the values differ. Hence, by making them normalized for each volunteer, more
fair values was given. The greatest difference can be seen for heart rate, where
the boxes (variation between the volunteers) are much greater compared to the
normalized ones. The difference between the regular and the normalized plots
are not as great for the frequency domain. This would probably tell us that the
frequency of the R-R interval does not vary as much as the plain values among
different subjects.
Generally speaking, HRV seems like a more stable measure in comparison
to HR. The reason probably being that for HRV measures, further calculations
from the time differences between each heartbeat are made. While for HR,
the time differences between each heartbeat are taken and used directly as a
value. For HRV, as mentioned earlier, the advantage is that more stable values
are given with less strong variations. With the reason being that it instead of
taking the time differences between heartbeats, it takes the power of the time
differences divided by the amount of differences calculated for. A downside of
this however, which could be seen in the results, is that HRV does not show as
strong variations as HR.
What can also be noted is that the boxes for especially RMSSD and heart
rate increases towards the last part of the recovery period. This tells us that the
progression of these stress measures varies more between the volunteers. The
reason for this could be that some of the volunteers had an easier time to relax
and decrease their stress level while others had it harder. This kind of variations
could support the theory of, especially heart rate and RMSSD, working as stress
measures, since it is reasonable that there should be variations in how easy the
different volunteers could lower sympathetic activities and relax.
Not much difference between the two breathing exercises could be seen.
Something which could be seen for all stress measures were that the stress level

36
went down slightly for the second breathing exercise. Since controlled breathing
was performed for these periods, together with the fact that respiration influ-
ences HRV, not much changes were expected to appear. LF/HF ratio was the
only stress measure showing significant difference for the breathing exercises.
The LF/HF box plot seems to be a reverse version of the HF box plot.
This makes sense, since both these bands cover most of the signals. Therefore,
a decrease in one of the bands would mean an increase in the other. There is
however another frequency band, very low frequency (VLF), which has not been
much researched up to this point.
The division of bands in frequency domain was taken from literature and is
the most common division for analysis of ANS. The division does have a purpose
based on the upper frequency bounds of SNS and PNS calculated in equation 1
and 2. It could however be interesting to alter these bands and potentially find a
division which would work even better for monitoring stress. For the purpose of
monitoring SNS and PNS, not much altering can be made due to the frequency
bounds. Although, after frequency domain analysis for different stress levels on
individual level, it could be possible to discover smaller frequency bands which
could work promising as a personal stress measure.
It should also be mentioned that table 1 showed that all volunteers felt more
relaxed after the relaxation period, which strengthens the assumption that the
stress level goes down during this period. Which was a key factor for the whole
study.
By using Fourier transform for the frequency measures, we assume that we
have a stationary signal [33]. This means that the signal’s frequency does not
change over time. The majority of signals which engineers work with are non-
stationary, and so are the signals we have been working with. The interesting
question is whether this have any influence on the results. The test studies were
designed to minimize the effect. This was done partly by avoiding interference
such as steps and strong baseline variations. Also, the problem is even less
significant for measures with controlled breathing. Signals which did not consist
of controlled breathing were divided into shorter segments, which should lower
the effect of a potential varying frequency, especially at the statistical group
level which we looked at.
In addition, it should also be noted that assumptions were made in order to
use the T-test. T-test assumes that the populations are normally distributed.
This assumption was made for our data sets with the argue that every individ-
ual’s heart rate over a long period of time can be seen as normally distributed.
And due to each individual’s heart rate following a normal distribution, all data
sets together can also be seen as normally distributed.

37
Furthermore, we need to take into consideration that the R-R intervals used
for calculations of the stress measures are not appearing regularly in time. A
new value is given after every heartbeat, which most likely does not appear
every second for a whole measurement. It should also be mentioned that there
is some uncertainty introduced by letting the volunteers be alone during the
measurements. The volunteers were not monitored, which means that sources
of error could be introduced, such as if the volunteer did any specific movements
which might have affected the results.
Due to being slightly more regular in its trend, RMSSD and HR were further
implemented and used as stress measures for the second study. In addition, a
stress measure based on the frequency domain of the signal would be problem-
atic for real-time measurements. Since the second study consisted of real-time
measurements, the stress measures in frequency domain were not implemented
in the application. However, just looking at the results from this study, the
LF/HF band would be the suggested stress measure for offline analysis. This
suggestion coincides with the hypothesis that a stress measure taken from the
frequency domain is more strongly linked to SNS/PNS.
As a potential future stress measure, it would be interesting to combine
multiple parameters, for example combining RMSSD and heart rate. This would
probably be a safer solution than to solely trust one single parameter.

38
4 Second study
In the second study, two different respiratory components in the ECG signal
were analyzed. The purpose was to identify which of the two components that
is most useful in biofeedback during relaxation.

4.1 Method
The processes of the second study can be divided into four parts which will be
further described in the following sections.

4.1.1 The app


As a first step, a real-time application needed to be created which could be
connected with the ECG-device via Bluetooth in order to analyze and visual-
ize the respiratory components in the ECG signal. The application visualized
the respiratory components while performing a specific breathing pattern. The
application was programmed in the platform Android Studio, and targeted An-
droid devices. The app also visualized beat by beat measures of heart rate
and R-peak amplitude, with the possibility to also show the two selected stress
measures from the previous test study, heart rate variations and RMSSD val-
ues. Since the app should be able to induce controlled breathing, an animation
guiding the user through a breathing exercise was also implemented. As an
additional setting, the user was able to change the breathing frequency of the
breathing exercise. For more information about the programmed app and its
interface, see Appendix 1.

4.1.2 Test group


Five volunteers were recruited as test subjects for this study. Similar to the
first study, the target test group included only healthy men between the age of
20 and 50. As for the first study, invitations to participate in the test study
was sent out to potential candidates, containing a general description about the
study and that all data would be handled without personal identification. Same
questions as in the first study were also asked to the volunteers. The volunteers
recruited were in the age between 29 and 46, with a mean age of 34,7. And as
for the first study, none of the volunteers had any special medical conditions
which would have any influence on the measurements.

4.1.3 Measurements
Measurements were made on the volunteers while a breathing exercise was per-
formed. Their data was fed back to them on the app during the exercise. The
measurement consisted of four parts, each consisting of 3 minutes. Each of the
two respiratory components was used as a biofeedback for the volunteers, for
two different breathing frequencies. The breathing frequencies which were used
were 6 and 9 breaths per minute. The order of the respiratory components was

39
alternated among the different volunteers to eliminate any potential effect that
the order might have had. The four different measurement parts are shown in
table 4 below.

Feedback parameters 6 bpm 9 bpm


Heart Rate 1 3
R-peak Amplitude 2 4

Table 4: Table showing the four different measurement parts of study 2. Bpm stand-
ing for ”breaths per minute”, which was the rate of controlled respiration. Numbers 1-4
simply representing the four different parts of the measurements, not in that specific
order since the order was altered.

Before measurements were done, it was assured that the ECG device was lo-
cated correctly. During the measurement, the volunteer was asked to be seated
in an empty room and trying to relax. The created mobile application was used
during the measurement. On the application, data calculated according to the
currently selected respiratory component was shown, continuously updated. In
addition to this, the pacer guiding the user was also shown, set to the current
pace. Figure 22 below illustrates how the application looked like while perform-
ing the measurements.

Figure 22: Figure taken during measurement in the app, showing beat to beat R-peak
Amplitude together with a breathing exercise of 6 breaths per minute.

40
After all four tests were finished, the volunteer was asked which of the two
respiratory components followed the breathing pattern most accurately, in order
to obtain their subjective impression. In addition, the data was stored on the
mobile phone. The mobile phone used for this measurements was a Sony Xperia.
When all volunteers had performed the measurements, the data was transferred
to a computer for further calculations and analysis.

4.1.4 Analysis
When all data sets were stored, they were further analyzed with MATLAB.
The aim was to identify how well the two respiratory components followed the
breathing patterns. This was done by using two different algorithms, peak
detection and zero crossing, as well as an analysis in frequency domain. As we
know the breathing frequency in each test, we know what the desired amount
of breaths should be. The amount of breaths during the tests are calculated in
the following equations (bpm = breaths per minute).

6 bpm * 3 minutes = 18 breaths (6)

9 bpm * 3 minutes = 27 breaths (7)


The two algorithms (peak detection and zero crossing) were used to inves-
tigate how close to these target values we came for the two respiratory com-
ponents. With the purpose of showing how stable each method was, for both
breathing frequencies.
The peak detection algorithm simply checks for points in the signal where
the next and previous value is lower than the current, in other terms, points
which represents a peak. In addition to this, a threshold for peaks was set equal
to the mean value of the signal. An example of the result of a peak detection
algorithm for a typical signal can be seen in figure 23 below.

41
Figure 23: Figure illustrating an example of peaks identified by the peak detection
algorithm. The circles shows the peaks detected in the signal, and the red dotted line
represents the threshold. This example was taken for a beat to beat heart rate signal,
during a controlled breathing of 6 breaths per minute.

The zero crossing algorithm identify the amount of times the signal passes
the zero line. By subtracting the mean value, the signal was based around the
zero line. Then, points where the sign changes (positive/negative) just had to
be identified. By taking the crossings divided by two, the amount of waves can
be detected. An example of the result of a zero crossing algorithm for a typical
signal can be seen in figure 24 below.

Figure 24: Figure illustrating an example of crossings identified by the zero crossing
algorithm. The circles show the points where the signal changed between positive and
negative. This example was taken for the same signal as figure 23 above.

42
Lastly, the signal was transformed into frequency domain using Welch’s
power spectral density estimate. Calculations to investigate the percentage of
power in the frequency band of the breathing frequency were then made. The
frequencies of the target shown to the subject were:
6 breaths per minute
= 0.1 Hz (8)
60 seconds
9 breaths per minute
= 0.15 Hz (9)
60 seconds
The percentage of signal power in the range +/- 0.02 Hz from the target
breathing frequencies ([0.08 - 0.12 Hz] for 6 bpm and [0.13 - 0.17 Hz] for 9 bpm)
was investigated.
All three methods (peak detection, zero crossing, and frequency domain
analysis) were visualized with the help of box plots to get a better illustration
of the distribution of the values. In addition, a t-test was done between the two
respiratory components for each of the methods.

43
4.2 Results
Two respiration synchronous components of the ECG signal were analyzed dur-
ing this study. Examples of typical signals are shown in figure 25 and 26 below.

Figure 25: The figure shows an example of how a typical R-peak amplitude signal
looked like. This recording was taken during 3 minutes controlled breathing with a
pace of 6 breaths per minute, which would mean that 18 breaths would be expected.

Figure 26: The figure shows an example of how a typical beat to beat heart rate
signal looked like. As for the figure above, this recording was taken during 3 minutes
controlled breathing with a pace of 6 breaths per minute, which would mean that 18
breaths would be expected.

The first figure illustrates a typical amplitude signal and the second figure
illustrates a typical beat to beat heart rate signal. What can be seen in this
example is that the amplitude signal shows a slightly more noisy appearance.
Despite the noise, a sinusoidal pattern can be identified for both signals. Firstly,
algorithms were used to check how well they followed the breathing patterns.

44
The first algorithm to be used was the peak detection algorithm. The first
two figures show box plots of the distribution of detected breaths for the R peak
amplitude and the beat to beat heart rate for the two breathing frequencies. For
the first two algorithms, which detect number of breaths in the signal, there will
be a red dotted line representing the true value calculated in equation 6 and 7.

Figure 27: The figure shows the distribution of the amount of breaths detected for
both the R peak amplitude and the heart rate, using the peak detection algorithm.
The breathing frequency used was 6 breaths per minute. The red dotted line represents
the true value. For further explanations regarding box plots, see figure 14.

Figure 28: The figure shows the distribution of the amount of breaths detected for
both the R peak amplitude and the heart rate, using the peak detection algorithm.
The breathing frequency used was 9 breaths per minute. The red dotted line represents
the true value. For further explanations regarding box plots, see figure 14.

45
The box plots show that for the peak detection algorithm, the beat to beat
heart rate registers breaths more similar to the true value, in comparison to
the R-peak amplitude. The difference between the groups in both figure 27 and
figure 28 was statistically significant (p<0.05).

Following the peak detection algorithm was the zero crossing algorithm.
Figures 29 and 30 represent box plots of the amount of breaths detected by
the zero crossing algorithm. The first plot shows a breathing frequency of six
breaths per minute while the second plot shows a breathing frequency of nine
breaths per minute.

Figure 29: The figure shows the distribution of the amount of breaths detected for
both the R peak amplitude and the heart rate, using the zero crossing algorithm. The
breathing frequency used was 6 breaths per minute. The red dotted line represents
the true value. For further explanations regarding box plots, see figure 14.

46
Figure 30: The figure shows the distribution of the amount of breaths detected for
both the R peak amplitude and the heart rate, using the zero crossing algorithm. The
breathing frequency used was 9 breaths per minute. The red dotted line represents
the true value. For further explanations regarding box plots, see figure 14.

For 6 breaths per minute, it can be seen that the zero crossing algorithm
registers breaths more similar to the true value for the beat to beat heart rate
signal. However, for beat to beat heart rate signal with 9 breaths per minute, it
registers fewer breaths than the true value. The difference between the groups
in both figure 29 and figure 30 was statistically significant (p<0.05).
Comparing the two time domain algorithms, it can be seen that for the beat
to beat heart rate, a more accurate number of breaths is detected. Hence, the
time domain algorithms would suggest that the beat to beat heart rate shows
a clearer pattern following breaths.

In addition to these two time domain algorithms, analysis in the frequency


domain was also made. The following two figures show box plots of the ratio
between the part of the signal +/- 0.02 Hz from the target breathing frequency
and the total signal.

47
Figure 31: Figure represents the ratio of the signal within +/- 0.02 Hz from the
breathing frequency, which for this measure is 0.1 Hz, as compared to the total power
of the signal. The ratio is between 0 and 1. Left box represents values taken from R
peak amplitude and right box represents values taken from beat to beat heart rate.
For further explanations regarding box plots, see figure 14.

Figure 32: Figure represents the ratio of the signal within +/- 0.02 Hz from the
breathing frequency, which for this measure is 0.15 Hz, as compared to the total
power of the signal. The ratio is between 0 and 1. Left box represents values taken
from R peak amplitude and right box represents values taken from beat to beat heart
rate. For further explanations regarding box plots, see figure 14.

A high value is desired here, since a high value corresponds to a greater part
of the signal being close to the breathing frequency. What can be seen is that
for 6 breaths per minute, the heart rate signal corresponds better to the breath-
ing frequency. However, for 9 breaths per minute, the two components seem
more similar. The difference between the two groups was statistically signifi-
cant (p<0.05) for the breathing frequency of 6 breaths per minute (figure 31),
but not for 9 breaths per minute (figure 32). This shows that beat by beat heart
rate has a significant higher portion of signal within the breathing frequency for

48
6 breaths per minute, compared to the R peak amplitude.
As a supplement, a subjective measure was taken using a questionnaire to
the volunteers after the measurements. Here, 3 out of 5 volunteers picked the
heart rate signal as the parameter that followed breathing pattern the best,
while 2 out of 5 thought they followed similar. No one said that the R peak
amplitude was clearly the better. It should be mentioned that the volunteers
based their decision by seeing the signals in real-time, and were not allowed to
see the full signal offline. However, the analysis was made offline for the whole
signal. This is further discussed in the discussion section below.

4.3 Discussion
Firstly, it should be mentioned that the purpose of applying the peak detection
and zero crossing algorithms was not to detect breathing as accurate as pos-
sible, but to demonstrate the behaviour of each signal. There are many good
alternatives of algorithms to detect noisy respiratory signals, but that was not
the purpose of this study.
Before analyzing the signals further, with the support of algorithms and fre-
quency domain, it can be seen by just analyzing the plain signals that both res-
piratory components roughly had a sinusoidal appearance following the breaths.
Hence, both respiratory reflecting components could potentially work as biofeed-
back parameters. A future suggestion to similar studies would be to begin the
measurement from a stressful state. Since the idea of the biofeedback exercise
was to increase fluctuations, it would be interesting to see if it was possible to see
any changes in fluctuations going from a stressful state to a more relaxed one.
In comparison to just identifying the respiratory reflecting component showing
clearest fluctuations.
Starting with the results from the peak detection algorithm, the heart rate
seems to be fluctuating synchronized with breathing quite well with slightly
more breaths identified for six breaths per minute while even more accurate for
nine breaths per minute. Peak detection algorithm detected much more peaks
than detected for the amplitude signal. The reason being that the amplitude
signal was not as smooth as the heart rate signal. This leads to many smaller
peaks being identified as breaths (see figure 25).
The second algorithm used was the zero crossing algorithm. As for the peak
detection algorithm, the amplitude signal usually registered more breaths than
wanted due to the uneven signal behaviour. For the heart rate signal, a very
similar amount to the true value of breaths taken was detected for six breaths per
minute. This would indicate that the heart rate follows breathing pattern well.
However, for nine breaths per minute, the zero crossing algorithm registered
fewer breaths than expected. Analyzing the heart rate signals, the reason for
this has to do with a varying baseline of the signal, which can be seen in the
example signal shown in figure 33 below.

49
Figure 33: The graph illustrates a typical example of a heart rate signal taken from
the second study for nine breaths per minute.

As can be seen in figure 33, the baseline varies, which has an affect on the
zero crossing algorithm. Since the idea of an zero crossing algorithm is to set
a baseline and check the amount of ”waves” above it. Problem with baseline
variation is something which was not present for the amplitude signal, the reason
being that these values represent the difference in R peak amplitude between
every heartbeat, which for a longer period of time will have a mean value near
zero.
As for the frequency domain analyzes, the p-values from the results above
tell us that there is no significant difference between the two components for nine
breaths per minute, for p<0.05. Although, for six breaths per minute there is a
significant difference. By analyzing the box plot in figure 31, and 32, it can be
seen that the heart rate signal has higher values than the amplitude signal for six
breaths per minute. This would mean the heart rate signal has a frequency more
similar to the breathing frequency. Hence, the heart rate signal should follow
the breathing better for this breathing frequency. Since biofeedback usually is
used for relaxation purpose with a slower breathing pattern, the results from 6
breaths per minute would probably be more relevant to look at.
When analyzing the frequency domain for the two signals, it was found that
beside the peak around the breathing frequency, there was usually a peak in the
very low frequencies also. This behaviour is illustrated in figure 34 below.

50
Figure 34: The graph illustrates a typical example of a heart rate signal in frequency
domain, taken from the second study for six breaths per minute, which corresponds
to a breathing frequency of 0.1 Hz.

The figure above shows a typical heart rate signal, transformed into fre-
quency domain. As can be seen, a peak is present for the breathing frequency,
which for this example was 0.1 Hz. Although, in addition to this peak is a peak
for the lowest frequencies. The reason for this peak is a varying baseline which
was present in some of the measurements for heart rate signal. The heart rate
signal for the example above can be seen in figure 35, where a clear baseline
variation in the signal can be seen.

Figure 35: The graph illustrates a typical example of a heart rate signal, taken from
the second study for six breaths per minute.

51
This type of baseline variation was not present for the amplitude signal.
However, another common pattern in the frequency domain could be seen. In
addition to the peak present around the breathing frequency, one or more har-
monics could be seen. A typical example of this can be seen in figure 36 below.

Figure 36: The graph illustrates a typical example of a amplitude signal in frequency
domain, taken from the second study for six breaths per minute, which corresponds
to a breathing frequency of 0.1 Hz.

For a clearer understanding of how the two signals differ from one another,
the frequency distribution of the two signals can be seen in figure 37 and 38
below.

Figure 37: The figures show the frequency distribution of the amplitude signal for
both 6 and 9 breaths per minute.

52
Figure 38: The figures show the frequency distribution of the heart rate signal for
both 6 and 9 breaths per minute.

These figures show that a greater part of the signal is in the lower frequencies
for the heart rate signal, which was due to a varying baseline. While for the
amplitude signal, a greater part of the signal is in the higher frequencies, which
could be seen in the signal in the form of noise, seen in the example signal in
figure 25.
According to the analysis which have been made for the two respiratory
components, it could be seen that the beat to beat heart rate signal showed
more clear pattern following the breaths. This would suggest the beat to beat
heart rate as a preferred biofeedback signal. As a compliment to this, the
subjective questionnaire also supported this suggestion. As for the first study,
the hypothesis agree more or less with the results achieved.
An interesting approach could be to use filters for the two respiratory com-
ponents. For the baseline varied R-R interval signal, a high pass filter could
be used to get the signal to baseline. As for the more noisy R-peak amplitude
signal, a low pass filter could be used to get a smoother signal. Furthermore,
an interesting approach would be to utilize pattern recognition to weigh up the
signals. This would not be correct for research purpose, but for simple biofeed-
back exercise, it could help the individual to clearer see changes in fluctuations,
which is the main purpose [30].
In addition, the idea of this biofeedback method is to increase the fluctua-
tions related to parasympathetic activities. This would suggest that a nervously
controlled signal (RSA) would be needed, and R peak amplitude which is not
controlled by the nervous system would therefore not work.
However, since the beat to beat heart rate signal is nervously controlled, it
could be heavily affected by stress for a very stressful person. Hence, for the
purpose of following biofeedback and trying to increase fluctuations, it could be
easier and less stressful for a person to follow the R peak amplitude. The reason
being that the R peak amplitude is mechanical controlled and not as affected
by the nervous system. However, since this supposedly does not monitor the

53
ANS, it would only be suggested for very stressed individuals at the start of
biofeedback exercises.
It could be discussed whether following a respiratory component for biofeed-
back would in fact be relaxing for the user or actually brings more stress. The
concept of biofeedback is to increase HRV, which in turn lowers sympathetic
activities, consisting of a more focused and stressed state. Hence, according
to literature [31], it should decrease stress. Generally speaking, the following
of respiratory component should lower the stress level, but in various degree.
The degree of relaxation is something which probably varies by a great amount
from person to person. It is definitely possible that such an exercise could even
increase stress for some individuals.
With today’s stressful environment with increasing numbers of stress-related
diseases, it would be of great importance for people to monitor their stress and
to be alarmed when the level is critical. There are probably many people walking
around with a very stressful body without thinking about it, thus, they need to
be informed. By monitoring individual’s stress levels, specific segments of their
life could be identified which specifically increases their stress. The individuals
get better knowledge, and in time better control over their body. This could be
done by introducing the stress measures in a future wearable device. This way,
individuals get a real-time update regarding their stress levels, and do not have
to go the complicated way of booking an appointment with a doctor. Since the
targeted persons with high stress usually are the ones that does not have time
for doctors and appointments, wearable devices would be a perfect fit for them.
A question which arises is whether similar analysis could be made without
ECG, for example by the use of photoplethysmography (PPG). PPG is usually
used in wearables which are worn on the wrist. It uses light to detect blood
flow through the wrist. Unfortunately, blood flow is much more unstable than
ECG, especially on the wrist. In addition, the PPG-signal is more sensitive to
movements and less accurate, which would be problematic for HRV calculations.
However, for longer periods, the pulse rate variation correlates to HRV.
Hence, real-time measure of stress levels would probably not be possible for
PPG, but stress measure taken over a longer period of time could possibly
be implemented. Hence, for the purpose of just identifying general stress in
a persons normal day, an offline stress measure via PPG would be sufficient.
However, for more in depth investigation of a persons stress behaviour, a stress
measure closer to real-time would be needed.

54
5 Conclusion
In this thesis, an in-depth literature study was made as a support to two separate
experimental studies. In the first experimental study, different stress measures
derived using ECG were investigated and compared among each other. The
purpose was primarily to see if they show significant changes in stress load
during a period of recovery, but also to compare them during this period. For
the second experimental study, a real-time solution was created to investigate
two respiratory components in an ECG-signal. This was done by monitoring
the two respiratory components during a controlled breathing exercise. The
purpose was to find out which one of these followed the breathing pattern the
most, and therefore, would be most suitable for biofeedback. This was done by
the use of time and frequency domain algorithms.
The first experimental study showed promising results for the stress mea-
sures, where all stress measures detected a significant decrease of stress load
during a period of recovery. Which could indicate that all measures could po-
tentially work as parameter to identify stress. The most significant decrease was
given by the LF/HF ratio, which was taken from the frequency domain. How-
ever, more steady decrease was shown for the RMSSD and heart rate signal. The
suggested stress measure for further use was the LF/HF ratio. However, a stress
measure based on the frequency domain of the signal would be problematic for
real-time measurements, thus, RMSSD and heart rate were implemented to the
second study.
By analyzing the plain signals, both respiratory components in the second
experimental study followed the breathing pattern, more of less. They both had
a specific feature which made it problematic for the algorithms to identify the
correct amount of breaths. Compared to the heart rate signal, the R-peak am-
plitude signal had a more uneven appearance with more noise. A feature which
was present for the heart rate signal, that could not be seen for the R-peak
amplitude signal, was baseline variations of the signal. During ECG measure-
ments, the R-peak amplitude varies around zero, since the values represents the
differences between R-peak amplitudes. The heart rate on the other hand may
differ during the measurements due to varying heart rate. Both these signal
appearances were also seen in the frequency analysis.
Combining the algorithms and the frequency analysis, the heart rate signal
followed the breathing pattern more accurately in comparison to the R-peak
amplitude.
With today’s stressful environment with increasing numbers of stress-related
diseases, it would be very interesting to implement these stress measures in a
wearable device. This would allow people to keep track of their stress, to be
able to gain more knowledge and learn how to control it. Which hopefully could
bring a more healthy life to many stressful individuals.

55
6 References
[1] Helpguide. Stress Symptoms, Signs, and Causes. Date of access: 04/17.
URL: https://www.helpguide.org/articles/stress/stress-symptoms-signs-and-causes.htm

[2] Gerard J. Tortora and Bryan Derrickson. Principles of Anatomy Physi-


ology. vol 1. 14th ed. New York: Wiley, 2011

[3] The American Institude of Stress. What is stress?. Date of access: 04/17.
URL: https://www.stress.org/what-is-stress/

[4] Sansanee Boonnithi, Sukanya Phongsuphap. ”Comparison of Heart Rate


Variability Measures for Mental Stress Detection”. Faculty of Informationand
Communication Technology, Mahidol University, Bangkok, Thailand

[5] R. Castaldo, P. Melillo, U. Bracale, M. Caserta, M. Triassi, L. Pecchia.


”Acute mental stress assessment via short term HRV analysis in healthy adults:
A systematic review with meta-analysis”. Biomedical Signal Processing and
Control 18 (2015) 370-377

[6] Harvard Health Publications. Understanding the stress response. Date of


access: 05/17. URL: http://www.health.harvard.edu/staying-healthy/understanding-
the-stress-response

[7] Lehrer, Paul M.; Gevirtz, Richard. ”Heart rate variability biofeedback:
how and why does it work?”. United States: Frontiers Media S.A, 2014.

[8] Gary G. Berntson, J. Thomas Bigger, Jr., Dwain L. Eckberg, Paul Gross-
man, Peter G. Kaufmann, Marek Malik, Haikady N. Nagaraja, Stephen W.
Porges, J. Philip Saul, Peter H. Stone, Maurits W. van der Molen. ”Heart rate
variability: Origins, methods, and interpretive caveats”. Psychophysiology, Vol
34(6), Nov, 1997. pp. 623-648.

[9] Kenneth C. Bilchick, MD; Ronald D. Berger, MD, PhD. Heart Rate Vari-
ability. Date of access: 05/17. URL: http://www.medscape.com/viewarticle/5362802

[10] Anders Johansson. ”Mätarplattformen”. Date of access: 05/17. URL:


https://www.linkura.se/forskning

[11] Gustavo Lenis, Michael Kircher, Jesús Lázaro, Raquel Bailón, Eduardo
Gil, Olaf Doessel. ”Separating the effect of respiration on the heart rate variabil-
ity using Granger’s causality and linear filtering”. Biomedical Signal Processing
and Control 31 (2017) 272-287.

[12] Raphaël Giraud, Nils Siegenthaler, Denis R. Morel, Jacques-A Romand,


Laurent Brochard, Karim Bendjelid. ”Respiratory change in ECG-wave ampli-

56
tude is a reliable parameter to estimate intravascular volume status”. J Clin
Monit Comput (2013) 27:107–111.

[13] Frédéric Michard and Jean-Louis Teboul. ”Using heart-lung interactions


to assess fluid responsiveness during mechanical ventilation”. United States:
BioMed Central, 2000.

[14] Dana L.Frank, Lamees Khorshid, Jerome F Kiffer, Christine S Moravec,


Michael G McKee. ”Biofeedback in medicine: who, when, why and how?”.
United States: Radcliffe Publishing Ltd, 2010.

[15] Steven D. Ehrlich. Biofeedback. Date of access: 05/17.


URL: http://www.umm.edu/health/medical/altmed/treatment/biofeedback

[16] B. Friedman, J. Thayer. ”Autonomic balance revisited: panic anxiety


and heart rate variability”. Netherlands : Elsevier Science. ISSN: 0022-3999
(Print).

[17] M. Malik, T. Farrell., T Cripps, A. J. Camm. ”Heart rate variability in


relation to prognosis after myocardial infarction: selection of optimal processing
techniques”. United States: Oxford University Press, 1989.

[18] R. Aires, E.B. Pimentel, L. Forechi, E.M. Dantas, J.G. Mill. ”Time
course of changes in heart rate and blood pressure variability in rats with my-
ocardial infarction”. Associacao Brasileira de Divulgacao Cientifica.

[19] Li-Mei Liao, Salah S Al-Zaiti, Mary G Carey. ”Depression and heart
rate variability in firefighters”. SAGE Publishing, 2014.

[20] Guanghao Sun, Toshikazu Shinba, Tetsuo Kirimoto, Takemi Matsui.


”An Objective Screening Method for Major Depressive Disorder Using Logistic
Regression Analysis of Heart Rate Variability Data Obtained in a Mental Task
Paradigm”. Frontiers Media S.A., 2016.

[21] Pinterest. ”Diagram Of The Circulatory System For Kids”. Date of ac-
cess: 06/17. URL: https://www.pinterest.com/spiceroni/poster-of-circulatory-
systemcardiovascular-system/

[22] Anthony Atkielski. ”SinusRhythmLabels”. Date of access: 06/17. URL:


https://en.wikipedia.org/wiki/Electrocardiography

[23] Moody, G.B., and Mark, R.G. ”Development and evaluation of a two-
lead EKG analysis program”. Computers in Cardiology, 9:39-44. Long Beach,
California: IEEE Computer Society. 1982.

57
[24] Pinterest. ”parasympathetic vs sympathetic”. Date of access: 06/17.
URL: https://www.pinterest.com/pin/407998047466405011/

[25] Pinterest. ”12 Lead ECG placement”. Date of access: 06/17. URL:
https://www.pinterest.com/pin/268879040231161313/

[26] ResearchGate. ”A typical ECG signal showing the RR interval”. Date


of access: 06/17. URL: https://www.researchgate.net/figure/265461491f ig1A −
typical − ECG − signal − showing − the − RR − interval

[27] Marek Malik, Thomas J. Bigger, John A. Camm, Robert E. Kleiger,


Alberto Malliani, Arthur J. Moss, Peter J. Schwartz. ”Heart Rate Variabil-
ity - Standards of measurement, physiological interpretation, and clinical use”.
United States: Oxford University Press, 1996.

[28] HeartMath. ”Heart Rate Variability: An Indicator of Self-Regulatory


Capacity, Autonomic Function and Health”. Date of access: 06/17. URL:
https://www.heartmath.org/research/science-of-the-heart/heart-rate-variability/

[29] Jiapu Pan, Willis J. Tompkins. ”A Real-Time QRS Detection ALgo-


rithm”. IEEE Transactions on Biomedical Engineering, vol. BME-32, no. 3,
March 1985.

[30] Johansson A. ”Neural network for photoplethysmographic respiratory


rate monitoring”. Med. Biol. Eng. Comput. (2003) 41: 242. doi:10.1007/BF02348427.

[31] Rollin McCraty, Dana Tomasino. ”Heart Rhythm Coherence Feedback:


A New Tool for Stress Reduction, Rehabilitation, and Performance Enhance-
ment”. HeartMath Research Center, Institute of HeartMath.

[32] Spear J. F., Kronhaus K. D., Moore E. N., Kline R. P. ”The effect of
brief vagal stimulation on the isolated rabbit sinus node”. Circulation Research,
44. 75-88 (1979)

[33] Franz Hlawatsch, François Auger. ”Time-Frequency Analysis: Concepts


and Methods”. ISTE, 2008.

58
7 Appendix 1 - The app
In this section, a demonstration of the mobile application will be made. The
application was programmed in the platform Android Studio, targeting Android
devices with API version 19 and higher. The mobile phone used as debugger
was a Sony Xperia.
When opening the app, the user is given two options (shown in figure 39),
one option for starting the measurements and one for changing the settings.
The user is given orders to go to settings if no options have been selected before
starting the measurement.

Figure 39: Figure shows the main menu of the app.

The settings option is displayed in figure 40 below. Firstly, the user needs
to connect the app with an ECG device. This can be done in the ”Bluetooth
Connection” option. When this is done, the user can firstly set the duration
of the measurement. As for the graphs displayed during the measurement, the
user can choose if a beat by beat measure should be shown, and can choose
between beat to beat heart rate and R-peak amplitude signal. It is also possible
to be shown a stress measure, either RMSSD or heart rate can be chosen here.
For the stress measures, a calculation window has to be set, which corresponds
to the amount of minutes for which the stress measures will be calculated for.

59
In addition to these graphs, it is possible to add a breathing exercise ani-
mation to the measurement, and what the breathing frequency of this exercise
should have in breaths per minute. Relaxed music can also be enabled for the
measurement.

Figure 40: Figure shows the settings menu of the app.

In the ”Bluetooth Connection” option, seen in figure 41 below, the user can
scan for near BLE devices by hitting the ”Scan” button. If Bluetooth is not
enabled on the phone, the user will be asked to turn it on before scanning. BLE
devices which are detected will then be shown in a list below. The list will
consist of the names, addresses and RSSI values of all near devices. The RSSI
value is a value describing the signal strength, where 100 would be a perfect
signal. By clicking on one of the devices, the app will try to connect to it. The
user will get an announcement when the connection has succeeded.

60
Figure 41: Figure shows the Bluetooth menu of the app.

When the settings have been configured, the user can go back to the main
menu and choose to start the measurement. Depending on what the user has se-
lected in the settings, the screen displayed during the measurement might vary.
Figure 42 below shows a measurement with the settings to show beat to beat
R-peak Amplitude, together with a breathing exercise of 6 breaths per minute.
One figure is taking during inhalation and one during exhalation. Following this
is figure 43, showing a measurement with the settings to show beat by beat heart
rate together with the stress measure RMSSD, taken for every 5 minute period.
Worth mentioning for the stress measures is that they start calculating after 5
registered heartbeats for the values they have up until the chosen window length.

61
Figure 42: Figures taken during measurement in the app, showing beat to beat
R-peak Amplitude together with a breathing exercise of 6 breaths per minute.

Figure 43: Figure taken during measurement in the app, showing beat by beat heart
rate together with RMSSD stress measure. Here, the duration of the measurement
has ended.

In the top part of the screen, there is a ticking clock showing the remain-
ing time of the measurement. In the bottom part of the screen, there are two

62
options, one to go back to main menu and one to stop the measurement. Go-
ing back to main menu without saving the data means losing all data from the
measurement. If the user presses the stop button, or when the time of the mea-
surement has run out, the stop button will change into a save button. Here, it
is possible to save the beat to beat heart rate and R-peak amplitude signals.

Figure 44 below shows a block diagram describing the structure of the coding.

Figure 44: Block diagram showing the structure of the coding.

As can be seen from the block diagram, the code consists of four main activi-
ties; Main, Settings, BLE, and Real Time. The BLE activity had help functions
with scanning, listing, and properties of devices. When a connection was made
to a device, a new ”Gatt” was created which constantly was being updated with
information from the device. From the Gatt, the connection status and the in-
formation gathered from the BLE device were kept in separate functions which
could be accessed from other activities. In addition to these functions, some
often used commands were stored in ”Utils”, which also was accessible for all
activities. Lastly, the Real Time activity also had a help function called Graph
Handler. This function handled the interface of the measurement, depending
on what was chosen in the settings menu.

63

You might also like