## 2 Materials and Methods
### Architecture of Piezoresistive Chest Band Based on Strain-Sensitive Textile
#### 2.1.2 Electronic Conditioning and Processing Section of the Developed Chest Band  
The piezoresistive strain sensor is configured in a voltage divider with a 1 M\(\Omega\) pull-up high-precision resistor to convert the resistance changes due to mechanical strain into a voltage signal. The voltage divider is supplied by 3.3 V, from the piezoresistive elastic band; thus, the output voltage V\({}_{\text{out}}\) is expressed by the following equation:  
\[\text{V}_{\text{out}}=\frac{\text{R}_{\text{piezores}}}{\text{R}_{\text{piezores }}+1\text{ M}\Omega}\times 3.3\text{ V} \tag{1}\]  
During breathing, the chest is subject to undulatory movements related to the inhalation and exhalation phases; therefore, the piezoresistive sensor undergoes alternate tensile stress corresponding to a resistance change (R\({}_{\text{piezores}}\)) acquired by an analog channel of the SAMD21G18 microcontroller (Seeeduino Xiao board) integrated into the onboard electronic section. Before the acquisition, the voltage signal is conditioned by an active bandpass filter (Figure 2a), realized with TL071 opamp (manufactured by Texas Instruments, San Jose, TX, USA), characterized by [44]:  
* Cut-off frequencies equal to about 41 mHz (f\({}_{\text{L}}\)) and 2.5 Hz, respectively;
* Band gain (\(|\text{G}|\) equal to 30 dB (31.62 in linear scale). Figure 2: _Cont._  
This stage is used to remove the DC component from the signal provided by the piezoresistive band; in addition, the filter removes noise and signal components that fall in its stopband, leaving signal components in the passband (from 41.5 mHz and 2.5 Hz). This frequency range allows amplification of the signal related to the respiratory component, featured by a frequency between 0.2 and 0.75 Hz (medium respiration rate). The TL071P is a low-noise operational amplifier [44]; it is characterized by low offset (1 mV, typical) and bias current (\(\pm 1\) pA), and high slew rate (20 V/\(\upmu\)s), and common-mode input to the positive supply. The device was chosen for the considered application since it presents low noise (\(V_{n}=18\frac{\mathrm{mV}}{\sqrt{\mathrm{Hz}}}\), @\(f=1\) Hz) and power consumption (940 \(\upmu\)A). Since the operational amplifier was fed with a unipolar power supply, a DC component equal to half of the supply voltage was added to the information signal. This voltage was derived with a voltage divider realized with two 1 M\(\Omega\) resistors and applied to the opamp non-inverting input. The strength of the proposed system is precisely its ability to perform conditioning, acquisition, and processing onboard the chest band without the need for an external processing unit. Specifically, the resulting signal is acquired by the 12-bit ADC integrated into the SAMD21G18 microcontroller; the latter preprocesses the raw data by a real-time lowpass digital filter. Specifically, a second-order lowpass Butterworth digital filter with a 0.5 Hz cut-off frequency is employed to extract the respiratory signal, thus removing all of the components due to voluntary and involuntary movements. Then, the microcontroller processes the filtered data to determine the breathing parameters, as described in Section 2.2. The acquired data are wirelessly sent in real time to a PC using an onboard BLE transceiver (model JDY-23, manufactured by Jindouyn Electronic Technology Co., Ltd., Shenzhen, China), allowing remote patient monitoring. A primary concern related to medical device communication on the BLE protocol is a man-in-the-middle (MITM) attack, which can occur when a third entity is able to emulate both the wearable and host devices, and thus sniff sensitive data. BLE employs a secure method for exchanging the encryption data, based on the Elliptic Curve Diffie-Hellman (ECDH) algorithm, in addition to AES-CCM, for protecting the communication against MITM attacks [45].