## 4 Discussion  
The developed algorithm is based on a well-established signal processing methodology for VAD [33; 34; 35]. VAD algorithms have been widely used in breathing detection [30] and their application, especially in audio recordings during the night, are believed to perform particularly well due to the absence of speech. The hypothesis examined here is the possibility to identify the exact time location of apnea/hypopnea events by the estimation of the mean RMS value of the audio signal during the detected breathing segments. The achieved sensitivity proves that the proposed pattern is indeed present in the majority of apneic episodes (81%) and also half of the hypopneas exhibited by a patient with moderate or severe apnea syndrome. The algorithm developed was tested also for the case of an ambient microphone where its performance is slightly reduced. A comparison between the sensitivity provided by the two independently employed microphones can give a clear view of their performance in detecting apnea and hypopnea episodes. In the case of apnea events, a systematically increased sensitivity is observed for the tracheal microphone (approx. 11%) as compared to the ambient microphone. This is exclusively attributed to the fact that the tracheal microphone is in direct contact with the source producing the targeted sound--the patient's trachea--and it is practically insensitive to any external noise. The ambient microphone is sensitive to environmental  
Figure 6: Bland-Altman diagrams for the reference and estimated Mean Apnea Duration (MAD) index for all patients of the dataset: (**a**) based on tracheal sound recordings; (**b**) based on ambient sound recordings. noise, particularly in the sleep study unit, the air condition sound, the sound of any other equipment in the room, and the speech from clinical staff supervising the study. However, in the case of hypopneas, the difference in the provided sensitivity is much lower. The developed algorithm does not categorize breathing sounds in different frequency bands or in classes of breathing and snoring. Thus, mild breathing and snoring may be monitored to have the same sound level, when recorded by the contact microphone. This is expected to be the case more often in hypopneas, in which some inhalation sounds are expected within the event. The ambient microphone may give a clearer view of these events, by performing better in the aforementioned discrimination. Despite the good sensitivity, the algorithmic process presents moderate precision, providing a lot of false-positive detections per patient. Based on the extracted distribution of the estimated and reference events, it is clear that the low precision is attributed to an overestimation of the number of short-length episodes--10 s to 20 s--(Figure 4) by both microphones. The medium-length events--25 to 35 s--are slightly underestimated. The detected duration of the events seems to present negligible error differences in the cases of events produced when the patient is in supine or lateral position (\"right\" and \"left\" side), while the same results are produced when we follow a categorization of the detected events with respect to sleep stages (REM, non REM) (see Supplementary Material). However, future steps in a deeper examination of the factors affecting the detected duration error (time spent in'supine' position in the hospital and at home, the ratio between REM/non-REM stages duration) are imperative for accurate interpretation of these results  
Overall, the number of detected events is higher than the number of reference events. The problem of increased false detection rate is higher for patients with moderate SAS, compared to those with severe SAS. We have to mention here that the algorithm in its current version is not intended for use in the extraction of the AHI; this was beyond the scope of the present work. Such use would lead to severe overestimation of AHI (see also Supplementary Materials).