characteristics of the db4 basis function with the ECG
waveform.

- Using wavelets to remove noise from a signal requires identifying which components contain the noise, using optimal methods to threshold them, and then reconstructing the signal using the thresholded coefficients.

The prepocessing phase finally deals with the QRS detection. The main features that should be calculated: the Interbeat (RR) interval and the Heart Rate Variability (variation in the beat-to-beat interval). For the Inter-beat (RR) interval, two methods have been explored
- Filtering the ECG signal with continuous (CWT) and fast wavelet[3] transforms (FWT)1.

- Following Pan-Tompkins[4], wavelets are used to remove noise from a signal requires identifying which component or components contain the noise, using optimal methods to threshold them, and then reconstructing the signal using the thresholded coefficients2.

All the previuos features are extracted from ECG signals.

For COPD patient also the Respiratory Rate is a fundamental parameter that need to be analysed. In order to calculate the respiration rate using the reference respiration signal, a dominant frequency detection algorithm, based on short-time Fourier transform (STFT) [5], is applied.

The STFT is a localized Fourier transform, utilizing a Hamming window:

$$STFT(f(t))=STFT(\omega,\tau)=\int_{\infty}^{\infty}f(t)w(t-\tau)e^{-j\omega t}dt\tag{1}$$

were w(t) is the window function, commonly a Hann window or Gaussian hill centered around zero, and f(t) is the signal to be transformed. Because frequency components of the respiration signal are very low (¡2Hz), a window size of 60 seconds is selected.Every 60s, the hamming window is multiplied to the respiration signal, and the result is transformed to the frequency domain using Fourier transform. The dominant frequency is then detected by finding the maximum amplitude of the spectrums. When the dominant frequency components are found, inverse numbers are calculated in order to obtain the respiration rate. After this first preprocessing phase for COPD
patients we wil now analyse the which kind of Features are extracted.

## B. Features Extraction For Copd Patients

From the Inter-beat (RR) interval and the Heart Rate Variability, several features can be extracted, either in time or in

frequency domain.

Dealing with Time domain the values extracted are 1) SDNN(msec): Standard deviation of all normal RR
intervals in the entire ECG recording using the following

$$s d n n={\sqrt{\frac{1}{n}\sum_{i=1}^{n}(N N_{i}-m)^{2}}}\qquad\qquad(2)$$

where NNiis the duration of the i-th NN interval in the analyzed ECG, n is the number of all NN intervals, and m is their mean duration.

2) SDANM(msec): Standard deviation of the mean of the normal RR intervals for each 5 minutes period of the ECG recording.

3) SDNNIDX (msec): Mean of the standard deviations of all normal RR intervals for all 5 minutes segments of the ECG recording.

4) pNN50 (intervals that are greater than 50 msec, computed over the entire ECG recording.

5) r-MSSD (msec): Square root of the mean of the sum of the squares of differences between adjacent normal RR intervals over the entire ECG recording the formula is
$$r M S S D={\sqrt{\frac{1}{n-1}\sum_{i=1}^{n}(N N_{i+1}-N N_{i})^{2}}}\quad(3)$$
$i$ th $NN$ integer. 
where NNi is the duration of the i-th NN interval in the analyzed ECG and n is the number of all NN intervals.

If we now move to the frequency domain the Feature Extraction on the PDA studies two bands:
1) The Low Frequency band (LF), which includes frequencies in the area [0.030.15] Hz. 2) The High Frequency band (HF), which includes frequencies in the area [0.150.40] Hz.

If we now move to the Respiration signal several features can be extracted either directly or indirectly we focused on:
1) Respiration Rate: The number of breaths per minute.

2) Tidal Volume (VT): The normal volume of the air inhaled after an exhalation.

3) Vital capacity (VC): The volume of a full expiration.

This metric depends on the size of the lungs, elasticity, integrity of the airways and other parameters, therefore it is highly variable between subjects.

4) Residual volume (VR): The volume that remains in the lungs following maximum exhalation.

After all the preprocessing phase of the data gathered by the weareable devices, all these information are passed to a Classification System. The classification system is responsible for the analys of the outcome from the preprocessing phase for the COPD patients and of the data gathered by the external devices and questionnaries inputted by the patient himself. Below we will see how the software is used to transform all these rich set of data in an information to be, in case, transmitted real-time or scheduled to the Monitoring Framework.