{'fraction_non_alphanumeric': 0.025025503006099018, 'fraction_numerical': 0.010005860265231264, 'mean_word_length': 4.978201634877384, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Wearable radio-frequency sensing of respiratory rate, respiratory volume, and heart rate

Many health diagnostic systems demand noninvasive sensing of respiratory rate, respiratory volume, and heart rate with high user comfort. Previous methods often require multiple sensors, including skin-touch electrodes, tension belts, or nearby off-the-body readers, and hence are uncomfortable or inconvenient. This paper presents an over-clothing wearable radio-frequency sensor study, conducted on 20 healthy participants (14 females) performing voluntary breathing exercises in various postures. Two prototype sensors were placed on the participants, one close to the heart and the other below the xiphoid process to couple to the motion from heart, lungs and diaphragm, by the near-field coherent sensing principle. We can achieve a satisfactory correlation of our sensor with the reference devices for the three vital signs: heart rate (r = 0.95), respiratory rate (r = 0.93) and respiratory volume (r = 0.84). We also detected voluntary breath-hold periods with an accuracy of 96%. Further, the participants performed a breathing exercise by contracting abdomen inwards while holding breath, leading to paradoxical outward thorax motion under the isovolumetric condition, which was detected with an accuracy of 83%.


INTRODUCTION
In addition to the effective treatment of diseases, modern medicine has been extended towards an overall healthier living with improved day-to-day quality of life 1,2 and integrated end-oflife care not restricted to clinical visits 3,4 . This requires novel solutions for noninvasive vital-sign sensing without skin contact that can be integrated effectively into various lifestyles over broad age-groups. Such a technique could potentially help patients of asthma, chronic obstructive pulmonary disease (COPD) 5 , and sleep apnea by continuous monitoring of heartbeat and respiration.
In clinical practices, pulmonary function tests are generally assessed by spirometry 6 and physical examinations 7 . The latter might not require any specialized instrument but is limited by the experience of the physician and is not quantitative. Spirometry provides detailed parameters characterizing lung function but requires attentive participation of the patient with forced breathing maneuvers, and is thus not feasible for continuous long-term measurements, or patients suffering from asthma. Whole-body plethysmography 8 is used to measure absolute air volume in the lungs and breathing resistances without extensive voluntary exercises but still requires some patient cooperation. This poses a challenge for respiratory disorder detection in patients that are unable to follow the instructions due to weakness, coma, or other cognitive failures. Other alternatives for respiratory monitoring 9,10 require calibration for the volume estimate, including nasal probes 11 for airflow information, and strain or inductance belts at thorax and abdomen 9,12 , which need to maintain reasonable tension in all breathing conditions to measure chest-wall motion. Local strain sensors 13 are more comfortable, but require tight skin contact to measure chest-wall motion. Gold-standard heartbeat monitoring uses electrocardiogram (ECG) with multiple adhesive skin-contact electrodes to monitor the electrical activity of the cardiac muscle. Pulse oximetry is a less invasive method of extracting the heartbeat, however, it requires a stable probe in direct contact with the skin [14][15][16] . Other noninvasive and non-skintouch sensing technologies have been proposed, but also with their limitations. Thoracic surface and body vibrations due to heartbeat have been studied in detail using seismocardiography (SCG) [17][18][19] and ballistocardiography (BCG) 17,[20][21][22] , respectively, for signatures under different abnormalities. Both sensors measure either displacement, velocity, or acceleration originated from the heartbeat but observed at the body surface. Film-based displacement sensors may be affected by artifacts from structural vibrations in a moving wheelchair 23 or ambulance. Integrated solutions like smart shirts 24 with ECG, chest belts, and accelerometers can provide detailed cardiopulmonary characteristics, but have a large device form-factor, and are unsuitable for bedridden and geriatric patients where snug-fit clothing and skincontact electrodes are impractical due to concerns of comfort and bed sores 25,26 . Ambient optical 27 and radio-frequency (RF) sensing 28 records surface motion from breathing and heartbeat with limited signal-to-noise ratio (SNR) 29,30 , and requires the reader to be in the line of sight (LoS) to the torso 31,32 . Far-field RF has additional limitations on the maximum number of subjects that can be measured simultaneously 33 . Respiratory volume (RV) is even more difficult to retrieve, as it is affected by body posture and orientation variation 32,34 with respect to the antennas or cameras. Some noticeable work has been done using RF in the near-field region 35,36 that can couple to internal dielectric boundary change to clearly measure respiratory motion, but heartbeat can only be extracted during breath-hold.
Near-field coherent sensing (NCS) 37 is a noninvasive technique that works by transmitting a low-power continuous wave (CW) RF signal into the body with over-clothing antennas. The near-field coupling to the internal dielectric boundary motion results in a direct measurement of the heart, lung, and diaphragm motion, in contrast to surface motion sensors. Detailed high-frequency heartbeat characteristics associated with the S1 and S2 sounds can also be potentially extracted from over-clothing placement 38 . However, a detailed comparison with echocardiogram can help clarify this observation, while a further improvement from possible sensor fusion with SCG and phonocardiogram (PCG) needs to be investigated in future studies. The wearable RF sensor design has high ambient motion tolerance with the receiver placed close to the transmitter, making NCS less affected by environmental changes compared to direct far-field reflection 39 , where ambient motion within the antenna radiation pattern can cause significant interference. Multiple sensors can be placed on the body to couple to both respiratory and heartbeat motion with frequency multiplexing and can be easily extended to monitor multiple people in the same room. Owing to its simple transceiver architecture, this sensor can be readily designed in a small, convenient form factor, as well as made wireless-capable at low cost.
In our earlier work, we have demonstrated preliminary NCS results where RV and respiratory rate (RR) can be estimated with high accuracy for one participant in sitting posture 40 . In this paper, we present a setup to accurately estimate the heart rate (HR) and respiratory effort, including RR and RV, over 20 participants with varying body mass index (BMI) and gender. Further, as RV is sensitive to body posture and breathing styles, we have presented analyses over various postures, as well as during conscious and spontaneous breathing exercises with a large breathing range of 0-45 breaths per minute (BPM) and a resting HR in the range of 50-90 beats per minute (BPM). A short calibration period by a gold-standard pneumotachometer (PTM) was performed for each subject and posture once, and the corresponding model was used on NCS and chest belts for further voluntary breathing exercises.

RESULTS
NCS sensor and test system architecture The NCS sensing approach is based on the near-field coupling of ultra-high frequency (UHF) waves with the nearby dielectric boundary motion. The dielectric composition in the near-field region of an antenna will modulate its characteristics. For a single antenna, this change can be measured from the antenna reflection parameter S 11 . For an antenna pair, this can be derived from the cross-coupling S 21 . As the transmitter (Tx) and receiver (Rx) signal chains are better isolated in the S 21 measurements with less self-interference and higher SNR, we opt to place an antenna pair as part of the NCS sensor to the region of interest, where the intended surface and internal boundary motion can be retrieved after baseband demodulation. Notice that UHF has reasonable penetration into dielectrics in the near-field, and thus the internal dielectric motion during breathing and heartbeat can be locally modulated onto the specific antenna pair. We have placed two NCS sensors on the chest, one below the xiphoid process close to the diaphragm, and another near the heart. These sensors measure the abdomen and thorax respiratory motion as well as the heartbeat, by effectively capturing the geometrical changes in these organs along with other associated muscles. Figure 1a shows the NCS system architecture with sensor placement, data collection and processing flow. It also shows the reference sensors by BIOPAC (BIOPAC Systems, Inc., Goleta, CA), including ECG, chest belts and PTM connected to a facemask. A participant wearing all sensors in the sitting posture is shown in Fig. 1b. Two NCS sensors are held on the body with loosely placed belts. The abdomen sensor is placed slightly below the xiphoid process to be close to the diaphragm, and the thorax sensor close to the heart, so that it can couple both heartbeat and lung motion. These lightweight and small sensing units consist of RF Tx and Rx antennas connected to the software-defined radio (SDR) transceiver ( Fig. 1c) to perform NCS measurements with a low RF power of less than -10 dBm (Fig. 1d), well under the safety limits set by occupational safety and health administration (OSHA) 41 .
The acquired BIOPAC and NCS signals are processed to estimate RV, RR, and HR statistics. The normalized BIOPAC thorax and abdomen chest-belt signals are shown as reference in Fig. 2a. Figure 2b shows normalized unfiltered NCS data from thorax and abdomen sensors, with strong respiratory motion modulation. Heartbeat is also modulated clearly on the NCS thorax waveform and can be properly filtered to remove respiratory motion. Supplementary Fig. 1 shows the filtered heartbeat waveform from NCS and the HR extraction techniques under motion artifact.

RV calibration model
A calibration model is developed to estimate RV from NCS and chest belts in various postures and breathing conditions using airflow estimates from the pre-calibrated PTM connected to a facemask (Fig. 1b). While PTM is a kind of spirometer, we have referred to it as such to state explicitly that the airflow is estimated from the pressure change. The facemask design includes a separator between nose and mouth and is tightly strapped on to minimize any air leakage from the mouth. Participants are requested to inhale and exhale by mouth only, and they can feel rather uncomfortable during PTM measurements. Thus, PTM is removed from the participant except during the short initial calibration routine of 30 s, with 15 s of each normal and deep breathing. Instantaneous volume is computed by integrating the airflow rate for each breath cycle to get Vol PTM . Waveforms from both BIOPAC chest belts and filtered NCS respiration waveforms are then calibrated by the least-square fitting of linear relation: where Resp Th and Resp Abd are thorax and abdomen respiratory waveforms, respectively. Figure 2c shows PTM airflow waveform during the calibration, with the corresponding Vol PTM and calibrated NCS and chest-belt volumes in Fig. 2d. RV is defined as the volume of the air exchanged during each inhalation and exhalation and is calculated as the peak height of each breath cycle. Figure 2e shows estimated RV from chest belts and NCS data shown in Fig. 2a, b, which have similar trends but NCS has shown more minute variations. This is consistent with Fig. 2d around 18 s, where the small perturbation in airflow is captured by NCS but not chest belts. For RV calibration, as the posture can affect the breathing pattern and lung capacity, separate calibration is necessary 12 for supine, lateral recumbent, and sitting postures for each participant. As the chest circumference has a significant variation across different postures, BIOPAC chest-belt tension requires readjustment to accurately measure respiration. The NCS sensor, on the other hand, only requires stable placement in the near-field region and does not require changes across different postures. Furthermore, during the sitting posture, we performed two more experiments with participants in relaxation and attention-task states without additional calibration. Frequent involuntary posture changes were observed during both states, either for comfort or in response to task failure or success. With these posture changes, tension-based BIOPAC belts inclined to move toward a stable, minimal-circumference position, i.e., lower for the thorax and upward for the abdomen belt, resulting in loss of tension and erroneous measurements. As the NCS belts and sensors were loosely placed, a posture change could cause the antennas to move closer or further away from the body, thus scaling the waveform amplitude. RV of BIOPAC and NCS during the known normal breathing sections were tested to apply a scaling correction. Detailed correction steps are discussed in the "Data Processing" section.
Overall statistics With tests in multiple postures and under different breathing exercises, we have performed analyses of 100 experiments, with over 590 min of total recorded data for 20 participants. Figure 3 shows the results across all three postures, with different breathing styles. We can achieve a high correlation of NCS and BIOPAC for RV ðr RV ¼ 0:84Þ, RR ðr RR ¼ 0:93Þ, and HR ðr HR ¼ 0:95Þ, as shown in the scatter plots in Fig. 3a-c. We have employed the Bland-Altman (B&A) plot to quantify the agreement between NCS and BIOPAC, both of which may have errors. This agreement is estimated by the mean ðmÞ and standard deviation ðσÞ of the measurement differences. B&A plots can also identify possible outliers visually by a XY scatter plot, with the Y axis as the pairwise difference, and the X axis as the mean of the two measurements. The systematic bias is estimated as the mean difference m, and limits of agreement (LoA) within which 95% of the differences are expected to lie, are estimated as LoA ¼ m ± 1:96 Á σ, assuming a normal distribution. Variation over breathing patterns As breathing is a hybrid voluntary-autonomous process, we have collected data during both conscious and spontaneous states. During conscious state, participants performed guided normal, The normalized BIOPAC chest-belt signals (a) and normalized unfiltered NCS signals (b) showing respiration waveforms during tidal (normal) breathing. The NCS thorax signal shows strong heartbeat motion as well. c The PTM airflow signal with detected inspiration and expiration start points. d The extracted instantaneous volume Vol PTM (dotted green) from the airflow, and calibrated chest belts (blue) and NCS (dashed-dotted red) respiration volume waveforms. e-g The analysis of the data shown in a and b; e and f show RV and RR, respectively, from NCS and BIOPAC chest belts; g shows the HR from NCS and BIOPAC ECG.
deep, fast breathing and breath-holds. For the spontaneous tests, no breathing instructions were provided and instead, participants were first asked to relax and then execute an attention-engaging task. As performing the task required the participants to be seated, spontaneous breathing tests were performed only in the sitting posture. Figure 3 showed the results over all the experiments with breathing styles denoted by different markers. As normal breathing is similar to spontaneous breathing, most of these points are overlapped. The fast breathing pattern is centered around the instructed 40 BPM in the RR plots. Deep breathing is indicated by low RR around 6 BPM, as well as high RV. These points are also spread out with a low correlation between NCS and chest belts, possibly due to data distortion from the large motion, resulting in nonlinear strain gauge response, as well as NCS sensor motion relative to the body. Breath-hold periods have low RR at the beginning of the hold period and may also be accompanied with deep breaths after the long holding period, thus are seen closer to the deep-breathing points in both RV and RR plots. Zero RR is not marked, but these periods are treated separately during the breath-hold detection stage. Supplementary Fig. 2 shows an example of one participant following the conscious breathing protocol in the supine posture, and the extracted RV, RR and HR over time with consistent observations. Table 1a compares the correlation and B&A statistics for different breathing patterns. The relaxation state with spontaneous breathing shows the highest correlation of NCS and BIOPAC sensors for RV and HR estimates, close to conscious normal breathing results. This could be due to the regular breathing pattern with few motion artifacts. In comparison, participants tended to move in response to stress during the attention test, leading to motion artifacts.
Variation over postures Adjusting body postures can lead to RV variations, as respiratory mechanisms are affected by different resistance or compliance of the lung and chest-wall components. Thus, we performed tests with the guided breathing protocol in three postures: laying on a bed in supine and left lateral recumbent postures and sitting in a chair. The average reference RV, calculated over all 20 participants during the identical protocol of voluntary breathing exercises, is observed to be highest at 329 mL in the supine posture, followed by sitting and lateral recumbent at 317 and 263 mL, respectively. The RR has the opposite trend with average RR of 17.3, 19, and 19.5 BPM in supine, sitting, and lateral recumbent postures, respectively. The average HR is highest during sitting at 67.6 BPM, compared to 65.3 and 63.8 in supine and lateral recumbent postures, respectively. These results are summarized in Supplementary Table 2. The detailed statistics for each posture are shown in Table 1b. Good correlation is observed across all the postures,  with supine showing the least bias (m) for RV and RR estimates with narrow LoA (small σ), possibly due to the stable posture. No other clear trend is observed, indicating that the estimates are more sensitive to breathing types and patterns than to the posture. Supplementary Fig. 3 shows the correlation and B&A plots for different postures, both with and without the simulated breathing exercises.
Breath-hold detection accuracy Each participant was instructed to perform two breath-holds in both supine and lateral recumbent postures for a maximum duration of 20 s, simulating central sleep apnea (CSA), which is indicated by breath cessation for at least 10 s 42 . A simple detection algorithm was implemented based on the inspiration peak-topeak interval. Overall, both NCS and BIOPAC performed well for breath-hold detection, as shown in Table 2, which shows both sensors detected 74 cases out of 80 annotated cases, with each missing 3 non-overlapping instances. The errors possibly originate from the participant's incompliance to the breath-hold protocol. Small torso motion is coupled differently to the two sensors, leading to incorrect peak detection during breath-hold. Supplementary Fig. 4 shows the NCS and BIOPAC respiratory waveforms with detected peaks during breath-holds for representative good and poor cases.
Paradoxical abdomen-thorax motion detection accuracy To test the separate thorax and abdomen motion, the participants were asked to perform an isovolumetric abdomen exercise while holding breath. With no airflow, the inward abdomen contraction results in outward motion of the thorax, as the total lung volume is conserved 43 , simulating paradoxical abdomen-thorax motion similar to obstructive sleep apnea (OSA) with complete closure of the airway. We used the slope-product of thorax and abdomen respiration waveforms to detect paradoxical motion in BIOPAC and NCS waveforms, as shown in Fig. 4, where three instances of isovolumetric maneuver are successfully detected by both the sensors. While some participants were able to successfully perform breath-hold and abdomen contraction, anomalous instances when paradoxical behavior was not observed can be attributed to the following possible reasons. (1) Placement sensitivity of sensors: the BIOPAC thorax belt placed near the xiphoid process may be coupled to the abdomen motion, and similarly the NCS sensor can be coupled to the accessory muscles. Cross-coupling between the two motions will reduce the paradoxical motion detectability.
(2) Participants were unable to perform the isovolumetric exercise correctly during the intended period while following the breath-hold constraint. (3) The signal is lost due to sensor instability during the large chest circumference change resulting from the abdomen contraction. Overall, the algorithm was designed to be able to detect even slight paradoxical motion, resulting in the similar performance of both sensors as shown in Table 2. Both NCS and BIOPAC can detect 42 out of 58 instances, with fewer missed cases for BIOPAC (6) than for NCS (9). Supplementary Fig. 5a, b show two examples of poor detection for NCS and BIOPAC, respectively. While the algorithm performs well, as seen in these figures, it is more sensitive to baseline drift and other motion artifacts. Thus, sensor placement needs to be further investigated for robust paradoxical motion recognition.
Motion interference with NCS Our wearable NCS sensor setup has a high tolerance for ambient motion interference. As shown in Supplementary Fig. 6, there is no interference from a nearby walking person on the NCS data, due to the strong near-field coupling. Additional tests are performed with the motion of different body parts during breath-holds, as shown in Supplementary Figs. 7 and 8. There is no effect of hand motion on BIOPAC sensors, nor the NCS sensors unless it is very close to the antenna pair. ECG becomes noisy with the hand motion, likely due to electromyogram (EMG) interference. During arm motion, both BIOPAC thorax and abdomen belts show signal anomalies, while only the thorax NCS is affected. Additional studies are required to examine internal muscle motion interference resulting from near-field coupling, and separate the external arm motion coupling, as abdomen NCS still shows clear signal without any interference. While external motion causes limited interference, large spurious torso motion results in motion artifacts. Respiratory measurements from BIOPAC chest belts can be interfered with belt displacement due to body movement, and an entire signal segment can be missed if the participant performs heavy or forced exhalation that leads to loss of tension. NCS waveforms are prone to motion artifact due to the current antenna pair packaging, which is loosely placed over the clothes with semi-isotropic radiation patterns. Free antenna movement relative to the body surface may result in signal artifacts, making NCS well-suited for static and quasi-static conditions, for example, when a person is typing, driving, or sleeping.  As errors in either BIOPAC or NCS respiratory data will result in inconsistent RV and RR, which reduces the reported accuracy, data quality score is defined, where poor respiration data quality intervals are rejected. Similarly, poor heartbeat data is also discarded based on NCS data quality. Further quality estimation details are discussed in the "Data Processing" section.

DISCUSSION
Following the prescribed routines, the subjects performed breathing exercises with large RR variation, from breath-holds and slow deep-breathing around 6 BPM to panting around 40 BPM. Our sensor and algorithm can achieve high accuracy under these large variations, with no special clothing or environmental requirements, thus promoting the applicability in real-life conditions for continuous monitoring of healthy subjects. A brief comparison with other noninvasive techniques focused on respiration is presented in Table 3. Different statistics are reported, including percentage accuracy and root mean square error (RMSE), apart from the ones used in this paper, r, m, and σ. Our proposed NCS method provides a good estimation of both heart and respiratory motion characteristics with increased user comfort. The accuracy tolerance for a well-calibrated gold-standard spirometer is ±3% 6 . For example, a quiet breath of 0.4 L will be measured as 0.4 ± 0.012 L, and a deep breath of 2 L will be measured as 2.0 ± 0.060 L. Table 1a shows the σ for different breathing patterns, with low values in spontaneous normal breathing conditions, σ Relax ¼ 0:065 L, σ Attention ¼ 0:097 L, and σ Normal ¼ 0:089 L during the breathing protocol. While these values are higher than acceptable clinical values, they can be utilized for preliminary analysis where quantitative evaluation of respiratory efforts including both RR and RV along with HR is helpful, especially for geriatric patients with low cognitive function, where dyspnea information can only be currently determined from self-reporting or a caregiver's visual observation 44,45 .
The limitations of the current setup include data distortion due to antenna motion relative to the body, sensor placement sensitivity and arduous calibration requirements. The former issue of antenna motion can be readily resolved by improved antenna packaging and garment integration of the antenna with conductive fibers 46 . While sensor placement requirements are less stringent for most routines, it becomes more important for accurate paradoxical abdomen-thorax motion monitoring, as NCS sensor coupling to diaphragm and lungs is observed to be position sensitive and needs to be carefully deployed. Our calibration protocol requires participants to breathe only through the mouth while wearing a facemask for a brief duration. This calibration is mainly to give an absolute scale in RV and can be omitted if the percentage volume change is sufficient.
Additionally, the NCS sensor with its small form-factor and simple transceiver architecture can be incorporated inconspicuously into the fabric with an improved wireless design and can be worn over multiple layers of clothing without requiring any direct skin contact. We have used frequency division for multiplexing two sensors, which can be easily extended to place more sensors at different locations on the body, as well as on multiple people simultaneously. The Tx signal can be further modulated with a unique pseudo-noise code known to the corresponding Rx. These design options in NCS provide higher signal isolation against ambient interferences and inter-sensor collision than implementations based on the direct far-field RF and optical sensors. The detailed respiratory and heartbeat characteristics also open other areas of applications, including cough monitoring, stress detection, and overall ambulatory healthcare monitoring.

Hardware setup
The NCS sensor prototype is implemented by an Ettus universal software radio peripheral (USRP) B200mini 47 SDR, with monopole helical antennas  13 On-skin strain sensor (Taoglas TG. 19.0112), packaged in a three-dimensional-printed case, as shown in Fig. 1c. The relative antenna placement is designed to adjust the direct Tx-Rx coupling and enhance the sensitivity to the reflected signal from internal organs. Two SDR units are multiplexed by frequency, with the carrier frequencies of 1.82 and 1.90 GHz. This setup is a variation of the previous multiple-input multiple-output (MIMO) implementation 40 to improve sensor stability and participant comfort. The baseband tone is set at f BB = 51 kHz, sampled at 2 10 6 samples per second (Sps), where the quadrature baseband signals I t ð Þ and Q t ð Þ are simple sinusoidal tones. The intended motion is modulated on the IQ amplitude (NCS amp ) and phase (NCS ph ), and can be extracted as, where θ 0 is a constant phase offset including the initial phase and accumulation from the Tx-Rx path and cables. While both amplitude and phase contain the modulated motion, their coupling strength varies with the sensor placement, which provides further resistance to noises when both magnitude and phase are included for further analysis. Additional studies are needed to clearly understand the coupling tradeoffs. For this work, we opted to use the best reference-correlated signal during the calibration phase for both thorax and abdomen sensors. For respiration, chest-belt signals are taken as reference, and for heartbeat, bandpass filtered (0.9-1.8 Hz) ECG signal is taken as the reference. The final demodulated data is sent to the control computer by a universal serial bus. The Tx powers are À12:84 dBm and À10:42 dBm for the thorax and abdomen, respectively, as shown in Fig. 1d, significantly below the allowable OSHA radiation exposure limit 41 . Reference measurements are performed by BIOPAC sensors, including a 3-lead ECG SS2LB, two torso belts SS5LB and PTM SS11LB, placed as shown in Fig. 1a, b. The pre-calibrated PTM measures the airflow rate in L/s from the mouth using a facemask and is only placed on the subject for short calibration periods. For the remaining breathing exercises, reference respiration is only recorded by two belts placed at thorax and abdomen that measure the change in local tension. During the experiment, male participants wore the thorax belt at 2-3 cm below the armpits, while female participants wore the belt below the breasts, close to the xiphoid process and costal margin, considered as the dividing line between the rib cage and abdomen. This placement is selected for belt stability and user comfort. All sensors are connected to a 4-channel data acquisition unit BIOPAC MP36R 48 .

Participants and protocol
The human study protocol was approved by the Cornell Institutional Review Board (IRB), and participants provided written informed consent to take part in the study. Twenty-five healthy participants with no known history of cardiopulmonary diseases were recruited and instructed to follow breathing routines to the best of their abilities, without overexerting, in a sequence of three postures: supine, left lateral recumbent and sitting upright in a chair. The instructions were provided to the participants in real-time using LabVIEW in both audio and visual formats. The data collection was carried out in a standard laboratory room with drywalls and supporting metal frames, without any radiation-absorbent material. The environment consisted of standard furniture, including a bed, desks, and chairs, along with computers and various units of laboratory equipment. The participant attire was not controlled, and the NCS sensors were placed over their daily clothing, including shirts and loosely fitted hoodies made of different fabric materials. Five participants' data was rejected due to poor calibration data in any one of the three postures, which showed inconsistency due to either an inability to follow the mouthonly breath instruction or from the loose placement of the facemask that caused air leakage.
A fixed breathing protocol of~6 min was executed in each posture after calibration, which included: 1. Normal breathing for 120 s. 2. Deep breathing for 60 s.
3. Fast breathing for 30 s. 4. Normal breathing for 30 s. 5. Breath-hold for maximum 20 s, followed by normal breathing for 20 s. Repeat once. During normal or tidal breathing, no inhalation or exhalation instructions were provided, but the participants were asked not to take any deep breaths or long pauses. During deep breathing, real-time instructions were given to start inhaling and exhaling with fixed durations of 4 and 6 s, respectively, which gave a RR of 6 BPM. Similarly, instructions were given for fast breathing at a rate of 40 BPM, with equal time for inhalation and exhalation. These instructions were provided as a guideline, and participants were advised to perform normal breathing if they felt uncomfortable during any of the routines, resulting in some variations around the expected rates. The procedure was clearly explained to the participants, with short examples for practice, before recording the calibration and main routines.
For observing separate thorax and abdomen motion, the participants were asked to perform the isovolumetric exercise with the following steps during breath-hold: contract the abdomen inwards, maintain the position for 3 s, then relax abdomen back to normal. Three such maneuvers were performed, separated by normal breathing intervals of 10 s to simulate paradoxical abdomen-thorax motion as observed in OSA. As this motion is difficult to perform without extended practice, this exercise was only performed in the sitting posture, so that the participants could learn the motion, while looking at their real-time NCS waveforms.
With the participants continued to be seated in a chair, an additional series of exercises were performed to test the breathing patterns in the relaxation state and under the given attention-engaging task. The participants were asked to close their eyes and relax for 5 min. This relaxed period allowed free-breathing over time without any instructions, thus increasing the likelihood of non-voluntary tidal breathing. The next routine was designed using PsyToolkit 49,50 to render the participants under an attentive and cognitive task, where they watched and reacted to anomalous jumps of an on-screen rotating clock hand by pressing the space bar. Instantaneous feedback was given by flashing an on-screen indicator light of correct keypress, to ensure continuous attention. This routine was performed for 6.5 min and rendered non-voluntary breathing patterns under fast temporal variations due to induced stress. Both routines utilized the RV calibration from the previous sitting posture.

Data processing
The synchronization among NCS and BIOPAC sensors is achieved by system time stamps and improved by maximizing the correlation between respiration data from two measurement systems, resulting in synchronization on the order of hundreds of ms (<1 s). The data collected from both sensors is downsampled to 500 Sps before further analysis in MATLAB.
Peak detection. For peak detection, a moving average-crossing algorithm 51 is implemented, which is effective for signals with varying amplitude and frequency characteristics, such as the respiration signal here with the RR in the range of 0-45 BPM, without any manual tuning. A moving average is estimated at every point using a given window length, resulting in a moving average curve (MAC). This window length is selected to have approximately one respiratory cycle in each window and is constantly updated by taking Fourier transform over a fixed period to estimate the RR. The points where MAC crosses the original signal are labeled as intercepts and are classified as up or down intercepts for positive and negative slopes, respectively. Finally, a maximum is marked as the maximal point between two up-down intercepts and a minimum is also marked similarly. This algorithm is used in the estimation of all the three parameters: RV, RR and HR.
RV estimation. PTM measures the airflow rate, from which the beginning of each inhalation and exhalation points are identified by a simple zerocross detection algorithm, based on the change of sign before and after the zero-crossing points, and the slope at these points. Integration is performed over each inhalation and exhalation cycle to get the instantaneous air volume, Vol PTM , without aggregating a bias over time. Least-square fitting is performed for solving Eq. (1) by a trust-region algorithm with bounded constraints of a,b > 0. RV is estimated as the average volume exchanged in each respiratory cycle over a window of 15 s, with at least two peaks in the window to get a robust estimate.
Owing to sensor motion over time, mostly resulting from a posture change, the estimated RV may deviate from its original calibration. An additional P. Sharma et al. corrective step is performed if the estimated RV during normal breathing section of the breathing exercise routine RV Normal ð Þ Routine , deviates more than ±5% from the calibrated RV Normal ð Þ Calibration , derived from the first 15 s of calibration. The NCS and BIOPAC RV is multiplied with a corresponding scaling factor (SF) given as RV Normal ð Þ Calibration =RV Normal ð Þ Routine , assuming the normal breathing routine has nearly constant RV for the same person over time. To validate this correction, an additional RV calibration consistency study was conducted on one subject over three consecutive days in the sitting posture. The subject performed the calibration, immediately followed by the voluntary breathing exercise routine. Supplementary Table 3 shows the detailed results, with RV before scaling correction, and the required SF to improve the match when using day-1 calibration for all successive days. The RV Normal ð Þ Calibration lies within a narrow range of 0.37-0.43 L, showing consistency in normal breathing volume for a healthy individual over time. Little scaling is required to correct RV when calibrated immediately before the routine, resulting in scaling factors close to 1 on day-1. Variations in sensor placement and coupling strength result in scaling factors other than 1 to correct the RV for the next two days. Supplementary Fig. 9a, b show instantaneous volume and RV estimated on day-2 using day-1 calibration, with NCS underestimating and BIOPAC overestimating the expected RV Normal ð Þ Calibration = 0.37 L, derived from day-1. The corrected scaled RV in Supplementary Fig. 9c shows improved agreement of NCS and BIOPAC to each other, as well as to the calibration value. As SF assumes accurate RV Normal ð Þ Calibration , some error may be introduced from inconsistencies in the calibration and correction process, including variation due to small calibration duration, difference in resistance when breathing through the mouth, and change in RV Normal ð Þ over time. The correction assumes knowledge of normal breathing period, that can be potentially identified based on the normal RR and HR range of an individual.
We have also studied the influence of different simulated airway resistances on RV by introducing two resistances: (1) KN95 mask covering face and mouth while breathing normally through the nose, and (2) straw with a 4 mm inner diameter while only breathing through the mouth. The extracted instantaneous volume, RV and RR from chest belts and NCS are shown in Supplementary Fig.  10. RV calibration was performed before the entire routine. While breathing through mask does not show any noticeable change in RV and RR estimates, breathing through straw shows decreased RV towards the beginning with constant RR, followed by an increase in RV with decreased RR. This opposite RV and RR behavior indicate the increased respiratory effort required due to the resistance offered by the narrow straw. The consistency of RV between the NCS and BIOPAC suggests that the respective calibration remains reasonable within the tested range of varying simulated airway resistance.
RR estimation. The NCS signal is bandpass filtered with the cut-off frequencies of 0.05 and 0.8 Hz to derive the respiration waveforms from both the sensors. As the diaphragm and resulting abdomen motion is usually larger, the respiration waveform from the abdomen NCS sensor alone is used to estimate RR. This sensor also has a weaker heartbeat coupling, and thus filtering requirements are less stringent during fast breathing and breath-hold. Similarly, the BIOPAC abdomen belt is also used to estimate RR with the same algorithm. RR is calculated as the number of detected breath cycles over the maximum window of the past 15 s. For each window, the number of cycles is calculated as the number of inhalation peaks minus 1, and the total time is the interval between first and last inhalation peaks. If no complete cycle is detected during the entire window, the RR is marked as 0. Figure 2f shows calculated RR from NCS and BIOPAC during a normal breathing section, between 12-17 BPM. Supplementary Fig. 2d shows estimated RR over varying normal, deep and fast breathing and breath-holds, in the range of 0-45 BPM.
HR estimation. The heartbeat waveform is modulated strongly on the thorax sensor and can be separated from the respiration by proper filtering. However, during the fast breathing exercise, the RR can be around 40 BPM, close to the HR, resulting in filtering ambiguity. Therefore, we have used the second harmonic of the heartbeat waveform ( Supplementary  Fig. 1) to estimate the peak-to-peak heartbeat interval with reduced interferences from respiration and motion. The Fourier transform is used to first estimate the approximate HR, which guides the filtering to retrieve the second harmonic with a bandwidth of 0.8 Hz. The same peak detection method is then used to find peaks of the second-harmonic waveform. Instantaneous HR is estimated as an inverse of each heartbeat interval, taken as the sum of two neighboring peak-to-peak periods, as shown in Supplementary Fig. 1. This HR is averaged over a window of 10 s to suppress any outliers. The reference HR is estimated from the ECG waveform with bandpass filtering between 0.4 and 20 Hz, which removes any baseline drift and suppresses the low-frequency P and T waves. The sharp QRS complex peak is then detected with a simple slope-based peak detection algorithm. Figure 2g shows the average HR by both the sensors. Supplementary Fig. 2b shows the strong heartbeat modulated on the thorax NCS sensor while performing different breathing exercises, especially visible in the breath-hold periods, with the corresponding HR from both sensors in Supplementary Fig. 2e.
Breath-hold detection. This is based on estimating the time interval between two peaks at the end of inspiration, which consists of one exhalation and one inhalation duration. True detection is marked if a breath-hold period is larger than a fixed duration in the annotated breathhold period, otherwise a missed detection is marked. To simulate CSA characterized by repeated interruptions in breathing during sleep 42 , we used our breath-hold data collected in supine and lateral recumbent postures, with participants performing two consecutive breath-holds in each posture, separated by normal breathing periods. For consistency, the same algorithm is used to estimate the numbers of pauses from both BIOPAC abdomen belt and NCS.
Paradoxical abdomen-thorax motion detection. Isovolumetric exercises lead to opposite slopes of thorax and abdomen respiration waveforms during abdomen contraction and relaxation periods, denoted by a negative product of instantaneous slopes, which are scaled to [−1, 1] using a tanhðÞ function before estimating the product, then movingaveraged over a window of 1 s and thresholded (<0) to give the detected instances. The ground-truth window is manually labeled, and a true detection is marked if it overlaps with the detected periods, otherwise, a missed detection is marked. As the slope sign is independent of waveform scaling, this detection does not require PTM calibration. Fig. 5 The quality score for respiration and heartbeat waveforms with motion artifact instance between 60-80 s. A fixed, empirically selected threshold is used to reject poor data, given by a low quality score. a Normalized NCS thorax and abdomen respiration waveforms. b Respiration quality score in the range [0,1], showing poor quality with a score less than the threshold (0.4). c Normalized filtered NCS heartbeat waveform modulated on the thorax sensor, with most of the artifact filtered out. d Quality score normalized by tanhðÞ in the range [−1, +1]. A low threshold of 0 is selected, as the second-harmonic method used for heart rate estimate provides even higher motion tolerance.
Data quality estimation. Different approaches are followed for respiration and heartbeat data quality estimation.
(1) Respiration data quality: As thorax and abdomen sensors are independently placed, motion artifacts may be present differently, leading to a poor correlation between the two measurements. Also, data from NCS and BIOPAC chest belts can show dissimilar artifacts, with both or only either one of them showing the artifact. Thus, correlations between thorax and abdomen chest belts, and NCS and chest belts for both thorax and abdomen are calculated with an epoch duration of 5 s. Final data quality is taken as an absolute of the product of all these correlations, with higher values indicating better quality, as shown in Fig. 5a, b. A fixed threshold is empirically selected, below which the RR and RV estimates are discarded.
(2) Heartbeat data quality: As the NCS heartbeat waveform is only extracted from the thorax sensor, a different artifact detection algorithm is used, similar to that presented in our previous work 52 . An outlier detection algorithm based on one-class support vector machine (OCSVM) 53 is implemented to detect artifacts in the filtered heartbeat waveform. To speed up signal processing, the motion detection algorithm is implemented on a window of 4 s. The algorithm is trained on the entire routine and a window is marked as an outlier if the tanhðÞ normalized score is <0. Figure 5c, d show the filtered heartbeat waveform from the NCS thorax sensor and the corresponding score, respectively. For ECG waveforms, QRS complex peaks are less sensitive to noise, and thus no separate artifact detection is implemented. HR estimation is discarded if the window contained any poor-quality period.

Reporting summary
Further information on research design is available in the Nature Research Reporting Summary linked to this article.

DATA AVAILABILITY
The collected and analyzed data sets during the current study are available from the corresponding author upon request.