Development of the proposed algorithm (Fig 1
) was completed using the R statistical package (R Foundation for Statistical Computing; Vienna, Austria).^{10} Spo_{2} recordings for subjects were first transformed into a format for time series data. For each subject, fast Fourier transformation with two successive modified Daniell smoothers was performed on time series data by a “spectrum” function to acquire the estimated spectral densities and corresponding frequencies, which were then utilized to plot smoothed periodograms (Fig 2
). Two successive modified Daniell smoothers with same span length of 3 to 121 in odd numbers were employed to have at least one peak in the low-frequency region (0 to 0.1 Hz) of the periodogram. An automated algorithm was then utilized to define the low-frequency peak. First, a turning point was defined as the point at which a downward curve turned upward. All the turning points with frequencies < 0.1 Hz were identified. When a curve was initially upward, the leftmost point was adopted as the first turning point. For each turning point, the frequency period was gated between frequency of the turning point and that of the rightmost point whose spectral density was larger than or equal to that of the turning point, or 0.1 Hz when the frequency of the rightmost point was > 0.1 Hz. The point with maximal spectral density for each gated frequency period was documented, and the difference in spectral density with corresponding turning points was derived. The frequency period with the largest spectral density difference was adopted as the period in which the peak occurred. For the peak, the point with largest spectral density was considered as the “top” point and the turning point was adopted as the “base” point. The frequency at the top point, the frequency at the base point, and the difference in frequency at the top vs the base were calculated, as were the spectral frequency at the top point, the spectral density at the base point, and the difference between the top and base density. Spectral density-related parameters were corrected according to the range of all estimated spectral densities. The ratio of the area under the curve (AUC) of the peak to that of the whole periodogram (AUCratio) was calculated, as was the slope of spectral density vs frequency obtained by a linear regression in the frequency region > 0.1 Hz (slope_{0.1–0.5}).