Abstract
Respiratory measurement is a crucial indicator for assessing health status; however, current methods for measuring respiratory rate and frequency are passive and not intuitive. This study investigates peak detection algorithms using a resistive strain sensor integrated into a garment for respiratory rate monitoring. The sensor, constructed with CNT material and a flexible rubber substrate, exhibits high conformity to the body’s contours. Designed for respiration measurement, the sensor maintains a low 6% strain for optimal sensitivity, demonstrating a 4% decrease after 800 repetitions of 10% elongation. Garment design emphasizes cohesion between the sensor and fabric, achieved through a piping technique. Respiratory measurement relies on a resistive sensor principle, where abdominal volume changes induce tension, altering resistance. Three peak detection algorithms are evaluated: the window size algorithm, low-pass filter, and FIR filter. The window size algorithm shows a 93% matching rate for normal breathing but requires manual adjustments based on breathing speed. The low-pass filter reduces noise but introduces lag, challenging peak matching. The FIR filter effectively detects peaks at increased speeds, achieving a matching rate exceeding 98%. The study concludes that the choice of algorithm depends on respiratory scenarios, with the window size algorithm suitable for regular cycles, the low-pass filter for real-time monitoring, and the FIR filter for accelerated respiratory rates. The study primarily explores static situations, indicating the need for future research on dynamic respiratory movements to enhance algorithm versatility.
Introduction
The increasing need for assessing respiratory variables across various applications has led to a growing demand. Among the measured variables, respiratory rate, or respiratory frequency (
Choosing the appropriate sensor or measurement technique for assessing respiratory frequency (
The diaphragm serves as the primary muscle for inspiration. Its contraction leads to a reduction in intrapleural pressure and a simultaneous expansion of lung volume.
18
Concurrently, an elevation in abdominal pressure is conveyed to the chest via the apposition zone, facilitating the expansion of the lower thoracic cavity. As the diaphragm contracts, the lower rib cage undergoes enlargement. This results in the bucket handle movement, characterized by an elevation of the ribs during inspiration, leading to an augmented transverse diameter of the thorax.
19
The upward lift and forward displacement of the sternum during inspiration lead to an expansion of the anteroposterior diameter of the thorax. Additionally, the contraction of the diaphragm plays a role in enhancing the longitudinal diameter of the thorax.
20
The scalene muscle, sternocleidomastoid muscle, and intercostal muscles function as auxiliary muscles during inhalation. In the case of forced exhalation, the abdominal muscles undergo contraction, pushing the diaphragm upward and resulting in a reduction of chest dimensions.
21
The muscle mechanism in response to respiration is understood as described thus far, and accordingly, strain rubber sensors undergo repeated cycles of strain and release (Figure 1). The majority of strain sensors utilize piezo-resistive methods because of the direct correlation between the resistance of conductive materials and the applied strain.
5
The operational concept of piezo-resistive strain sensors relies on the alteration of electrical charge concentration when subjected to external strain, thereby modifying the geometric configuration of the piezo-resistive sensing element. The resultant changes in shape are quantifiable, allowing for the determination of the applied strain.
1
In this manner, we measure respiration by utilizing a textile-based fiber sensor suitable for the body’s shape to capture the mechanism of muscle changes associated with breathing. The strain method employed is particularly adept at detecting alterations in muscle dynamics, making it well-suited for the measurement of respiratory frequency. Changes in rib movement and sensors during breathing.
Respiratory rate stands out as a highly predictive22–24 and early indicator 25 of changes in the clinical condition of patients. Paradoxically, it remains one of the most overlooked, 26 underused, and least documented 27 vital signs. Challenges such as obscured identification of the beginning and end of a breath, disruptions, patient movement, the complexity of counting, or recalling counts can introduce additional inaccuracies. 28 Employing technologies for the automated measurement of respiratory frequency can mitigate these issues inherent in manual counting. 29 In one study, a systematic and comprehensive compilation of technologies for assessing respiratory frequency is presented, categorized based on the methodology employed for respiratory rate measurement. 30 However, these methods are deemed challenging for the general population to utilize, and their suitability is limited to specific environments. Moreover, accurate calculation of respiratory frequency is considered difficult. Therefore, improvement appears necessary.
This study performs a performance evaluation to assess the suitability of a stretch fiber sensor for respiratory measurement. To evaluate respiration, we optimize the attachment of the fiber sensor to clothing. Subsequently, an adaptive peak detection algorithm is employed for respiratory frequency measurement. Breathing is categorized into regular respiration and fast respiration types (1, 2, 3), and respiratory peak detection is performed based on breathing patterns. Accuracy is assessed by examining the detected peaks. Additionally, for data organization, we propose an optimized method by comparing the existing peak detection algorithm with the adaptive peak detection algorithm, incorporating low-pass and FIR filters.
Materials and methods
Sensor fabrication
The Resistive strain sensor (Kamami Co., Legionowo, Poland) is made of CNT (Carbon nanotube) impregnated rubber. The resistive strain sensor is well-suited for measuring tensile movements, as it operates based on changes in resistance. When tension occurs, the specific resistance of the rubber sensor ( Resistive strain sensor. The attachment method between the sensor and the clothing: (a) schematic; (b) actual photograph.

Figure 4 illustrates the schematic representation and the final appearance of the respiratory sensor garment. The fabric (Hyosung Co., Seoul, Korea) utilized in garment fabrication is composed of PET/SP (92:8), a material well-suited to produce functional apparel. The yarn type used in fabric manufacturing is polyester 75/36, with one filament each of DTY (Draw textured yarn) and polyester 80/48 ITY (Interlaced yarn) used among synthetic fibers. Spandex with a denier of 20 was used, and the fabric density is 153 A respiratory resistive sensor in the shape of a finished clothing: (a) schematic; (b) actual phot.
The specifications of the respiratory sensor are shown in Figure 4.
Data acquisition protocol
Respiration was measured to align with the typical respiratory rate of individuals, ranging between 12 and 20 breaths per minute. In experimental trials aimed at deriving peak points from the data, the frequency and size of breaths were consistently measured without introducing variations. The measurement of respiration relied on monitoring the resistance changes in the strain sensor corresponding to variations in abdominal volume, utilizing an Arduino Uno device. A fixed resistor of 1kΩ was employed, enabling the measurement of analog signals alongside GND and one of the sensor pins. As a result of changes in abdominal volume due to respiration, the strain sensor undergoes length variations, leading to a corresponding resistance change. Furthermore, as the strain sensor stretches during respiration, it fits snugly within the U-shaped tunnel, ensuring a precise junction between the sensor and the garment. This prevents any compression, allowing only changes in length corresponding to the body’s volume. Moreover, since the variation in volume during respiration is less than 10%, the pressure exerted is not significant. In more detail, when inhaling, the abdominal volume expands ( Sensor changes mechanism according to breathing.
Peak detection algorithms
Recognizing peaks in respiratory waves is an essential initial stage in monitoring respiratory activity and can be accomplished through conventional peak detection algorithms. 34 Nevertheless, respiration waves from individuals engaged in spontaneous breathing often exhibit noise, leading to inaccurate peak detections in the presence of noise peaks, 35 thereby elevating false alarm rates. Identifying peaks in respiratory data is both crucial and challenging. Therefore, it is imperative to leverage appropriate methods to address these issues.
Firstly, the proposed method involves utilizing an adaptive peak detection algorithm similar to the conventional window threshold technique36,37 to detect peaks in the original data. This peak detection method first memorizes the position of the first observed maximum (
However, this method necessitates the direct computation of peak points, making it less intuitive. Additionally, the calculation of points is required for each respiratory rate, depending on the breathing frequency. Therefore, the subsequent approach involves using a filtering method with two filters: the low-pass filter and the Finite impulse response (FIR) filter. In the low-pass filter, moving average filtering is also employed. The cutoff frequency of the low-pass filter is set to 1. The formulas for moving average filtering with n data points and the low-pass filter can be seen in equations (3)–(5), respectively. Where
In this study, three peak detection algorithms were executed to extract peak points in normal respiration, and the most optimal method is introduced. All algorithms were implemented using MATLAB 2023a (Mathworks Inc., Natick, MA, USA). Respiratory data was collected by maintaining a stationary posture for 1 minute at the same location. Additionally, peak detection was performed on experimental data with varying respiratory rates for testing purposes.
Results
Characterization of the strain sensor
Stretchability and sensitivity
In a laboratory setting, stretchability and sensitivity were evaluated using a custom Universal Testing Machine (UTM). The relationship between resistance change rate and stretch for the sensor sample is illustrated in Figure 6. Due to the elastomeric nature of the rubber material, it exhibits high stretchability. Considering that the abdominal volume change due to respiration can reach up to 6%, we conducted experiments with a maximum strain of 10%. The results showed no saturation in the measurements up to 10% strain. This indicates that as the abdominal volume increases during breathing, the length of the strain sensor elongates, causing an increase in resistance. To quantify the sensor’s sensitivity, the gauge factor (Equation (7)) was calculated. Unlike typical strain sensors with a gauge factor of around 2, the strain sensor used in this study (70 mm × 1 mm) demonstrated a gauge factor of 4.32, highlighting its superior performance as a strain sensor. In Figure 6, it can be observed that the strain sensor proposed in this study satisfies the required resistance change rate of approximately 40% during maximum 10% tensile conditions, reflecting a consistent tensile rate under room temperature (20°C ∼ 25°C) conditions. Therefore, these findings demonstrate that the sensor is suitable for measuring subtle changes in abdominal volume caused by respiration. Characteristics of the stretchability and sensitivity.

Durability
Experiments were conducted to assess not only the sensitivity but also the crucial factor of stability in the strain sensor. The same UTM apparatus was employed to observe the degree of hysteresis occurring during stretching and release. The strain was consistently set at 10%, and a total of 800 repeated experiments were conducted.
38
Due to the nature of elastic materials, repetitive stretching induces physical length changes, leading to a decrease in the rate of resistance change with each iteration. However, it was determined that this decrease remained within 4%, indicating that stability was not significantly affected even with repeated cycles. This indicates a change that does not significantly impact respiratory measurements. Since actual breathing during respiratory measurements does not occur at a constant size or speed, like the experimental conditions, it is concluded that there are no issues with the performance of the sensor being measured in this study. Figure 7 illustrates these findings. Characteristics of the stability and durability.
Measuring respiratory using strain sensors
Wearing the respiratory measurement garment, we recorded normal breathing patterns. The fixed resistor used for extracting respiratory data is 1 kΩ. The participant maintained a stationary posture for 1 minute during the measurement. Connections to GND and analog A0 were established to enable the measurement of resistance changes corresponding to respiration in analog data. A PC was utilized for power and data monitoring purposes. Figure 8 illustrates the structure along with the process of measurement. (a) Schematic of the universal testing machine. (b) Measurement of respiratory resistive sensor in clothing.
In Figure 9, you can observe the analog data measurement graph for typical breathing. The participants breathed approximately 15 times in 1 minute at room temperature (20°C ∼ 25°C). In this context, the points indicating the breaths were configured by connecting a switch to the Arduino Uno digitally, allowing for a press at the point where the participant took the deepest breath during inhalation. These points are highlighted as red dots in Figure 9. In other words, these points correspond to the moments when the abdominal volume is maximized, indicating the maximum elongation of the strain sensor. Therefore, it can be inferred that the sensor’s length is at its maximum when the signal reaches its peak. Resistive respiratory sensor measurements for normal breathing data.
The data results for normal breathing are output in analog format, represented by values ranging from 1 to 1023. Although the analog data is displayed between approximately 900 and 950 (932 to 945), the original data has been adjusted for focus on the difference in values. This was done by subtracting 900 and multiplying by 100. The variations in normal breathing were measured between 3200 and 4400. Moreover, the graph illustrates that even in normal breathing, reaching the same peak point is not consistent. This observation supports the idea that peak detection cannot be determined solely through threshold settings.
An adaptive peak detection
Adaptive peak detection was employed to identify peaks in respiratory data, including data with varying respiratory rates. As mentioned earlier, this method involves creating windows by defining intervals and finding the maximum point within each window to detect peaks. The sampling rate was set to 100, allowing for the collection of 10 data points per second. For normal respiration, the interval was calculated as 30, and considering the mid-point (15) as the peak, the window size was set to 45 to identify peaks every 45th interval. The results obtained using this algorithm are shown in Figure 10(a). A comparison with Figure 9 reveals that the peaks identified using the algorithm align with the manually marked peaks by the switch with an accuracy exceeding 93%. Additionally, for algorithm testing, the respiratory rate was arbitrarily classified into three levels and applied. The rapid breaths were measured by maintaining the basic posture for 20 s, varying only the respiratory rate. The fast one to three were designed to allow one breath within the range of approximately 0.5 Hz to 0.52 Hz. Consequently, the window size was set to 28 to 30 to extract each peak point. The results are illustrated in Figure 10(b)–(d). Furthermore, the peak detection for respiratory rates 1, 2, and 3, like normal respiration, exhibited an accuracy of over 93% when compared to the peaks in actual respiration. An adaptive peak detection (a) normal (b) fast 1 (c) fast 2 (d) fast 3.
These results demonstrate the potential of the adaptive peak detection algorithm for accurate respiratory rate measurement in noisy breathing data. However, as previously mentioned, adapting the window size based on the respiratory rate poses challenges, and if the data under analysis presents various respiratory rates, the measurement may become difficult. Therefore, the adaptive peak detection algorithm explored in this study is deemed useful for breathing patterns that are challenging to denoise or exhibit a consistent cyclic pattern, including normal respiration.
Filter algorithms
Utilizing a low-pass filter, the peak detection algorithm was employed to extract data representing normal respiration without noise from analog data. The cutoff frequency was set to 1, and a digital switch was concurrently used to mark the point where the user breathes in the most. The peak detection algorithm employed with the low-pass filter was designed to locate local maxima at respiratory peaks. The graph resulting from the low-pass filter is illustrated in Figure 11, demonstrating effective noise reduction in body movements or clothing folds compared to analog data. Figure 11(a) displays data where each breath is indicated by pressing a switch, representing those points as one and others as 0. In (b), the graph shows the result of applying the peak detection algorithm using MATLAB. However, as indicated by the square markers on the graph, a slight lag phenomenon is observed at the points identified by the switch. While such lag is generally acceptable when using filters, it can lead to reduced matching accuracy with the peak detection algorithm. Therefore, by focusing the respiratory analysis and aligning it with the algorithm, a matching rate of 90% is achieved within 1 min, corresponding to nine respiratory cycles. Nevertheless, if precise timestamps of peak points corresponding to actual respiration are desired, addressing the lag issue in the code becomes necessary, which can be cumbersome. In addition, as the breathing rate becomes very fast, the data may not keep up with the breathing due to the mentioned lag issues, resulting in the inability to capture any actual breathing peaks, as shown in Figure 12. The criterion for defining rapid breathing was a respiratory rate exceeding 0.33 Hz. Additionally, the measured data range, utilizing a cutoff frequency of 1, excludes high-frequency components, resulting in measurements ranging from 3300 to 3600. (a) Low-pass filter data versus time and (b) actual respiratory data. The fast-paced respiration measured using the low-pass filter.

To improve upon these aspects, the final filter employed in this study is the FIR filter. The FIR filter determines the most suitable frequency range for the extracted data and adjusts the moving average window size and buffer to apply the moving average calculation to the analog values. In this case, the proposed frequency range for the respiratory data is between 0.2 and 2, with 15 filter coefficients selected for application. The moving average window size is set to 50, while the buffer is proposed to be 0 to prevent data lag issues. The results of this approach can be observed in Figure 13. In Figure 13, like Figure 11, in (a), the graph represents 0 and one by distinguishing the switch’s on and off states, while in (b), it shows the graph obtained using the peak detection algorithm in MATLAB. To facilitate matching with actual respiration, the real respiratory data is concurrently extracted using a switch and plotted on the right y-axis with values of 0 and one to align the respiratory peak points. The results indicate a high matching rate with actual respiration, demonstrating reduced lag issues observed in the low-pass filter. FIR filter-applied respiratory data compared with actual respiratory data.
The measured data range was limited to the frequency range of 0.2 to 2, resulting in the exclusion of low-frequency components, and data were extracted in the range of approximately 4200 to 4500. The graph in Figure 12(b) used the same peak detection algorithm as the one employed in Figure 11(b). The respiratory pattern initially exhibited normal breathing at a rate of 0.33 Hz for the first 20 s. Subsequently, an increased respiratory rate of 0.5 Hz was observed. The matching rate of respiratory rates was observed to be over 98%. While the low-pass filter failed to match any respiratory peaks during rapid breathing, the FIR filter successfully captured them. Additionally, the lag issues prevalent in the low-pass filter were significantly reduced, allowing the FIR filter to identify respiratory peaks even during fast breathing.
Discussion
In this study, we analyzed various peak detection algorithms using a resistive strain sensor integrated into a developed garment. The resistive strain sensor, constructed with CNT material and a flexible rubber substrate, demonstrated high conformity to the curved contours of the human body, making it suitable for capturing movements such as respiration. The strain required for respiration measurement was maintained at a low 6%, ensuring appropriate sensitivity. Through 800 repetitions of 10% elongation, the sensor exhibited a decrease of approximately 4%, demonstrating robust durability for respiration measurement. In garment design, achieving a high level of cohesion and adhesion between the sensor and the fabric is a crucial factor. To address this, we employed a piping technique, creating a tunnel-like structure where the sensor is embedded, securing the fabric both above and below to prevent any undesirable reactions or protrusions caused by the wearer’s movements. The fabric material chosen for this purpose incorporates spandex in polyester to ensure compatibility with the rubber-based sensor. The sensor, designed to be centrally positioned on the abdomen, has a total length of 680 mm based on female measurements. To facilitate connection with the Arduino for data measurement, we utilized a cable with a connector, and to secure the cable, we covered it with the same fabric used for the garment.
Respiratory measurement was conducted using the principle of a typical resistive sensor, where an increase in abdominal volume due to breathing leads to tension in the sensor, causing resistance to rise. Upon relaxation, the resistance returns to its original value (Figure 5). For measurement, an Arduino Uno was employed with a fixed 1k-ohm resistor, and data output was achieved using the analog pin and GND. Breathing was measured for 1 minute with the participant in a stationary standing position. The typical range of analog data recorded for normal breathing falls between 3200 and 4400. To identify the peak points corresponding to actual breaths during measurement, a digital switch was connected, enabling the detection of the point where the participant takes the deepest breath. This was marked as one for inhalation and 0 for no breath.
The collected data were processed using three different peak detection algorithms to identify respiratory rate and peak points. Firstly, the window size algorithm was employed to measure peak points and respiratory rate from the analog data. This algorithm demonstrated a matching rate of approximately 93% with manually calculated breaths in normal breathing (frequency: 0.33 Hz to 0.35 Hz), showcasing the potential for peak point detection and respiratory rate measurement without noise reduction. However, this algorithm requires manual calculation adjustments based on breathing frequency, introducing inconvenience. To overcome this challenge, the second approach involved using a low-pass filter to eliminate noise, setting the cutoff frequency to one to extract data. Although this method established a defined data range between 3300 and 3600, enabling visual differentiation of peak points, difficulties arose due to the inherent data lag in the filter, making matching with actual breaths challenging. Moreover, at breathing frequencies exceeding 0.33 Hz, the lag phenomenon was magnified, resulting in almost no measurement of breaths. Finally, the FIR filter was employed to detect peaks in the data, setting the frequency range between 0.2 and 2. This narrowed the data range to 4200–4500, eliminating low-frequency components. Peak detection using this method exhibited similar results to breathing frequencies up to 0.5 Hz, and a matching rate of over 98% in respiratory rate.
In conclusion, the study demonstrated that selecting an appropriate peak detection algorithm depends on the respiratory situation. The window size algorithm is suitable for situations requiring peak detection with a regular cycle, while the second low-pass filter algorithm is applicable for real-time monitoring of peak observations. The FIR filter algorithm is optimal for situations requiring measurement of respiratory rate with increasing frequency. These results suggest the flexibility of various algorithms depending on the intended purpose. Furthermore, this study primarily focused on static situations without dynamic movements. Future research should include sensor performance experiments adaptable to various scenarios and dynamic respiratory movements, such as bending or twisting, in order to enhance the versatility of respiratory rate monitoring algorithms.
Conclusions
In this study, we explored resistive strain sensors integrated into garments for respiratory rate monitoring, employing various peak detection algorithms. The sensors, designed with CNT material and a flexible rubber substrate, demonstrated suitability for capturing respiratory movements. Our garment design utilized a piping technique for enhanced sensor-fabric cohesion. Three peak detection algorithms were evaluated, with the window size algorithm achieving a 93% matching rate for normal breathing. The low-pass filter reduced noise but faced challenges at higher breathing frequencies. The FIR filter performed well, detecting peaks with a matching rate exceeding 98% even at increased frequencies. Our findings highlight algorithm flexibility based on respiratory scenarios, emphasizing the need for future research in dynamic settings.
Footnotes
Acknowledgments
This research was partly supported by the Technology Innovation Program (or Industrial Strategic Technology Development Program-Materials/Parts Package Type) (20016038, Development of the textile-IT converged digital sensor modules for smart wear to monitor bio and activity signals in exercise, and KS standard) funded by the Ministry of Trade, Industry and Energy (MOTIE, Republic of Korea) and the Korea Institute for Advancement of Technology (KIAT) grant funded by the Korea Government (MOTIE) (P0012770, The Competency Development Program for Industry Specialist).
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the Ministry of Trade, Industry and Energy, (20016038; P0012770).
