# A Novel Approach for Acute Mental Stress Mitigation Through Adapted Binaural Beats: A Pilot Study
## 2 Materials and Methods
### Stress Index Estimation  
To adapt the \(f_{BB}\), we needed to assess the participants' level of stress over time. For this purpose, we implemented a random forest regressor for each subject to estimate a stress index. Data collected during steps 1 and 2 (see Figure 1B) were used to train the regressor, with samples labeled as 0 (no stress) during the VID and 1 (stress) during the MAT. Features from the ECG and the ECG-derived respiratory (EDR) signals were estimated. Concerning the ECG, we estimated the \(RR\) interval (the time between consecutive R peaks), the \(QT\) interval (the temporal duration between the \(Q\) and \(T\) waves), the \(QTc\) interval (defined as the ratio between the \(QT\) and the square root of the \(RR\) interval), and the \(RT_{R}\) and \(RP_{R}\) ratios, which represent the amplitude ratios between the R peak and the T and P peaks, respectively. Concerning the EDR, we estimated the duration of the breath cycle (\(R_{P}\)), the ratio of the consecutive peaks' amplitude (\(P_{R}\)), and the ratio between a peak and the next valley (\(A_{pp}\)). We refer the reader to Figure 2A,B, where an example of an ECG fromone participant and the graphical representation of some investigated features, both for the ECG and EDR, are reported. The Neurokit2 toolbox (version 0.2.7) was used to estimate the mentioned features. Concerning the ECG, the \(RR\) interval is certainly the most adopted feature to assess the onset of a stressful response. However, the use of features like \(QT\) and \(QTc\) is not new for the stress assessment. Indeed, studies highlighted a change in \(QT\)[38; 39] and \(QTc\)[40] intervals during the execution of cognitive tasks. On the other hand, features like \(RP_{R}\) and \(RT_{R}\) are not commonly adopted in stress-inducing and assessment studies. However, a significant T-wave reduction was documented during the execution of a cognitive task [41]. For this reason, we took into account the changes in the T and P waves to the R peak, to have a relative measure in every ECG waveform. We included also the duration of breath cycles in the EDR signal due to the physiological responses that typically occur under stressful conditions [42]. In addition, \(A_{pp}\) and \(P_{R}\) can measure the irregularities of one's breath during a stressful condition [43]. Finally, supplementary features were considered along with traditional ones used for stress detection (e.g., the \(RR\) interval) in order to extract more insights from the data and possibly enhance the accuracy of the estimation. To consider the different dynamics of the ECG and EDR signals, we used the respiratory cycles to naturally segment the ECG signal. Therefore, the features within each respiratory cycle were averaged to obtain a single value. Additionally, to enrich the model, we considered the temporal variation in the feature over time. Specifically, we assessed changes in the average feature values across windows spanning three respiratory cycles with a two-cycle overlap. This was performed by calculating the ratios of feature values between each cycle. For each stress index value, three consecutive cycles were taken into account, with an overlap of two. Before training the regressor, the feature set was standardized, and the mean and standard deviation of the features were saved and later used in the subsequent stages of the experiments. To determine the optimal regression model for each subject, a grid search was performed to evaluate various hyperparameters, including the number of trees (400, 700, and 1000), tree depths (unrestricted, 10, 20, and 30), and the minimum samples required for splits and leaves (2, 5, and 10 and 2, 4, and 6, respectively). Bootstrap sampling was  
Figure 2: (**A**) Example of signal received in real time from PolarH10 chest strap with red circular marker indicating the R peaks. (**B**) Average ECG waveform from one participant with a graphical representation of some investigated features like \(RP_{R}\), \(QT\) interval, and \(RT_{R}\).