## 4 Discussion  
In the current study, the experimental tests showed that the proposed in-bed solution allows us to obtain a robust estimation of both subject position and breathing rate that are estimated by using the signals of the PML combined with tailored algorithms. It is important to note that our approach is completely nonobtrusive and transparent for the subject. In addition, the proposed PML and electronic platform is a low-cost system and is suitable for large distribution and massive use in general population. Regarding subject position/motion classification, this study found that the best automatic classifiers was a ANN with an overall accuracy of 86.1% for the test set and 94.0% considering all the datasets. The most critical condition to recognize is the prone position (with a sensitivity of 76.5% and precision of 54.2%); for the other conditions, the sensitivity and precision are greater than 83% and 76%, respectively. Contrary to expectations, the movements of the subject are well recognized, with a sensitivity of 83.1% and precision of 93.6%. This finding was unexpected because the movements are the sequence of several different positions, and we have supposed that this could cause critical issues for the ANN classifier. With regards to the breathing rate, the PML combined with the proposed algorithm show qualitative and quantitative results with respect to the reference estimation obtained with a nasal cannula. In Figure 8, in which the estimated breathing rate waveforms obtained from the reference and mattress are shown, it is possible to note that the baseline breathing rate are always the same for the reference and mattress for all the subjects involved in the tests. In the case of variation in the breathing rate, the PML combined with the proposed algorithm is able to evaluate the variation even with a slightly different trend with respect to the reference. A possible explanation for this might be that the proposed algorithm needs a pseudo-stationary window of the signal, in which the PML signal does not have significant variations. In any case, the linear regressions between the reference and PML breathing rate estimations are significant (\(p\)-value \(<\) 0.05) for all the subject and the coefficients of regression are lower than 60% for only two out of seven. Considering the pooling dataset of breathing rate estimations, the squared Pearson \(r\)-value is 0.44 and almost all estimation differences between PML and reference are within the 95% limits of agreement. The present study raises the possibility to robustly estimate the position and breathing rate of a subject lying over a bed by using a nonobtrusive and low-cost system based on a textile pressure mapping layer placed over a mattress. The position and breathing rate are key information to evaluate the quality of sleep of a subject. Hence, the proposed method  
Figure 9: Linear regression plot and Bland–Altman plot of all the analyzed breathing rates of each epochs for the smart bed (BR smart bed) and reference (BR real) signal. The breathing rates are pooled over all the epochs and recordings. In the plots are reported the linear regression equation, squared Pearson \(r\)-value (\(\mathbf{r}^{2}\)), root mean squared error (RMSE), number of analyzed breathing rates (n), reproducibility coefficient (RPC), and the coefficient of variation expressed as a percentage (CV). The lines of mean of difference between BR smart bed and BR real, and the 95% limits of agreement are shown. associate to PML and other sensors of the smart bed will be an important element in future home-automated environments for the evaluation of sleep quality, health, and more in general the quality of life of the entire population. Furthermore, the proposed system could be very useful also in a clinical context to allow for a continuous and nonobtrusive monitoring of vital parameters for each patient. The main limitations of our study are the restricted number of healthy subjects tested and the absence of long-time duration test (i.e., full night recordings).