## 2 Methods
### Audio Signal Processing for the Detection of Breathing and the Extraction of Apnea/ Hypopnea Events  
The rationale of our proposed methodology was based on the following assumptions: (a) a VAD is capable of detecting breathing sounds as well (an assumption that has already been made before, e.g., [30], but is also supported by the findings reported herein) (b) the detection of breathing sounds (or their absence, for the subject matter) can be used to infer episodes of breathing that has completely stopped or has severely altered, and (c) completely stopped or severely altered breathing corresponds to apneic or hypopneic episodes, respectively. The proposed algorithm was designed for application in real-time processing of audio recordings but its use was herein emulated with stored WAV files with a maximum duration of approx. 2 h each. A window length of 0.1 s and an equal slide step (i.e., no overlap) were used to parse each stored WAV file. For each window, the probability of breathing was calculated using a statistical model-based VAD that was efficient in low signal-to-noise environments [33]. Particular emphasis was paid to estimating the noise power spectral density [34] by extracting the power spectral density in all frequency bands, as described in [34]. Then, the noise variance was used to estimate the posterior signal-to-noise ratio (SNR)--defined as the power of the observed noise signal to the noise power--and the prior SNR--defined as the power of the clean signal to the noise power--according to the minimum mean-square error (MMSE) short-time spectral amplitude estimator [35]. A block diagram of our proposed algorithm is depicted in Figure 2 Hidden Markov Model. Next, we calculated the breathing probability within each frame using a hidden Markov model (HMM) that relies on the a priori breathing-to-silence and silence-to-breathing probabilities as defined [33]. In our case, these probabilities were calculated within the time duration of a typical respiratory cycle that was assumed to be equal to 4 s. As such, the aforementioned a priori probabilities were calculated within 40 non-overlapping sliding windows of a duration of 0.1 s each. Among these frames, 2 were expected to represent a transition from silence to breathing and 2 a transition from breathing to silence. Thus, the two factors were both selected as equal to 5%. Since the sound characteristics of breathing and background noise are expected to be altered throughout the entire night recording, it was expected that the average breathing probability (averaged over 40 consecutive 0.1 s windows) would also be volatile. Thereupon, we used a probability normalization step in order to detect the transitions from inhalation/exhalation to silence and vice versa. The threshold that determines the transition from the breathing to the non-breathing state and vice versa was selected to be equal to the mean breathing probability of the latest 150 s of the observed audio signal  
Figure 2: (**a**) Block diagram of the audio signal processing for the extraction of the list of detected apnea events from raw audio recordings. It comprises: (i) the breathing probability extraction algorithm, (ii) the conversion of the breathing probability to a breathing detector, and (iii) the detection of apneic events based on the raw audio signal and the breathing detector. (**b**) Block diagram of the VAD algorithm that is analytically described in [33; 34; 35]. (Figure 2a). The final detector derived by the breathing probability for the entire audio signal (Figure 3a) was smoothed by rejecting all detected regions that lasted less than 0.7 s (Figure 2a) since shorter durations are rather unlikely to represent a complete inhalation or exhalation process (Figure 3b). The exact threshold value of 0.7 s was determined by taking into account the theoretical duration of a breathing cycle (3 to 5 s), combined with the expected imbalance between inhalation and exhalation duration.