Abstract

The purpose of this paper is to propose a cascade complementary filter (CCF) for tracking abdominal or diaphragmatic movement induced by respiratory activity. An inertial sensor (3 DOF accelerometer and 3 DOF gyroscope) is mounted on the upper abdomen, allowing the tilt value of the upper abdomen to be measured. CCF is aimed at overcoming the limitations of the linear CF method for online gyroscope estimation. Our proposed CCF algorithm compensates gyroscope bias with a nonlinear filter and then fuses it with accelerometer angle to obtain abdominal inclination. The CCF method performed better than the linear CF method in terms of respiratory rate error. While CCF increased estimation accuracy, it also appeared to be independent of attitude estimation parameters. The frequency of the CCF respiratory signal remained steady between 0.2 Hz and 0.4 Hz throughout the experiment, with a mean of 0.29 Hz. In other words, the results range between 12 and 24 breaths per minute, which is considered normal at 17 breaths per minute.

1. Introduction

By measuring airflow with a spirometer, the direct respiration rate can be estimated. Due to the direct invasion of the mouth or nose, this technique is often impracticable and uncomfortable for patients during treatment [1]. For continuous respiratory monitoring outside of a clinical environment, the noncontact approach is suggested. Using an accelerometer worn on the chest or upper abdomen to measure the movement of the chest wall and diaphragm is a unique way for estimating respiratory rate.

As proposed by [2], the noncontact technique detects the respiratory rate based on the movement of the chest surface via an accelerometer sensor. During respiration, the movement of the thorax and abdomen causes slight variations in their inclination. Accelerometers worn on the upper abdomen and chest wall can detect changes in the inclination angle and rotation of the chest wall during inhalation, enabling the assessment of respiratory rates [24]. Torres [5] evaluated the diaphragmatic movement by observing the breathing muscles using an accelerometer. The accelerometer sensor was then utilized to calculate the breathing rate based on the diaphragmatic muscular contraction.

Accelerometers have been used extensively to detect and evaluate respiratory signals, as proven by [6, 7], who put sensors in a variety of location, including the upper abdomen, sternum, and chest surface. Observations demonstrated that various persons can create signals of differing quality (as measured by signal-to-noise ratio (SNR)) from specific places. The precision with which fiducial points on the respiratory wave are recognized can be significantly affected by factors such as the sensor’s location. According to [8], the Euler angle was derived from respiratory movement using an accelerometer and a gyro sensor (also known as an inertial sensor). Another study [9] developed a device based on tracking thoracic movement with a complementary filter to track the Euler angle during inclination and detect respiratory patterns. To extract relevant information about the posture and pose of the limbs from accelerometer and gyroscope signals, a proper sensor fusion technique was necessary. Regardless of the sensor’s global orientation, sensor fusion permits the assessment of changes in the chest surface slope resulting from respiratory activity. Then, the Kalman filter was used to integrate the acceleration and angular velocity quaternions with the Euler angle given in quaternions [9]. However, there was still a significant amount of noise in the output, making it difficult to identify the person’s respiration rate.

The majority of sensor fusion techniques estimate the unknown variables (such as the inclination angle) in discrete time series, utilizing the prior estimate and current time steps. Typically, two sensor fusion techniques are employed: the complementary filter (CF) and the Kalman filter (KF) [10, 11]. A value estimate can be generated by applying a Kalman filter to the data. Numerous Kalman filter (KF) variations, such as the extended Kalman filter (EKF) and particle filter (PF), have been proposed for sensor fusion (PF). EKF, the nonlinear variation of KF, is a well-known method for estimating posture that remains popular among researchers. KF, EKF, and PF, however, require a mathematical model and include a complex matrix operation, which increases the computing complexity. However, when applied to embedded devices, the Kalman filter method’s mathematical model necessitates a lengthy computation time [12].

Numerous studies have been conducted to address some of the issues associated with KF through the use of the complementary filter (CF, also known as linear CF). No prior knowledge of the system environment or complex system model is required for CF. To increase the accuracy of the estimate value, a nonlinear variant of CF was developed. The nonlinear CF is implemented using a proportional-integral feedback control system, with the proportional portion controlling the frequency shift between two sensors and the integral portion controlling the gyroscope bias [12]. Both of linear and nonlinear CF estimate angular value obtained from the accelerometer and gyroscope.

This work proposes the use of a cascade complementary filter (CCF) to track the angle of inclination of the abdomen/diaphragm produced by respiratory activity, by averaging tridimensional thoracic movements, such as chest tilt, acceleration, and velocity, as the measurement parameters. The processing stages in the works adopt stages in Carlton [13]: extraction of respiratory signals, estimation of respiration rate, and fusion of estimates. The CCF is aimed at solving any shortcomings in the linear CF gyroscope estimation method. CCF calculates abdominal/diaphragmatic inclination angle by using the corrected gyroscope readings and accelerometer angle. CCF was able to correct the gyroscope error, allowing it to provide a respiratory signal with less harmonic frequency components. In addition, the experimental results revealed that signal processing with CCF produced less error rate than the linear CF method.

2. Studies on Respiratory Rate Measurement

This section presents the literature review on the principles of respiration rate measurements. Afterward, the inertial-based measurement method for respiratory rate is technically presented according to the acquisition mechanism and signal processing as well as the signal extraction algorithm to obtain the respiratory rate from inertial sensors.

2.1. Principle and Measurement

When the breathing muscles and diaphragm contract, respiration occurs. Respiration is a two-step process consisting of inhalation and expiration. The diaphragm contracts descends and creates a pressure difference, allowing air to enter the lungs from the respiratory system. When the pectoral muscles contract, the ribs rise and the chest cavity enlarges, allowing more air to enter. As shown in Figure 1, the chest surface expands and contracts to facilitate inhalation and expiration. Therefore, during inhalation, the sternum is lifted by the respiratory muscles. During exhalation, the diaphragm contracts, which compresses the chest and forces air out of the lungs.

Numerous studies have been conducted to measure the amount of air in the lungs that contributes to the expansion of the chest surface movement. There are several analytical techniques for monitoring and measuring respiratory rate based on chest wall motion. These include the following: (i) based on chest wall stretch caused by respiratory activity, (ii) based on transthoracic impedance changes, and (iii) based on three-dimensional thoracic motion (e.g., chest tilt, acceleration, and velocity). The algorithm can be divided into three stages based on the three analytical techniques: respiratory signal extraction, respiratory rate estimation (RR estimate), and RR estimate fusion [13]. The respiratory signal is frequently extracted using AM, FM, or BW modulation. The extraction can be based on features or on filters. In this instance, feature-based technology outperforms filter-based technology [13].

2.2. Inertial-Based Measurement

According to [14], an inertial measurement that consists of an accelerometer and gyroscope placed around the chest and abdomen area is included in the measurement of the chest wall movement area, as illustrated in Figure 2.

An IMU worn around the chest, abdomen, or diaphragm produces a signal with a very low-frequency component corresponding to the movement of the chest surface and a high-frequency seismocardiogram (SCG) component that captures the chest vibrations caused by the heartbeat. The significant sub-Hz component is caused by the movement of the chest surface and diaphragm during the expansion and contraction of the lungs. In contrast, the component with a much smaller amplitude but a higher ripple frequency (>5 Hz) is the result of chest wall vibrations, which are especially noticeable in light of the acoustic waves generated by the heart valves [15]. Acceleration and velocity variation are two potential inputs for breathing data recording. Typically, the IMU sensor is attached to the chest wall in order to detect breath-induced movement [14]. Figure 3 depicts a common application of the IMU’s principle of respiratory signal acquisition and respiratory rate measurement.

A respiratory signal can be obtained by measuring the amplitude between the peak and trough of the pulse [16], the beat-to-beat interval between fiduciary points [17], or the peak and trough of the composite signal [16, 18]. In this instance, the original signal is filtered to eliminate nonrespiratory frequency components, either with a band-pass filter (BPF) [19] or by examining signal patterns with a continuous wavelet transform [20, 21].

Lin et al. investigated the use of sensor fusion for respiratory rate measurement [22]. It was accomplished through the use of data from a three-axis accelerometer and a three-axis gyroscope. Following that, the two sensors were extracted to obtain the Euler angle and convert it to a quaternion value. The results of this method indicated that the algorithm used improved the accuracy of respiratory rate detection by 4.6 percent for the treadmill and 9.54 percent for the bicycle. Additionally, the Kalman filter process determined that there was an average time delay of approximately 0.638 seconds [22].

Another researcher [23] used sensor fusion in conjunction with the Euler and quaternion methods to determine the accelerometer and gyroscope’s inertial rotation angle due to respiratory movements. Both devices recorded the respiration signal, which was then reconstructed using the wavelet method. The next step was to identify the respiratory phase automatically. The three-axis accelerometer and three-axis gyro sensor can be used to calculate the Euler angle based on respiratory system movement. Prior work had been done on autosegmentation and denoising of accelerometer and gyroscope signals.

Another study [7] developed a method for determining the respiration rate by converting accelerometer and gyroscope values to Euler and quaternion angles. In contrast to [23], Shen [7] enhanced the quaternion signal using a Kalman filter in conjunction with naive Bayes. A band-pass filter with a cutoff frequency of 0.1–0.8 Hz was then applied to the quaternion signal. The experiment demonstrated that when the volunteer was supine or in a static sitting position, the variation in respiration frequency performed best, while the amplitude variation of the respiratory signal performed best during the ongoing experiment.

Noise attenuation is a technique for removing noise from a signal. Widrow et al. [24] introduced the adaptive noise canceler, which has been used in a variety of applications [25, 26], including communication systems [27, 28] for noise cancellation in GSM, biomedical engineering [29], and industrial applications [30]. Adaptive filters are then frequently used to determine the input signal and reduce the system’s noise level at the output. The adaptive filter parameters are typically set automatically and do not require prior knowledge of the signal or noise characteristics.

3. Material and Methods

This section discusses the methodology used in the research. Figure 4 shows three blocks that summarize the research methodology. The first block is focused on setting up the environment and acquiring data. The second block presents signal processing techniques, including digital filtering, calculating Euler angles from accelerometer signals, and fusing accelerometer and gyroscope signals using cascade complementary filters. The third block is about the detection of peaks and the measurement of respiration rate. The following subsections provide a more detailed explanation of each block.

3.1. Data Acquisition

As illustrated in Figure 5, data collection was accomplished using the Mbient inertial measurement unit (IMU) sensor, which consists of a three-axis accelerometer and a three-axis gyroscope mounted on a flexible belt. The sensor was connected via the Wi-Fi protocol to a smartphone application or a computer for data transmission as a result of measurement. Mbient IMU made use of a Bosch BMI 160 inertial measurement unit sensor. During the experiment, an accelerometer with a resolution of 2 g and a gyroscope with an angular velocity of 2000°/sec were used, each with a sampling rate of 100 Hz and data retrieval lasting 60 seconds. The data were collected from 36 volunteers ranging in age from 19 to 47 years. The IMU sensor was used exclusively in the diaphragm/abdomen for the supine position, as recommended by [7], as illustrated in Figure 5.

The movement of the chest wall during respiratory activity altered the angle of the IMU sensor attached to the diaphragm. Thus, accelerometers and gyroscopes were used to determine the acceleration and angular velocity of the surface walls during respiratory activity. Figure 6 depicts the mechanics of breathing and the changes in the orientation of the IMU sensor during exhalation. The figure’s right side depicts the sensor’s raw signal.

As previously stated, data collection for this paper was conducted on volunteers’ supine positions. Multiple measurement positions and transitions between position changes produced several similar respiratory signal patterns, but with varying inclination angle amplitudes or magnitudes. Supine position, as recommended by [7], results from a more dominant inclination angle and amplitude, as illustrated in Figure 7.

Changes in position from supine to right or to left resulted in a decrease in the amplitude of the inclination angle. Additionally, there is a short fluctuating angular change during the position transition, but once the position was stable, the respiratory signal produced became stable. Figure 8 shows the respiratory signal pattern obtained from the supine position.

3.2. Signal Characteristics

The IMU sensor outputs the accelerometer and gyroscope signals in three axes of sensor positions, based on the sensor placement shown in Figure 6. However, during the respiration activity, the dominant value of the accelerometer is the -axis, and for the gyroscope is the pitch axis. The example of the signals is depicted in Figure 9. The upper portion of the figure depicts the raw accelerometer signal on the -axis, while the lower portion depicts the gyroscope’s pitch axis. The accelerometer and gyroscope’s three axes clearly showed that the respiration signal was a low-frequency component, whereas noise generated during the measurement process was a high-frequency component. The amplitude generated by measurements taken in this position was quite large, particularly for the accelerometer with the -axis and the gyroscope with the pitch axis.

The frequency location of the respiration signal captured by the sensor was identified using the fast Fourier transform of all accelerometer axes. According to Figure 10, the dominant amplitude of the respiration signal was in the range of 0.2 Hz to 0.4 Hz for the sensor in the abdomen position. This is consistent with the experiment’s recommendations [2]. The respiration measurement results were approximately to respirations per minute (RPM) or 12 to 24 RPM. The difference was evident in the resulting amplitude, which indicated that the respiration signal generated by the accelerometer’s -axis had a relatively large amplitude when compared to other accelerometer axes at the same measurement position.

3.3. Cascade Complementary Filter

Cascade complementary filtering (CCF) is a novel sensor fusion technique proposed by [12]. Sensor fusion is a broad term that refers to the process of combining data from two or more sensors in order to achieve higher accuracy and specificity than is possible with a single sensor. In this study, inertial sensors (gyroscope and accelerometer) were used to estimate the angle of the three sensor axes with respect to the position of the chest surface during respiratory activities. When used to determine the angular orientation, the gyroscope’s value drifted over time. By fusing the data from the triaxial accelerometer, additional information about the roll and pitch angles of the - and -axes was obtained to compensate for the gyroscope’s drifting values.

This paper proposes CCF as a fusion technique for obtaining more stable IMU sensor respiration signals. CCF estimated the attitudes of sensors in two stages. The nonlinear component was used to correct for gyroscope error, whereas the linear component was used to calculate the overall attitude after gyroscope bias had been corrected. In other words, CCF became a hybrid of linear and nonlinear forms. Using a nonlinear complementary filter, the CCF algorithm compensated for gyroscope bias and then estimated attitude using bias-compensated gyroscope measurements in a linear complementary filter. Figure 11 depicts the CCF method, where represents the accelerometer rotation angle (in this case, the longitudinal axis or -axis) as determined by the equation where and are the accelerometer values in - and -axis.

As seen in Figure 11, the value of refers to the gyroscope angular; refers to the angular velocity; refers to the gyroscope angular value containing the high-frequency noise, and refers to the estimate value of the inclination of diaphragm surface produced by the cascade complementary filter. This value represented the angular displacement induced by the respiratory activity. The values of , (proportional), and (integral) referred to the constants of cascade complementary filter (CCF).

Based on the CCF block diagram as shown by Figure 11, the error values between the estimation of the abdominal inclination and the accelerometer value were used to compensate for the gyroscope error. The gyroscope error value is then represented by

This error value was then subtracted from the velocity value of the angular measurement, which was obtained using a gyroscope. The gyroscope signal still contained noise. For this, we obtained an error compensation as given by the equation

This angular estimation was then integrated to obtain the attitude of CCF, i.e., . In the CCF architecture, a linear complementary filter was subsequently used to fuse the attitude angles from the gyroscope with the calculated accelerometer angle. Thus, the IMU angular attitude estimate was obtained by the equation

As illustrated in Figure 11, the CCF algorithm used a nonlinear complementary filter to compensate for gyroscope bias and then used the compensated gyroscope angular velocity measurement in a linear complementary filter to estimate the chest wall inclination due to respiratory activity. In other words, CCF compensates for gyroscope error using the NCF and calculates the attitude angle using the LCF. The weighting factor varied between 0.8 and 0.98 in this experiment for both CF and CCF. In this paper, the linear complementary filter method is also compared to the cascade complementary filter method and the signals are shown in Figure 12. This figure illustrates the difference in results obtained when respiration signals are processed using CF and CCF. The blue line, which is a CF-processed respiration signal, demonstrates that it still contains gyroscope bias, particularly in the section exhale to inhale phase.

4. Results and Discussions

4.1. Estimation of Respiration Rate

Prior to using the CCF model to process the signal, the accelerometer angle was calculated using Equation (1). The accelerometer angle was then denoted by the term and depicted in Figure 13 with a red signal. The value for the parameter was 0.98.

The CCF process was continued using the input and the gyroscope angular velocity signal to estimate attitude by tracking the inclination angle of the diaphragm during respiratory activity. The comparison of respiration signals produced by the CF and CCF methods as well as the estimation result is shown in Figure 14. Figure 14(a) depicts the results of the CCF process as a respiration signal, plotted by the red signal. The blue signal indicates the respiration signal generated by the linear CF method.

To compute the respiratory rate value, a peak detection procedure was used in conjunction with the estimate attitude of the CCF angular value. It was intended to denote the fiducial points, which corresponded to the peak of inhale activity. Prior to peak detection, the data were filtered with a Butterworth band-pass filter between 0.2 and 0.8 Hz. Peaks and fiducial points were detected automatically in this research paper using the MATLAB application’s automatic peak detection function. The results of peak detection and fiduciary point marking are shown in Figure 14(b). The calculated respiratory rate was consistent with the manual measurement of 13 rpm (respiration per minute).

4.2. Respiration Signal Analysis from Complementary Filter and Cascade Complementary Filter Methods

This section discusses the signal processing analysis of the sensor fusion technique, specifically using the cascade complementary filter method. Additionally, a comparison between signal analyses of complementary filter method will be discussed as well. For the first step of analysis, FFT was performed on the results of CF and CCF methods with constants . Figure 15 illustrates the comparison of frequency spectrums of the two methods.

According to the frequency spectrum depicted in Figure 15, sensor fusion technique with CCF produces a dominant frequency of approximately 0.3 Hz with an amplitude of approximately 1 unit for and and 1.5 units for . Meanwhile, sensor fusion combined with the CF method produces two dominant frequencies, approximately 0.3 Hz and 0.5 Hz, with an amplitude of approximately 0.6-0.8 units for and and 1 unit for . This demonstrates that the constant on the CCF plays a significant role in generating a single dominant frequency with a sufficiently large amplitude.

As illustrated in Figure 16, this also confirms the robustness of location of respiration frequency in spectrum generated by sensor fusion using CCF methods. The curve of the frequency spectrum distribution indicates that the CCF method generates the respiration frequency with  Hz for the three variations of . Meanwhile, sensor fusion technique with the CF method results in a frequency range of 0.34 Hz to 0.45 Hz. By obtaining a single dominant frequency spectrum from the respiratory frequency, the CCF method produces a more stable respiratory signal than the CF method.

This section concludes with a comparison of the respiration signal with the generated spectrum of both conventional complementary filter methods with cascade complementary filters. As illustrated on Figure 17(a), the CCF method produces a smoother inclination angle than the CF method. Thus, when applying BPF with cutoff frequency between 0.2 Hz and 0.8 Hz, the resulting respiration signal is more stable and smoother, allowing the peak calculation process to easily calculate the entire respiratory period using peak detection algorithm.

As an example of the comparison results between the CF and CCF methods, Figure 18 shows the plots of 3 datasets of respiration signal. It can be concluded that by performing band-pass filtering on the output of the CCF method, the respiration signal generated by the three sample datasets can be clearly identified and the peaks and valleys can be easily detected to calculate the respiration rate per minute.

4.3. Statistical Analysis of Respiration Rate Using CF and CCF Methods

This section discusses a statistical analysis on experimental data using the complementary filter (CF) and cascade complementary filter (CCF). The purpose of this analysis is to determine the system’s overall accuracy when measuring various respiration rates using both methods. As described previously in Data Acquisition, the dataset was collected from 36 volunteers ranging in age from 19 to 47 years. The value variation was used in the experiment to determine the extent to which weight had an effect on the estimated value of the respiration rate. The distribution of age of volunteers is depicted in Figure 19(a). The weight and height of volunteers are also recorded in the dataset, and distribution of those volunteers’ data is plotted in histogram as shown in Figures 19(b) and 19(c), respectively.

The performance of CF and CCF at different respiration rates from dataset ranges from 11 to 20 rpm. For further analysis, the dataset is then plotted using correlation and Bland–Altman plots as shown in Figures 20 and 21. The Bland–Altman plots show estimated respiration rate per minute (rpm) during supine position placing sensor on the diaphragm of the chest. The CF and CCF parameter is also varied from 0.8 to 0.98 to obtain the best respiration signal after fusion technique. Figures 20 and 21 illustrate the correlation plot and Bland–Altman plots after applying band-pass filter to the output of CF and CCF. The root mean square of the difference between the estimated respiration rate and the manually measured respiration rate was calculated to obtain the root mean square error (RMSE) in all three values. The group RMSE for complementary filter CF with is 2.24 rpm, with is 1.79 rpm, and with is 1.88 rpm. The group RMSE for cascade complementary filter CCF with is 0.81 rpm, with is 0.87 rpm, and with is 0.74 rpm. Respiration rate estimation using CCF had the best correlation at 0.96 for the CCF method. Meanwhile, the concentration of estimate value was quite significant for the CF method, resulting in the estimate value being further from the linear line for all of constants. However, for the CCF method, the distribution of respiration values became more similar to the actual measurement result. Respiration rate with the CCF method with proved to have the highest accuracy, with the lowest RMSE and a correlation with ground truth is 0.95. This is consistent with physiological expectations since the shape of the respiration waveform represents pulse during inhale and exhale.

The probability density function of respiratory rate measurement error between the CF and CCF methods is shown in Figure 22. As seen from Figure 22, the change of had more significant effect of reducing error of respiration rate estimation on the CF method compared to the CCF method. Low value of in CF significantly causes the larger error deviation. Meanwhile, the effect of has no significant effect on the error distribution in the CCF method. Respiration rate with the CCF method with proved to have the highest accuracy of estimate values. Therefore, it increases the error probability value with and the value of the measurement rate estimation was close to the ground truth measurement value with the probability of almost 0.55 with 0.73 rpm of standard deviation 1 and 1.45 of standard deviation 2.

Based on the analysis in the preceding paragraph, it can be concluded that the CCF method was more robust than the CF method for estimating the respiration rate using inertial measurement unit by means of measuring the inclination angle of chest diaphragm. These results of frequency analysis show the location of the respiratory signal was more stable around 0.29 Hz for the CCF method compared to the CF method. This increased the robustness of CCF relative to CF. Statistical analysis also revealed that the robustness of CCF is due to the estimate value of respiration rate, which tends to less error rate and high correlation from the dataset during measurement.

5. Conclusion

Complementary filtering (CF) combines accelerometer and gyroscope readings, resulting in a more lightweight and accurate angular motion estimation than that obtained directly from accelerometer data. This paper describes a sensor fusion technique based on an IMU and proposed the cascade complementary filter (CCF) method for estimating the sensor’s attitude toward the diaphragm inclination caused by respiratory activity. An accelerometer and a gyroscope are used in a sensor fusion system. CCF was compared to CF, which demonstrate that CCF provides a more accurate estimate of respiration rates. The CCF method was used to monitor respiratory rate in the supine position. According to the experimental results, CCF produced greater accuracy with a 1 rpm error compared to CF with a 5 rpm error. Variation of filter parameters, i.e., decreased CF performance significantly, while CCF tended to remain stable. While CCF improved estimation accuracy, another significant point was that CCF did not appear to be dependent on filter parameters for attitude estimation. This was supported by data indicating that the location of the respiratory signal frequency generated by the CCF method was relatively constant in the range of 0.29 Hz, whereas the CF has still two dominant frequencies, i.e., 0.3 Hz and 0.5 Hz. In CCF methods, the nonlinear part with proportional integrals was used to recalculate the online gyroscope bias, whereas the linear version was used to estimate the attitude parameters. The proposed CCF with proved to have the highest accuracy of estimate values. It has an error probability value 0.55 with that indicates the value of the measurement rate estimation was close to the ground truth measurement value with the probability of almost 0.55 with 0.73 rpm of standard deviation 1 and 1.45 of standard deviation 2.

Data Availability

Data is available by request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This paper is part of a research funded by the Ministry of Education, Culture, Research and Technology of the Republic of Indonesia No. 004/SP2H/RDPKR-MONO/LL4/2021.