The autonomic nervous system (ANS) of the human body is always controlled for homeostasis and maintains life autonomously. In general, ANS is controlled by many hormones unconsciously; it is often affected by forced breathing. The respiration during exercise is a typical example. Appropriate and regular respiration during exercise can help partly control the heartbeat; it may have an effect on exercise sustainability during aerobic exercise. In particular, for muscular exercise, using wrong breathing habits can easily cause pulmonary or muscular injuries; in addition, muscular exercise controlled by appropriate breathing helps effectively transfer the load on the muscle. Thus, a real-time respiration monitoring is important to studying safe and effective exercise methods.
Initial research on indirect respiratory extraction was mainly conducted during sleep or static states and was based on biosignals. These methods were aiming to monitor breathing in a rest state or to detect apnea, so they were limited by the environment. Some researchers then tried to improve the quality of respiration signal by using physical sensors (accelerometers, etc.) for more stable and accurate respiration detection. However, there have been no attempts to extract a respiration signal in various fields of exercise, including dynamic environments such as running or muscular exercise, despite its important.
Existing studies have shown that it is very important to monitor and analyze respiration signals in many fields such as medicine and exercise physiology [1, 2]. There are two common approaches to respiration monitoring: direct and indirect measurement methods . Direct measurement methods can provide a great deal of information on the respiration status and pulmonary functions; however, these methods have spatiotemporal limitations and are difficult to use for monitoring individual respiration signals during exercise because of their high cost. Therefore, studies have attempted to estimate respiration signals more accurately using indirect methods with multi biosignals such as electrocardiogram, blood pressure and photoplethysmography. The electrocardiogram derived respiration (EDR) method, which a representative indirect method, has high accuracy in estimating the respiration rate; however, it is limited in that it is difficult to provide a synchronized signal with inspiration and expiration in real-time [4, 5]. Therefore, presently, research effort is focused on the acquisition of high-quality data through improvements to existing methods [6, 7].
To the best of our knowledge, lately, attempts to estimate the respiration signal using physical signals have moved away from biosignals. Typically, previous studies have been based on an accelerometer, which can detect a respiration signal using the thoracic angle variation caused by respiration. However, these studies mainly examined topics such as apnoea detection or respiration monitoring at rest [8, 9]. Furthermore, this approach is relatively weak with regard to motion artifacts because the accelerometer signal caused by respiration is small; thus, there have been no attempts to estimate and monitor respiration signals in real-time in a dynamic environment such as high-intensity exercise.
Although one study reported the use of post-signal processing such as principle component analysis (PCA) by fusing the accelerometer’s three axes, it is difficult to quantify the extent of improvement achieved by doing so. This is because the study in question omitted another accelerometer-based respiration estimation method based and the verification process used a reference device based on a completely different method . Another study reported an estimation method that reconstructed the angular motion of the accelerometer signal generated by respiration, but the researchers noted that their estimation method, which had a single accelerometer, was weak with movement; therefore, they only tested it in a static environment . Mann et al. suggested a respiration estimation method but only used the accelerometer while the subject was walking (maximum 4 mph) on a treadmill. They confirmed the high correlation with the respiration rate, but failed to detect an asymmetrical respiratory signal. Thus, they stated that their method is difficult to apply to dynamic exercises such as interval training .
In this study, we tried to overcome the limitations of using a single accelerometer by using a Kalman filter to fuse an accelerometer and a gyro sensor attached to the precordial region, which has relatively few motion artifacts during exercise. We developed the module to be available during dynamic exercise including aerobic and muscular exercises. Aerobic exercise is made up of interval training using treadmill at a maximum speed of 9km/h. Muscular exercise is made up of shoulder press and leg press. We acquired the fine horizontal angles of the thorax as it varies by respiration during those exercises and estimated the respiration signal from those signals. We tried to verify the effectiveness of our method by comparing with an existing method that uses a single accelerometer based on the respiration signal measured with a belt-type piezoelectric sensor simultaneously.
2. Definition of Thorax Movement By Respiration
2.1 Acceleration and angular velocity generated by respiration
For measuring the acceleration signal generated by respiration during exercise, the mounting position of the accelerometer is very important, because accelerometer output signal is considerably affected by not only respiration but also by body posture and sensor orientation . In this study, the acceleration sensor was attached on the precordial region (Fig. 1). We set up the Cartesian coordinates so that the origin was at the location of the sensor and then measured the acceleration signals along all three axes: X, Y, Z.
Fig. 1.Location of attached hardware module and Cartesian coordinate system: (a) X axis: The axis about Superior-Inferior movement; (b) Y axis: The axis about Medial-Lateral movement; (c) Z axis: The axis about Anterior-Posterior movement.
The human thorax moves toward the anterior direction during inspiration and the posterior direction in expiration (Fig. 1). In this situation, the thorax rises in the shape of a hemisphere and then rotates; the acceleration signal was detected along all axes except anterior-posterior axis, which had a relatively small amplitude (Fig. 2a). Fig. 2b shows the angular velocity measured by the gyro-sensor attached at epigastrium in the rest state. If the sensor is well-fixed to the epigastrium, pitch angles representing the rotations in the coronal plane can be assumed to be zero. In this case, the movement of the thorax can be handled as a two-degree-of-freedom movement because there are no rectilinear (z axis) or rotary (y axis) motions. We can then define the horizontal plane position of the coronal plane.
Fig. 2.Acceleration and angular velocity in steady respiration state: (a) accelerometer; (b) gyro sensor.
2.2 Definition of thorax’s rotation angle and angular velocity using euler angles
Leonard Euler, a mathematician of the 18th century, indicated that the location of a rigid body can be marked in a three-dimensional space . The Euler angle is defined as a set of three angles (∅,θ ,ϕ) , and the rotated matrix is defined as follows:
The acceleration signals from the accelerometer not only have acceleration from respiration but also from gravity and other types of acceleration. We can describe this phenomenon using (1) as follows:
We can assume that the linear acceleration, linear velocity, and angular velocity are zero when there is no rapid body movement or rotation during respiration. In this case, we can simplify (3) as follows:
where g = [0 0 -9.81]
By arranging (4) as a Euler angle, (5) and (6) can be inferred, and these angles denote the angle of the thorax changed by respiration.
whereg = −9.81m/ s2
However, according to our assumption in (4), estimating the thorax change angle using only the accelerometer may cause a large of error for relatively rapid respiration or motion that accelerates the anterior-posterior axis because the linear acceleration and velocity in respiration are small.
The gyro sensor, which is another device to estimating the rotation angle of a rigid body, outputs angular velocity. Angular velocity and Euler angle are related as follows:
wherep: angular velocity generated by rotation of X axisq: angular velocity generated by rotation of Y axisr: angular velocity generated by rotation of Z axis
According to (7), estimation of the change in the thorax angle using only a gyro sensor has to entail integral calculation. In this process, we have to account for a problem called “sensor drift” . This denotes divergent output caused by integration of not only the change in the thorax angle but also the errors of the gyro sensor. In this study, we fused the accelerometer and gyro sensor by using a Kalman filter to complement the weaknesses of each sensor.
3.1 Sensor fusion using Kalman filter
There have been many attempts to estimate a rigid body’s rotation in different fields including robotics, aerospace, and underwater vehicles . In general, these studies combined an accelerometer, gyro sensor, and magnetometer to improve the measurement accuracy . However, we only fused the accelerometer and gyro sensor without the magnetometer because our focus was on measuring the relative change in thorax angle. This made it possible to reduce the size of the hardware measurement module and simplify our software algorithm.
Fig. 3 is the fundamental algorithm of the Kalman filter. We defined the accelerometer’s output as zk, which does not diverge when it defines a rotation angle. We compensated for the calculated rotation angle from the gyro sensor by using the accelerometer’s output zk. When we set up the Kalman filter’s system model, if the Euler angle is used to represent a rotation angle it can lead to a singularity problem. This problem can be solved by converting the rotation angle representing the Euler angle into quaternion representation . Eq. (8) is the relational expression of the angular velocity and quaternion. We can define the discrete-time Kalman filter’s system matrix A of (9), using (8).
Fig. 3.Basic Kalman filter algorithm.
whereq: quaternionsp: angular velocity
The value measured from the accelerometer that is represented by the Euler angle must be converted into the quaternion form, because the state variables of the system model matrix are composed of quaternions. Eq. (10) relates the Euler angle to the quaternion.
Matrix H, which was used to calculate the Kalman gain and error covariance, was defined as a unit matrix because all of the state variables are measured by (9) and (10) as shown in (11). We then determined the noise’s covariance matrices Q and R as follows through trial and error to implement the Kalman filter, as shown in (12).
We assumed that the initial Euler angle was zero to set the initial estimator of the state variable and error covariance matrix as shown in (13)
The respiration estimate from the output of our designed Kalman filter is in quaternion form, which has no physical meaning; therefore, we changed this final output back to the Euler angle format.
4. System Design
4.1 Hardware description
A hardware module was prepared to measure the respiration signals and verify our proposed algorithm. The hardware module consisted of three parts (Fig. 6a). The first part was the accelerometer and gyro sensor. We selected the tri-axial accelerometer MMA7361L (Freescale Co., Ltd.), which has a maximum current consumption of 400 A and the sleep mode current consumption of 3 A, so that the design would have low power consumption. This sensor’s size is 3mm by 5mm by 1mm. The sensor sensitivity could be selected to be between 1.5 and 6 g. In this study, we selected a sensitivity of 1.5 g so that tiny acceleration changes generated by respiration could be detected. The measured acceleration signal was converted to digital data by a 12bit ADC in MCU (STM32F103RE, STMicroelectronics). For the gyro sensor, IDG-300 (Invensense Co., Ltd.) was used to detect the pitch and roll. ADIS16100 (Analog Devices Co., Ltd.) was used for yaw detection. Each sensor’s size is 6mm by 6mm by 1.5mm and 8.2mm by 8.2mm by 5.2mm. The output of IDG300 was connected to the external analog-to-digital conversion port of ADIS16100 for SPI communication to MCU. This made it possible for us to get the synchronized data of each gyro sensor. The second part was communication. We used wireless Bluetooth communication — specifically, a Bluetooth v2.0 + EDR, Class 2 module — for efficient and convenient measurement. This made it possible to transfer the measured data to a PC under wireless conditions. The third part was the power. We prevented possible accidents from using AC power by using a Li–polymer battery. Furthermore, we designed a USB charging circuit for recharging the battery.
Fig. 6.(a) Hardware module and (b) actual module being worn.
4.2 Signal processing
We carried out digital signal processing using Matlab 2011a (Mathworks○R, USA). Fig. 4 is the flowchart of the overall signal processing. The general respiration frequency range is distributed between 0 and 1 Hz . Thus, we sampled the output data from the accelerometer and gyro sensor at 20 Hz. We converted the output data of the accelerometer into a Euler angle and then converted the value into a quaternion again using (10) because we set up the state variable of the Kalman filter as a quaternion. For the gyro sensor, we directly converted the output data into the quaternion format by using (8).
Fig. 4.Signal processing flowchart.
We apply a linear detrend to all measured data to calculate the respiration rate and used the Savitzky–Golay smoothing filter (frame = 2000 ms, second-order fitting) to reject noise peaks that can be generated by motion artifacts during exercise. According to the Hung et al.’s previous study, they used an adaptive filter to remove signal noise of an accelerometer’s output. This noise can cause some error calculation of the respiration rate . In this study, our proposed algorithm used sensor fusion through the Kalman filter and applied the Savitzky–Golay smoothing filter; it needed relatively little post-signal processing, so we could calculate the respiration rate efficiently. However, it is difficult to monitor a respiratory waveform in real-time because of the 2000-ms frame size of the Savitzky–Golay smoothing filter. Therefore, we use a 2-Hz second-order Butterworth low-pass filtered signal for the display. The piezoelectric sensor based chest belt type respiration measurement device Pneumotrace II used as the reference signal had a higher SNR than the estimated respiration signal from the fused accelerometer and gyro sensor. Thus, we simply applied Savitzky–Golay smoothing filtering to Pneumotrace II’s output signal and then calculated the respiration rate using a threshold-based peak detection method (Fig. 5).
Fig. 5.Raw respiration signal from measured PowerLab Pneumotrace II and Savitzky–Golay smoothing filtered respiration signal to calculate respiration rate.
In this study, the experiment was performed to evaluate the quality of the proposed algorithm. The Institutional Review Board (IRB) of Wonju Yonsei University allowed us to perform the experiment (2012-01). Ten young male subjects not taking any medications volunteered for the experiments (table 1). All participants were well-informed about the experiment and the associated possible hazard, and that they signed the consent form.
Table 1.Information of subjects (n = 10)
Each subject put on the hardware module and PowerLab Pneumotrace II at the precordial region and performed the aerobic exercise and two muscle exercises three times (Figs. 6b and 7). The data from the hardware module and PowerLab Pneumotrace II were displayed and stored to Labview 2011 (National Instruments Co., Ltd.) and Chart 5 (ADInstruments Co., Ltd.), respectively. The aerobic exercise protocol consisted of interval exercise that changed the velocity from 3 km/h to 9 km/h in rotation to compare the quality of data for a rapidly changing velocity section. The breath-holding section was added to the aerobic exercise protocol to analyze the asymmetrical respiration by using our algorithm, as mentioned earlier. We verified that the output was influenced by either a respiration signal or a similar filtered respiration signal.
Fig. 7.Protocols of the experiments: (a) aerobic exercise protocol for 8020T model (STEX Co., Ltd.). The set speed was changed during the breath-holding section to evaluate the effectiveness of changing speed. Each subject was measureed three times. (b) Muscle exercise protocol for shoulder press and leg press (Techonogym Co., Ltd.). Used exercise equipments are hydraulically operated. The effectiveness of the algorithm for upper and lower body exercise was evaluated by using different exercise equipment. Each subject did the same exercise protocol using the same exercise equipment three times. All subject did exercise on 5 level which is hydraulically loaded weight. For right respiration during exercise, we trained all of the subjects before starting an experiment to breathe while the muscle is relaxed and exhale when muscle is contracted. The sixth to eighth counts in each exercise set were used as the holding breath section to verify that the algorithm captured the asymmetrical respiration signal for analysis.
6.1 Analysis of aerobic exercise in time-domain
Fig. 8 shows the respiration signal during the interval exercise, including the breath-holding section. Most people exercise on the treadmill at a uniform velocity to the anterior direction for most of the section and perform an equivalent acceleration toward the same direction when the treadmill changes speed. Thus, the detected output of the accelerometer’s Z axis, which means the acceleration information in the anterior direction, was relatively small in comparison with the degree of motion. Moreover, acceleration can be generated on the entire axis of an accelerometer with an impulse of the body when someone exercises at high speed on a treadmill. However, this acceleration can be efficiently rejected by linear filtering because it is composed of a higher frequency than that of respiration. For a section where the speed of the treadmill changes rapidly, a large amplitude of positive or negative acceleration may be measured by the accelerometer. It can be a significant noise signal for the estimation of the respiration rate. The gray box of Fig. 8 denotes the breathholding section of our experiment protocol. This figure shows a large number of noisy peaks generated by motion artifacts, which were estimated from only the accelerometer (Fig. 8b). On the other hand, the respiration waveform estimated by the fusion sensor method based on the Kalman filter (Fig. 8c) had little noise compared to the output of the accelerometer-only method. Most of the respiration rate calculation has a tendency to be overestimated not to be under-estimated because of some peaky noise. As shown in Fig. 9, we verified that our fusion sensor method estimated the respiratory rate with 4.6% more accuracy than the single accelerometer method.
Fig. 8.Respiratory signal estimated during treadmill exercise: (a) PowerLab Pneumotrace II; (b) single accelerometer method; (c) Kalman-filter based fusion sensor method.
Fig. 9.Error rate and total error rate of respiration rate using a single accelerometer and the fusion method during aerobic exercise. (a) Three sets of respiration data. We analyzed the data to compare the error rate using the Pneumotrace II output as the standard. (b) The total error rate of the single accelerometer method was 11.9 %, and that of the fusion method was 7.3%.
6.2 Analysis of anaerobic exercise in the time-domain
The upper bodies of the subjects were fixed for most of the muscular exercise, so high amplitudes of acceleration toward the anterior direction were not generated. In this case, we can assume that a person doing muscular exercise is in a static state. In our experiment, we obtained high accuracy for the respiration rate using only an accelerometer, similar to the previous study that tried to estimate the respiration rate in the static state using a single accelerometer (Fig. 11a). However, Technogym’s leg-press device used in our experiment, it was too difficult to estimate the respiration waveform because the human body moved along the anterior-posterior axis like pendulum during the exercise. Moreover, in this situation, the frequency range of the human body’s acceleration was similar to the respiration’s frequency range, and the amplitude was higher than that from respiration. In this study, we verified that the output signal from our algorithm represented the real respiration signal by adding the breathholding section into the experiment protocol. Fig. 10b shows the wrong estimation of the respiration waveform during the breath-holding section when the single accelerometer method was used. In this breath-holding section, although the subject did not breathe, the output waveform showed a similar shape to the respiration waveform because the impulse acceleration generated during exercise was estimated like respiration through low-pass filtering. On the other hand, the output signals of our algorithm shown in Fig. 10(c), counteracted this wrong estimation phenomenon. The output of the PowerLab piezoelectric sensor based belt type respiratory measurement device Pneumotrace II, which was used as the reference respiration signal in this study, showed relatively small peaks during the breath-holding section. (Fig. 10a). This phenomenon was attributed to the increase in thorax pressure and upper body movement when exercise was being performed while the breath was being held. Thus, we instructed the subjects to fix their upper bodies and maintain a correct posture for each exercise in order to acquire data with no errors for Pneumotrace II. For this process, we can calculate the correct respiration rate during exercise. Fig. 11 demonstrates each error rate calculated from the single accelerometer based method and our proposed fusion sensor based method compared to the Pneumotrace II standard. For the shoulder press, there were no significant differences, but for leg press, our proposed method showed a 9.54% lower error rate than single accelerometer method (Fig. 11b).
Fig. 10.Respiratory signal estimated during leg press exercise using Thechnogym’s leg press outfit: (a) PowerLab Pneumotrace II; (b) single accelerometer method; (c) Kalman-filter based fusion sensor method.
Fig. 11.Error of estimated respiration number during muscle exercise. (a) Estimated respiration errors during the shoulder press exercise using the single accelerometer or fusion method are shown. The three exercise results of each subject are summed up. There was no difference between using the fusion method and the single accelerometer method. (b) During the leg press exercise, the fusion method was more accurate than the single accelerometer method. The error rate of the single accelerometer method was 15.24%. The error rate of the fusion method was 5.7%.
6.3 Analysis in time- frequency domain
In this study, we used the wavelet cross spectrum (WCS) to verify that the estimated respiration signal from our proposed algorithm’s patterns and spectrum distribution were the same as those of PowerLab’s Pneumotrace II, which was used as a reference device. The reference signal was down-sampled to 20 Hz, and the input signals were normalized from -1 to 1. We used a complex Gaussian wavelet and then chose the 128 wavelet scale. In Fig. 12, the wavelet cross spectrum results show a strong correlation between scale 15 and scale 25, which denotes a real respiratory frequency range of 0.4-0.67 Hz.
Fig. 12.Time-frequency domain analysis using the wavelet cross spectrum technique. The input signals were the respiration signal from PowerLab Pneumotrace II and our proposed method
6.4 Analysis of time delay
Fig. 13 shows the time delay between the real respiration signal and the output signal from our hardware module. Reducing the phase delay in the algorithm is important for respiration signal monitoring. In our algorithm, the point where the signal changes rapidly in the last section of inspiration is the starting point for expiration. We defined the time delay as the interval of each two signal’s starting point. The average time delay was found to be 0.638 s (standard deviation: 0.026 s). It was difficult to define the time delay of inspiration because of the unclear starting point of inspiration. Although there were often small gaps for each individual because of hardware module’s position and physical characteristics, we thought that respiration monitoring was sufficiently fast for real-time monitoring during exercise because the time delay was less than 1s on average.
Fig. 13.Comparison of time delay of PowerLab Pneumotrace II and fusion: the average time delay of 0.638 s (standard deviation: 0.026) shows that the proposed method is suitable for real-time respiration monitoring.
In this paper, we suggested an improvement algorithm for the fusion of an accelerometer and gyro sensor using a Kalman filter for a more high-quality respiration signal to complement the weakness of using a single accelerometer. We basically succeeded in acquiring a respiration signal by using the Kalman filter to fuse physical sensors with different weaknesses. When we used only the gyro sensor to estimate the varying angles caused by respiration, an integral was needed, so sensor drift occurred. In contrast, when we used only the accelerometer, the error was large compared with the real respiration signal if there was a rapidly changing linear acceleration in the breathing direction. Thus, we made real-time respiration monitoring during dynamic exercise possible by fusing the sensor outputs using Kalman filter to decrease the drift of the gyro sensor. To evaluate our proposed algorithm’s performance, we developed a chest belt type module with Bluetooth for wireless communication and compared the derived respiration signal from the accelerometer with that from our algorithm by the standard respiration signal of a piezoelectric sensor.
Generally, when most people exercise in treadmill, they stay in uniform motion toward the anterior of body due to the characteristics of treadmill exercise. The highfrequency noise caused by the impact of running on a treadmill is effectively rejected because of its significant difference with the frequency ranges of respiration. In this case, we can extract the respiration from a single accelerometer because the upper body on which the sensor is attached nearly maintains a static state. For interval training with varying speed, however, acceleration during exercise varies instantaneously. Thus, there are relatively large positive or negative accelerations toward the anterior of upper body to adapt to the varying speeds. This may cause significant noise for the extracted respiration signal (Fig. 8b). We had subjects perform interval training and compared the extracted respiration signals from the different sensors with each other. We found that our suggested algorithm provided more stable respiration information than the method using a single accelerometer.
During the muscular exercise, we compared the respiration signal extracted during the shoulder press, for which the upper body is fixed, with that during the leg press, for which the upper body is not fixed. For the shoulder press, which was in a static state, our suggested method showed no significant improvement over using a single accelerometer. On the other hand, for the leg press which was in a dynamic state, there was a remarkable difference. During the leg press, the upper body moves, so the measured accelerometer signal is much bigger relative to the respiration signal, which may be a fatal weakness for extracting the respiration signal, as showed in Fig. 10b. Although we removed that signal, we may also lose the respiration signal due to the similarity between the respiratory frequency and the leg press exercise. However, our suggested algorithm can effectively deal with sudden variations in the accelerometer; therefore, we confirmed that it can acquire a more stable respiration signal.
As mentioned above, real-time respiration monitoring is very important because it can affect exercise sustainability and induce safer and more effective exercise. Thus, we examined our algorithm for its applicability to real-time monitoring. We evaluated the time delay based on the expiration starting point because the inspiration point was not clear due to the characteristics of the physical sensor we used. We confirmed that the time delay was less than 1 s (0.638 s on average), so believe that it can be applied to respiration monitoring in real-time during exercise. Thus, the proposed algorithm has the notable strength of being able to not only calculate the respiration rate but also to monitor the signal itself. In addition, WCS analysis in time-frequency domain with the reference respiration showed a significant correlation to the respiratory frequency range. Overall, our proposed method was shown to represent real respiration properly.
In conclusion, we suggest an improvement algorithm for a fused of accelerometer and gyro sensor that uses a Kalman filter to provide a more high-quality respiration signal and can be applied in real-time. We confirmed that our suggested algorithm can acquire a more high-quality respiration signal in a dynamic exercise environment away from a limited static environment. We are sure that it can provide safer and more effective exercises and improve exercise sustainability. In future study, if we develop a smart phone application that can take various biosignal (ECG, etc.) information using textile electrodes, we can apply our algorithm not only to indoor but also to outdoor exercise for unconscious biosignal measurement and autonomous self-monitoring.