## 2 Methods
### Other OSA Detectors Based on Time-Frequency Analysis  
Other algorithms based on a traditional time-frequency analysis of the HRV were included in the study. First, the two analyzed CNN schemes, i.e., cuCNN and Alexnet, were fed with images obtained by transforming the HRV signal into a bidimensional image using continuous wavelet transform (CWT) [70], resulting in scalograms or graphical representations of the CWT coefficients [71]. In a scalogram, the x-axis typically represents location in time, whereas the y-axis represents scale or frequency, and the color or intensity represents the magnitude of the wavelet coefficients at each location and scale pairs. The employed wavelet was the analytic Morlet wavelet, which was chosen for its effectiveness in capturing the time-frequency components of HRV [72]. Twelve voices per octave (scales) were used based on the approach described by [PERSON] et al. [72], which provided a suitable method for distinguishing subtle differences between apneic and normal episodes. As an example, Figure 7 illustrates some representative wavelet scalograms for apneic (Figure 7a,b) and normal (Figure 7c,d) episodes. Eventually, these images were rescaled to \(227\times 227\times 3\) pixels to match the input layers of the aforementioned DL algorithms.  
It should be noted that to overcome the uneven sampling issue of the RR-interval series, it was resampled with spline interpolation at 4 Hz, which is high enough to satisfy the [PERSON] sampling requirements considering that the frequency bands of study for HRV analysis lie between 0.15 and 0.4 Hz [15]. Former works also employed similar sampling frequencies following the same reasoning [73; 74].  
Several ML-based models were also generated by combining the most common time, frequency, and complexity features proposed to analyzed the HRV signals through the classifiers mentioned in the previous subsection. Specifically, such models were already analyzed in previous works [40] by following a typical ML-based pipeline (signal processing, feature extraction, feature selection, training, classification, and model validation) as well as extracting features from HRV's time, frequency and complexity domains. Some of these features included statistical maximum, minimum, RR interval counts, the power spectral density in determined frequency bands, and entropy-based measures. Further details of these features can be found in [40] and are fully itemized by the Task Force of The European Society of Cardiology and The North American Society of Pacing and Electrophysiology [15]. Also, the classifiers' parameters remained consistent with those outlined in Section 2.6.  
Ultimately, a variety of feature combinations was used to feed the above ML-based models, coming from the application of two sequential feature selection (SFS) algorithms [75]. Specifically, we applied Sequential Forward Feature Selection (SFFS) and Sequential Backward Feature Selection (SBFS) to identify the most relevant features for the models. The models were initially supplied with the complete set of available features. Then, they were separately fed with two distinct feature sets: one derived from SFFS and the other from SBFS. In SFFS, features were added incrementally, starting from an empty set, and at each step, the feature that contributed the most to improving model performance was selected. Conversely, SBFS started with the full set of features and iteratively removed the least important ones. Due to the large number of results generated, only the models that delivered the best outcomes are presented in the Section 3 out of the three generated (all features, those selected by SFFS, and those chosen by SBFS).