Stress Determent via QRS Complex Detection, Analysis and Pre-processing Wilhelm Daniel Scherz, Juan Antonio Ortega, Ralf Seepold and Natividad Martínez Madrid Abstract Stress is recognized as a predominant disease with raising costs for rehabilitation and treatment. Currently there several different approaches that can be used for determining and calculating the stress levels. Usually the methods for determining stress are divided in two categories. The first category do not require any special equipment for measuring the stress. This category useless the variation in the behaviour patterns that occur while stress. The core disadvantage for the category is their limitation to specific use case. The second category uses laboratories instruments and biological sensors. This category allow to measure stress precisely and proficiently but on the same time they are not mobile and transportable and do not support real-time feedback. This work presents a mobile system that provides the calculation of stress. For achieving this, the of a mobile ECG sensor is analysed, processed and visualised over a mobile system like a smartphone. This work also explains the used stress measurement algorithm. The result of this work is a portable system that can be used with a mobile system like a smartphone as visual interface for reporting the current stress level. W.D. Scherz (&)R. Seepold HTWG Konstanz, Brauneggerstr. 55, 78462 Konstanz, Germany e-mail: [email protected] URL: http://uc-lab.in.htwg-konstanz.de R. Seepold e-mail: [email protected] URL: http://uc-lab.in.htwg-konstanz.de J.A. Ortega Universidad de Sevilla, Avda. Reina Mercedes s/n, 41012 Seville, Spain e-mail: [email protected] URL: http://www.us.es N.M. Madrid Reutlingen University, Alteburgstr. 150, 72762 Reutlingen, Germany e-mail:
[email protected] URL: http://iotlab.reutlingen-university.de
Nowadays stress is regarded as a negative sensation and is recognized as a predominant disease [1] because of an overabundance of stress in modern life. Overabundance of high stress levels can cause erratic response to physical, emotional or mental demands [2,3]. Back to the beginning of human history, stress has developed as a natural reaction that allowed primitive people to evaluate the situation and to act in the most effective way when they were confronted to dangerous situation. Stress triggers biological mechanism that reorganises the work of the organism depending on the priorities in order to reach high performance. That leads to the increase of physical capacities and performance in dangerous situation, in other words a fight or flight response. Among the consequences of stress for modern society are the increasing amounts of people who face severe and irreversible long-term limitations like burnouts, cardiac problems like myocardial infarction, etc. This leads to increasing costs of treatment and healing for people that are suffering from high levels of stress. By modern people stress usually appears as a result of the exposure of high demands and pressure in daily life, both mental and physical [4], e.g. constant decision taking demands or constant time pressure. Currently stress has become permanent and as result it leads to different disorders. A good example of the consequences of overabundance of stress caused by overwork are fatigue, sleep problems, etc. [5]. Stress can be created or induced in a laboratory using special exercises like the Trier tests [6], the Stroop color word test [7], etc. Some symptoms of stress are shown in Fig. 1. Lifestyle, technologies and culture made significant changes in our lives but the reaction of our body to stress remains the same. Fig. 1 Symptoms of stress and their physical responses 1 Introduction
In case of danger and thread, processes of preparing the body for fight or flight are activated. Brain starts to release hormones like cortisol and adrenaline; this increases the performance of organs that are vital for surviving and saves resources by reducing the activity of organs that are not vital for surviving a dangerous situation. The following steps are important and useful for surviving and responding effectively to dangerous situations by increasing the blood flow to bring more oxygen to muscles (the heart rate increases); the pupils are dilated to give a better view; etc. The systems that are not necessary for surviving in a dangerous situation are genitourinary system, digestion, hearing, peripheral view, etc. It is very important to define an objective way for determining stress because of the subjective perception of stress. This is one of the main challenges and one of the reasons why stress is sometimes underestimated, underrated. Some people demonstrate clear indications of stress, others do not notice when they pass the threshold of just ‘being busy’to high stress level [8]. In our approach we use the electrical characteristics of the heart and the influences caused by stress. The system used for the detection incorporates a portable hard/software platform that can host different algorithms and sensors for calculation of the biological parameters. The platform also provides connectivity to a body area network and supports professional online analysis. The user of the system is constantly continually informed about his state enabling him to take decisions based on it. This research is based on our previous studies and models for stress measurements technologies [3,9]. 2 State of the Art Most of the approaches that tries to calculate stress can be divided in three categories like approaches that do not require sensors, approaches with sensors and approaches with laboratory environment. The approach that do not require sensors uses known behaviour patterns. They analyse the difference between normal behaviour and the behaviour of a stressed person. An example of this are [10,11], they examine the difference between typing in normal situation and under stress. As a disadvantage of this approach can be mentioned difficulty of its applicability in multiple environments. Stress detection in this case is context-based and not human-centred. The second kind of approaches uses different external sensors. For example [12], they measure the stress while driving. The sensors used for monitoring are an electrocardiogram (ECG), an electromyogram (EMG) that records the electrical activity of the muscles, a SC (Skin conductivity), a breath sensor and a video camera pointing at the driver. Because of the big amount of data the measurements are analysed offline, after recording. The main disadvantage is the huge amount of collected data, the need for offline analysis and the reduced degree of freedom and comfort caused by the different senor wires.
The third approach uses laboratory equipment. The results provided using this method are the most precise of all. For determining stress with this method the amount of cortisol, adrenaline and other hormones in the body and the amount of saliva are measured giving a direct hint to the stress level [13]. The biggest problems by this method are that the results are not available in real-time, the method is invasive and the equipment is expensive and not mobile. The developed approach considers the main advantages and disadvantages from the methods researched. Our approach uses a low-cost ECG that is compact, wearable, and non-invasive. Another important quality is the real time capabilities that make it usable in different contexts. 3 System Architecture Figure 2describes the architecture of the system that is used in the approach to collect biometric data. As mentioned before, a low cost ECG sensor is used to capture continually the biological data. The ECG sensor computes the signal obtained from the electrodes that are placed on the skin of the test person. The output from the ECG sensor is an analogue signal that contains the electrical characteristics of the heart. The output of the ECG is digitalised by an analogue digital converter from the microcontroller that will process the data. The processed data is then delivered to a digital IO interface (digital stream) like a Bluetooth or a serial interface. After this the obtained data is analysed, the heart rate (HR) and the RR Interval (the RR interval is defined as the interval between two R-peaks. See Fig. 3) derived from a QRS complex 1 are extracted. Later on the heart rate and the RR intervals are used to detecting stress. As visualisation and storage of the data and the results a smartphone is used, as well as for the future analysis of the data could be used an external memory card or network. 4 Stress-Detection Method Our method for stress detection provides a real time analysis using an ECG sensor. The signal obtained from the ECG is normally used for diagnostics proposes [14] but it also has unique data that can be used for example for identification of different subjects using the electrical characteristics of the heart [15]. As mentioned before in Fig. 1, stress has a direct impact on the heart rate (HR). The approach that we used for this work, analyses the ECG signal and calculates the 1 QRS complex: Name for the combination of three of the graphical deflections can be seen on a typical electrocardiogram (ECG).
HR and RR intervals from a QRS complex obtained from ECG. The RR interval that was calculated before (see Fig. 3) is used for calculating the Heart Rate Variability (HRV). The HRV contains useful data about the stress. The RR interval represents the duration between two heartbeats. The HRV is the variability between two heart beats. The difference between the heartbeats is modulated by the breathing rhythms. In [16] the relation between the heartbeats and respiration is described. Knowing the characteristic, that the HRV is modulated by the respiratory sinus, we can assume that the variance between beats behaves equal and periodically, in case that a person is not stressed. In case that a person is stressed the variation becomes bigger and irregular. Figure 3is normalised in the Y-axis over a range from 0 to 350 mv (1) and the X-axis shows the time in 10 2 ms (2). 0Y350;ð1Þ x0;ð2Þ RRinterval ¼RiRi1;ð3Þ To enable an efficient detection of R-peak, we define that the current value Rjhas to be higher than 200 mV (4). Fig. 2 System architecture for collecting, processing and visualising of biological data Fig. 3 Definition of an RR interval in a QRS segment
Rj[200 mV;ð4Þ Also the current Rjvalue has to be a maxima (5). Only if this condition is fulfilled, the Rjis an R-peak from a QRS complex. ðRj1\RjÞ^ðRj[Rjþ1Þ! Then Ri¼Rj;ð5Þ When the conditions (4) and (5) are fulfilled an R-peak (5) has been successfully detected. After two consecutive R-peaks has been detected, the duration of the RR interval can be calculated by calculating the time between the two R-peaks (3). After the RR intervals are calculated, we analyse the HRV and we auto correlate the HRV values. When the results of the autocorrelation are visualised in a two-dimensional plot like in Fig. 4we obtain a so called correlation plot. The X and Y axis are defined as (6) and (7). A concentration of v with low spreading around the axis indicates a low stress. If the values are widely spread, it means that the person is under stress. X¼fRRig;ð6Þ Y¼fRRiþ1g;ð7Þ The total variability can be expressed as the product of SD1(8) and SD2(9). Fig. 4 Poincaréplot that shows variance between the RR intervals and the self-similarity of the values
SD1¼ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi varðx1Þ pwhere x1¼xnxnþ1 ffiffiffi 2 p;ð8Þ SD2¼ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi varðx2Þ pwhere x2¼xnþxnþ1 ffiffiffi 2 p;ð9Þ Current/individual variance of the RR interval is calculated using the standard derivation like in (10). r¼1 n1X n i¼0ðxi xÞ2! 1 2 ;ð10Þ 5 Experiment As method for inducing stress we decided to use the Stress Test (TSST) [6] because it is the most classical method for inducing stress in laboratory conditions. As second method for inducing stress we used a driving simulator (video game) that generates variable levels of stress by increasing the difficulty level over the time. We adapted the TSST. The TSST that we used consists as the normal TSST of three phases. The anticipation period is where the person has to prepare a random topic that has to be presented. The second phase, the person has to do a presentation in English language (English is not the mother language of the person). The last phase is the cool down, here we tell the person it was only a test. Every phase takes 5 min. The driving simulator employed in the experiment consists of two parts: a point reward system and an increasing difficult level system. The person receives a reward for fast, complex driving scenarios and the duration of the manoeuvre. With the increment of points the difficulty increases also. If he crashes or makes mistakes he loses all the point he has collected until now. All the participants of the test were aged between 23 and 28, none of them were smokers or had alcohol problems. The methods used in this work assume that none of the candidates suffered from cardiac problems or mental anomalies and used pacemaker. 6 Results The collected data from experiment was visualized using the proposed concept for stress detection. Heir we compare the results of two persons that where summited to the tests. As special characteristics, the first person has a lower heart rate but is stressed. The second person has a higher heart rate but is not stressed. Both datasets have the same length.
In Figs. 5and 7the autocorrelation of the heart rate intervals is shown. In Figs. 6 and 8the heart rate variance as a function of time is shown. In Fig. 4the auto correlation in stress was introduced. Clear visible is that the values are wide spread. The reason for the spreading of the values is the variation of the breathing and heart rate in stressful situation. It is observable that most of the values are between 0.7 and 0.9 s for the RR interval, this means that the interval for the heart rate is between 66.7 and 85.7 bpm. The Fig. 6shows the irregularities in the heartbeat. It can be interpreted as indicator for stress because normally, except of illness, the signals behave regularly (cyclical) and similar to the breath sinus. The Fig. 7shows the values of a person who has a higher heart rate but is not under stress. Contrarily the person is very calm and relaxed. The RR interval is between 130 and 85 bpm. It is obvious that the values are close to each other and are not spread. The Fig. 8shows that the variation in the heartbeats is lower. In this case the variation between the heartbeats is lower because the person is calm and breaths regularly. Fig. 5 Candidate under stress and with low pulse Fig. 6 Heart rate variance (HRV) visualisation a not uniform signal of a stressed candidate
7 Conclusions The concept presented in this work shows a possible algorithm for estimating the stress using the correlation and HRV. The system is designed to be real time capable of monitoring stress, it is also cheap and wearable. The results of this experiment shows that the stress can be detected with independent of biological conditions lower or higher heart rate. The current prototype can be connected to different systems like PCs or smartphones for calculation and visualisation proposes. An important characteristic of the algorithm for stress detection is a small footprint. The algorithm can also be deployed in a small prototyping board. For this work an Arduino Uno 2 was used as deployment target. While another test that was conducted the test person was wearing the system while sport activities. We have big problems in making Fig. 7 Candidate with higher heart but not in stress Fig. 8 HRV visualisation of not stressed candidates 2 http://arduino.cc.