Extraction and Analysis of Respiratory Motion Using Wearable Inertial Sensor System during Trunk Motion

Respiratory activity is an essential vital sign of life that can indicate changes in typical breathing patterns and irregular body functions such as asthma and panic attacks. Many times, there is a need to monitor breathing activity while performing day-to-day functions such as standing, bending, trunk stretching or during yoga exercises. A single IMU (inertial measurement unit) can be used in measuring respiratory motion; however, breathing motion data may be influenced by a body trunk movement that occurs while recording respiratory activity. This research employs a pair of wireless, wearable IMU sensors custom-made by the Department of Electrical Engineering at San Diego State University. After appropriate sensor placement for data collection, this research applies principles of robotics, using the Denavit-Hartenberg convention, to extract relative angular motion between the two sensors. One of the obtained relative joint angles in the “Sagittal” plane predominantly yields respiratory activity. An improvised version of the proposed method and wearable, wireless sensors can be suitable to extract respiratory information while performing sports or exercises, as they do not restrict body motion or the choice of location to gather data.


Introduction
The accurate measurement and monitoring of physiological parameters plays an essential role in a broad range of applications in the field of healthcare, psycho-physiological examinations, and sports training. Respiration rate as a physiological parameter is usually measured when the subject is at rest, counting the number of breaths per minute by counting the number of times the chest expands. Respiration rate as a vital sign is affected by exercise. Exercise increases the rate at which energy is needed. It increases the need for oxygen in the body. During exercise, the heart speeds up to pump extra food and oxygen to the muscles. Breathing speeds up to get more oxygen and to get rid of more carbon dioxide. Calorie expenditure during exercise can be estimated by measuring the ventilation and the exchange of oxygen and carbon dioxide by the body. There is substantial evidence that an abnormal respiratory rate is a predictor of potentially serious clinical events. Monitoring respiration rate is therefore of interest not only for assessment of medical conditions, but also monitoring the intensity of exercise and calculating the calorie expenditure. Monitoring respiration rate during exercise specifically when the body trunk is moving is the focus of this article.
It has been reported in a recent study conducted by Harvard Health School [1] that gentle stretching and strengthening of back and abdominal muscles can reduce lower back pain. Such exercises build strong and flexible muscles that are less prone to injury, pain, strains, and sprains [1]. Trunk stretching exercises are performed to maintain a flexible trunk to make it less vulnerable to injury and sprains. These exercises often restore the normal range of motion of the trunk. Stretching is also known to improve balance by preventing falls and impart relief from arthritis, knee pain, and so forth [2][3][4]. Stretching becomes an essential and integral part of life. Further, stretching and yoga can consume a significant number of calories depending upon the BMI (body mass index) and duration of exercise [5]. Trunk motion information can be used to derive an accurate estimation of calories burned while exercising. Thus, real-time monitoring of exercise motions including lateral flexion (sideward bending), forward bending (flexion), backward bending (extension) and rotation (twisting) would be valuable.
Time-dependent assessment of respiratory motion is useful in exercise or clinical applications. Koch and Dietzel provided a unique 6 × 6 sensor array for curvature sensing in the format of a thin, flexible polyimide foil for respiratory monitoring of premature infants by directly attaching it to the skin [6]. Also, a respiratory plethysmography is employed to determine the changes in chest volume to monitor breathing using a flexible sensor [7]. In a study performed by Gollee and Chen, a single IMU (inertial measurement unit) placed on the abdomen was used to detect breathing motion when the body is motionless [8]. However, when the trunk was in motion, the movement was reflected as respiratory action. Measuring respiration with a single IMU when the body moves is difficult, as the body trunk motion obscures the breathing motion. Thus, there is a need to decompose the respiration motion from the overall fused, unified or integrated motion irrespective of heterogeneity or complexity of the trunk movement. This paper proposes a novel method to resolve this issue using a two IMU sensor systems to extract the respiratory motion. The effect of coughing on the respiratory action has also been studied in this research. The proposed sensors system may also help to detect coughing episodes to quantify exercise-induced asthma [9].
The research put forth in this article makes use of a pair of wireless IMU sensors placed at specific locations on the human trunk so that respiratory motion can be extracted while performing trunk motion. These sensors are custom-made by the authors at San Diego State University [10]. The sensor is small, wearable, and wireless with a built-in (on-chip) recharging module [10]. This study applies the principles of robotic kinematics, using the Denavit-Hartenberg convention [11] to extract relative motion [12] between the two IMU sensors. The method decomposes the motions experienced by the two IMUs into trunk movements and breathing actions. The concept used here spans several daily applications, apart from diagnosing abnormalities, such as monitoring respiration while exercising. Further analysis of the breathing signal can yield respiration rate, which can be used to calculate calories burned indirectly.

Materials and Methods
The material requirement of this research is a pair of IMU sensors to create a network of joints and links that can mimic a three-dimensional (3-D) robot model of a portion of the human trunk. The wireless motion sensor developed in this study uses a nine-axis motion processor from InvenSense (MPU9250, InvenSense, San Jose, CA, USA) and a system-on-chip (SoC) from Nordic Semiconductor (nRF51822, Nordic Semiconductor, Oslo, Norway). Each wearable sensor node (3 cm in diameter and 0.2 cm thick) is wirelessly connected to an Android application (Figure 1). Biocompatible adhesive tapes are used to accurately secure these sensors in the designated areas in the trunk. An Android device acts as host receiver to the data transmitted by these sensors [10]. The Android device must be Bluetooth 4.0 enabled and must have the data collection or sensor configuring host application installed to allow collection of data in the receiver [10]. A MATLAB program was developed for required mathematical calculations. A crucial part of this research was the selection of the location for sensors placement. Three criteria were followed in choosing the location: (1) IMU 1 (Sensor A) should majorly detect trunk motion (with minimal or no respiratory motion); (2) IMU 2 (Sensor B) should experience both trunk and respiratory action, and; (3) the trunk motion experienced by both the sensors must be of the same amplitude (or range). As there are two regions on the trunk that can provide information on respiratory motion, namely, the chest and abdomen, the range of motion of trunk at these levels was analyzed.
The trunk motion was considered to be analogous to vertebral movement, and hence the range of motion of spine was studied at chest and abdomen levels. The chest region falls in front of the upper thoracic curve, and the abdomen falls in front of the lumbar curve (after thoracic), which is two of the five regions of the spine/vertebra. The range of motion of spine at both these curves is different depending on the movement performed. In the case of flexion, extension and lateral flexion (sideward sway), the lumbar vertebral region moves more than the thoracic region, causing the chest to move more than the abdomen.
Based on these criteria, the sensors are placed on the chest and the posterior side of the chest. Figure 2 shows this sensor placement in standing position/posture. The orientation of both the sensors is maintained equally. The reason for this arrangement is the presence of external intercostal muscles under the rib cage, which provides maximum force during respiration [13]. As a result, these muscles serve as a good indication of breathing.  A crucial part of this research was the selection of the location for sensors placement. Three criteria were followed in choosing the location: (1) IMU 1 (Sensor A) should majorly detect trunk motion (with minimal or no respiratory motion); (2) IMU 2 (Sensor B) should experience both trunk and respiratory action, and; (3) the trunk motion experienced by both the sensors must be of the same amplitude (or range). As there are two regions on the trunk that can provide information on respiratory motion, namely, the chest and abdomen, the range of motion of trunk at these levels was analyzed.
The trunk motion was considered to be analogous to vertebral movement, and hence the range of motion of spine was studied at chest and abdomen levels. The chest region falls in front of the upper thoracic curve, and the abdomen falls in front of the lumbar curve (after thoracic), which is two of the five regions of the spine/vertebra. The range of motion of spine at both these curves is different depending on the movement performed. In the case of flexion, extension and lateral flexion (sideward sway), the lumbar vertebral region moves more than the thoracic region, causing the chest to move more than the abdomen.
Based on these criteria, the sensors are placed on the chest and the posterior side of the chest. Figure 2 shows this sensor placement in standing position/posture. The orientation of both the sensors is maintained equally. The reason for this arrangement is the presence of external intercostal muscles under the rib cage, which provides maximum force during respiration [13]. As a result, these muscles serve as a good indication of breathing.

Kinematic Equations and Mathematical Components
The data obtained from an IMU sensor is converted to Euler angles (more specifically, Tait-Bryan angles) [14]. Here, φ is roll, which portrays rotation around the local/sensor x-axis, θ is pitch denoting rotation around the y-axis, and ψ is yaw representing the rotation around the z-axis of a sensor (as seen in Figure 2b). Each quaternion (with four quantities) gives a set of Euler angles (having three quantities). These Euler angels are substituted into the following matrix in the sequence roll-pitch-yaw to obtain a rotation matrix [14]. to move more than the abdomen. Based on these criteria, the sensors are placed on the chest and the posterior side of the chest. Figure 2 shows this sensor placement in standing position/posture. The orientation of both the sensors is maintained equally. The reason for this arrangement is the presence of external intercostal muscles under the rib cage, which provides maximum force during respiration [13]. As a result, these muscles serve as a good indication of breathing.  Both the physical joints are imaginary. Physical Joint I is located at the hip (hip joint), and Physical Joint II is located on the back (posterior side), just below the neck. Each physical joint has 3-DOF (degree-of-freedom) (three joints are combined to form each Physical Joint) imparting the robot system a total of 6-DOF. Links 1 and 2 are also imaginary and connect Physical Joint I to Physical Joint II, and Physical Joint II to Link 2 end-effector, respectively. Sensor A is placed at the end of Link 1 just before the Physical Joint II and, thus, it gives the orientation of Link 1 with respect to the global frame. Sensor B is placed at the end of Link 2 just before the Link 2 end-effector, and it gives the orientation of Link 2 with respect to the global frame. θ 1 , θ 2 , θ 3 are the angles that Link 1 makes with the base frame (Frame 0) of the robot model that will be introduced ahead. θ 4 , θ 5 , θ 6 are the angles that Link 2 makes with Link 1 and are found to provide the respiratory information; (b) The orientation of both sensors: 'Roll' is the rotation around "x-axis," "pitch" around "y-axis" and "yaw" around "z-axis" of the sensor coordinates. All rotations follow anticlockwise-positive convention.
This matrix corresponds to ZYX rotation sequence of Tait-Bryan angles [14], where "c" stands for cosine and "s" stands for sine of the respective Euler angle. The Euler angles and rotation matrices are found for both the sensors separately; these give the orientation of each sensor with respect to the global coordinate frame.
Homogeneous transformation matrices are 4 × 4 matrices containing a (3 × 3) rotational matrix in the upper left corner, which gives the orientation information, a (3 × 1) column vector in the upper right corner that gives the positional (or translational) information. Thus, a homogeneous matrix provides the "pose"-position and orientation information. Figure 3 shows the Denavit-Hartenberg (D-H) Convention [11] to assign right-handed frames to links connecting two joints. The D-H algorithm is used to derive forward kinematics [11] to find the position and orientation of end-effector of a robot when all the joint angles are known. The 3-D robot geometry consists of two physical-joints each having three degree-of-freedom (DOF). Thus, imparting the entire system a total of 6-DOF. The origins of Frame 0, 1 and 2 coincide to form a fused Physical Joint I. Similarly, the origins of Frame 3, 4 and 5 correspond to produce a fused Physical Joint II. All the theta angles in the model follow the anticlockwise-positive convention. Following the D-H Convention, link parameters or D-H parameters [11] are derived, as shown in Table 1. We consider d 3 and d 6 to be 43 cm and 6.12 cm, respectively, from the study of Ratnovsky and Elad [13]. α i is an angle about common normal, from old z-axis to new z-axis. However, the parameter is well known in Denavit-Hartenberg convention. Currently, this research mainly concentrates on the orientation aspect of the two sensors or links of the devised 3-D robot model.
Here, "s" stands for sine and "c" stands for cosine of the respective angles. Equation (4) is the general form of homogeneous transformation matrix that varies with each link based on the D-H parameters of that link. Here, "s" stands for sine and "c" stands for cosine of the respective angles. Since the model distinctly consists of two physical links and joints, each having three rotational joints, the number of transformation matrices can be reduced from six to two, as follows:   The four parameters of each link give a homogeneous transformation matrix A i . Thus, six homogeneous transformation matrices are obtained. T 0 n = A 1 . . . A n gives the position and orientation information of robot's end-effector (Frame n) in base frame (Frame 0), that is, the transformation or mapping of Frame n in Frame 0. T 0 n is of the form of a homogeneous transformation matrix. As per D-H convention law, every A i can be represented as a product of four basic transformations [11] as shown below: Here, "s" stands for sine and "c" stands for cosine of the respective angles. Equation (4) is the general form of homogeneous transformation matrix that varies with each link based on the D-H parameters of that link. Here, "s" stands for sine and "c" stands for cosine of the respective angles.
Since the model distinctly consists of two physical links and joints, each having three rotational joints, the number of transformation matrices can be reduced from six to two, as follows: where c 1 , c 2 , c 3 , c 4 , c 5 , c 6 stand for cos (θ 1 ), cos (θ 2 ), cos (θ 3 ), cos (θ 4 ), cos (θ 5 ), cos (θ 6 ) and s 1 , s 2 , s 3 , s 4 , s 5 , s 6 are sin (θ 1 ), sin (θ 2 ), sin (θ 3 ), sin (θ 4 ), sin (θ 5 ), sin (θ 6 ), respectively. Here, T 0 3 is the mapping of Frame 3 in Frame 0 and T 3 6 is mapping of Frame 6 in Frame 3. The global homogeneous transformation matrix T G 0 is assumed to be an Identity matrix. As in this research, only the rotational part of the 4 × 4 homogeneous transformation matrix is considered, as per the model geometry and theoretical knowledge, rotation matrix obtained from Equation (1) for both the sensors A and B are equivalent to the rotational part of T 0 3 and T 0 6 , or analogously T G 3 and T G 6 , since T G 0 is an identity matrix, that is: The forward kinematic equation to obtain the end-effector (Frame 6) orientation in/with respect to base frame (Frame 0) is given as follows: Rearranging the above equation to get orientation of sensor B with respect to sensors A or equivalently the orientation of Frame 6 with respect to Frame 3: where T 0 6 is the initialized version of T 0 6 (original) . The initialization of rotation matrix obtained from sensor B is done in order to perfectly align sensor B (T 0 6 ) with sensor A (T 0 3 ) in the mid-sagittal plane. To initialize T 0 3 (original) and T 0 6 (original) , the following operations as described in Equations (13) and (14) are performed as follows: Next, inverse kinematic equations [11] are used to find out all robot joint angles when the end-effector orientation (rotation matrix) is known. Hence, joint angles are extracted from rotation matrices (orientation information) T 0 3 and T 3 6 ; where both are known, T 0 3 is directly obtained from sensor A and T 3 6 is obtained from the mathematical calculation described in Equation (12), which gives the relative orientation [11] of sensor B (Frame 6) with respect to sensor A (Frame 3). First, by applying inverse kinematics to T 0 3 , joint angles θ 1 , θ 2 , θ 3 that Link 1 makes with respect to robot model (Frame 0) are obtained.

Experimental Results
This section provides a discussion of the experimental results obtained in this research. Figure 4 presents a reference measurement of the respiratory activity; the airflow at the mouth and nose was measured using a spirometer that is a standard instrumentation for respiratory monitoring.

Experimental Results
This section provides a discussion of the experimental results obtained in this research. Figure 4 presents a reference measurement of the respiratory activity; the airflow at the mouth and nose was measured using a spirometer that is a standard instrumentation for respiratory monitoring. . A reference measurement of the respiratory activity, the airflow at the mouth and nose was measured using a spirometer [8].
An experimental protocol was followed while collecting the data in the described sensor placement. All the experiments were performed in the standing posture. The protocols include trunk motion during performing normal breathing interspersed with coughing episodes to mimic abnormal breathing. Coughing induces pattern variation in respiratory sinusoidal wave and creates specific patterns in breathing activity graph. The experiments performed are summarized in Table 2. Experiment I is the standard case showing normal breathing pattern with bend-extend trunk motion. Experiment II includes a single cough pattern that is mimicked after normal breaths.   . A reference measurement of the respiratory activity, the airflow at the mouth and nose was measured using a spirometer [8].
An experimental protocol was followed while collecting the data in the described sensor placement. All the experiments were performed in the standing posture. The protocols include trunk motion during performing normal breathing interspersed with coughing episodes to mimic abnormal breathing. Coughing induces pattern variation in respiratory sinusoidal wave and creates specific patterns in breathing activity graph. The experiments performed are summarized in Table 2. Experiment I is the standard case showing normal breathing pattern with bend-extend trunk motion. Experiment II includes a single cough pattern that is mimicked after normal breaths.  Figure 5 shows the experiments involving normal breathing with bend-extend trunk motion.    Figure 6 shows an experiment involved abnormal breathing (a single cough) with no trunk motion.

Cough-Motion
Sensors 2017, 17, 2932 9 of 11 Figure 6 shows an experiment involved abnormal breathing (a single cough) with no trunk motion.

Discussion and Conclusions
This research aimed at eliminating the influence of body motion on breathing motion. The proposed mathematical algorithm and sensor placement are successful in extracting the breathing signals from a fused set of data containing trunk and breathing motion. In this paper, the ribcage joint angles from sensors A and B (decomposed chest motion with respect to dorsal chest position) in the "Sagittal" plane shows breathing signals. It is worth noting that corresponding Euler angles of the two sensors must be similar in pattern as well as magnitude to ensure precise and accurate extraction of respiratory motion in one of the relative joint angles. Dissimilarities between the two are reflected in the relative angles, and therefore degrade respiratory information.
The proposed sensor placement gives promising results. The results also show that human trunk does always perfectly sway while performing sway motion. Instead, it may tend to show some additional movement in bending or twisting simultaneously. The IMU device used for this study is small, light-weight, wearable and wireless with a long battery life. This design makes it an excellent choice for long-term data collection while performing mild trunk-stretching exercises like yoga or other body activities without causing hindrance or restriction of body motion. These findings can be used in future research to invent technologies with contemporary requirements that include devices using wearable IMUs to record real-time breathing motion during day-to-day activities, especially useful for elderly and for people suffering from panic attacks, Parkinson's disease, Alzheimer's, and so on, whose movements and breathing need to be monitored. This technology can also be advanced further for the real-time detection of asthma attacks, which are often accompanied by shortness of breath and coughing. Additionally, apnea (central sleep apnea) and SIDS (sudden infant death syndrome) diagnosis and detection can be made more accessible in real time by using an improvised version of this technology.
Overall, this technique can be extended to several domains to find use in many future applications. Though this research works well with data from one individual, it should be tested on a larger sample size to make it a generalized study, which can be universally accepted. Data can also be collected using commercially available IMUs to check the validity of the data obtained in this study. In future, more IMUs can be recruited to form a network of IMUs to model the desired body region to be studied. Overall, this research proves to be a promising step towards using and further enhancing the presented concept. In summary, this paper presents a novel method to approach the problem of breath detection by fusing the information deriving from two different IMUs placed on the anterior and posterior side of the chest (sternum and spine). Further, the method can be improved by including one more IMU placed on the abdomen to cover the abdominal breathing, and also provide a method for globally evaluating the breath activity.