## 2 Materials and Methods
### Efficient Algorithm for Autocorrelation, \(HNR\), and \(NHR\) Determination  
The purpose of developing this algorithm is to be implemented in a medical decision support system to detect speech pathologies. [PERSON] and [PERSON], 2016 [43], implemented an algorithm to determine the jitter, shimmer, and the \(HNR\). However, the authors claim the need to improve the HNR determination. In addition, [PERSON] et al., in 2018 [37] had already explored the selection of window shapes and length, but using the \(a_{x}(\tau)\) and without the division referred to in Equation (3) in the algorithm. They selected longer windows lengths, but the error was higher than with this new algorithm. This algorithm project is an attempt to reduce the computational complexity and improve the quality of Autocorrelation, HNR, and NHR measurement. As mentioned in the description of the parameters, the determination of the Autocorrelation is the base for the determination of the other parameters. Therefore, the main concern here is the correct determination of the Autocorrelation. The Autocorrelation determination is sensitive to the type of window and its length. Therefore, several combinations were tested. The method used for the window length selection considers multiples lengths of glottal periods. The glottal period is the inverse of the fundamental frequency \(f_{o}\). The \(f_{o}\) is determined using the Autocorrelation method with a frame window length of 100 ms and considering a minimum \(f_{\rm o}\) of 50 Hz. The initial \(f_{\rm o}\) is determined with a frame window from the middle of the speech record, and then it is updated for each new frame of the analysis. Then, the normalized Autocorrelation of the Hanning window with a length of 6 glottal cycles is determined. Segmenting the signal into frames, which have a length of 6 glottal cycles, is necessary. Each frame is multiplied by a Hanning window of the same size, and the normalized Autocorrelation of the frame is determined. Then it is divided by the normalized Autocorrelation of the window. At that time, it is necessary to find the first maximum peak in half of the segment between 0.002 and 0.03 s. These values assume that\(f_{\rm o}\) is between 33 and 500 Hz. The Autocorrelation is considered to be the magnitude of this peak. Finally, the _HNR_ is calculated for each peak using Equation (9). According to the results in the following section, the next frame is assumed without overlapping. After determining these values for all frames, the Autocorrelation and the _HNR_ are averaged. Through Figure 3, it is possible to observe the flowchart of the developed algorithm. Some advantages of this algorithm over other time domain algorithms for HNR determination are as follows:  
* It allows the determination of Autocorrelation, HNR and NHR at once with the same window and window length. The best window and window length are presented in the following sections. * Determining the Autocorrelation's first peak is more straightforward (less complex and more efficient) than other algorithms, such as Boersman's Boersman (2018). * No overlapping is used because the results are the same for sustained vowels. For a complexity analysis of the proposed algorithm, a time and space analysis is presented [45; 46]. In this analysis, n is the length of all audio signals, and m is the length of each segment (the length of the number of glottal cycles). Therefore, m can be considered approximately constant for each audio file. Once there is no overlapping, the loop of  
Figure 3: Flowchart of the algorithm to determine Autocorrelation, HNR, and NHR. Figure 3 will be repeated n/m times. Therefore, the time complexity of the loop is \(O(n)\). The main operation in the loop is the peak determination, which is also \(O(n)\) for the whole audio. The main loop of Figure 3 is the normalized Autocorrelation determination implemented by operations in Equation (10), using the Wiener-Khintchine theorem [47; 48].