## 2 Materials and Methods
### Data Preprocessing  
Our preprocessing steps consist of segmentation at the beginning and a smoothing method to remove noise. Since the data was collected in 5 s segments, there was no need to segment the data. To smooth the data, a moving-average method shown in Equation (2) was used to average out windows of accelerometer signals to reduce noise. The moving-average calculation replaces each value in the sequence with the average of several points around it. We chose to average windows of 5 values, which balances both accuracy and time cost. Figure 3a shows the moving-average smoothened signal vs. non-smoothened signal. Since signal-to-noise ratio (SNR) is one of our features, which relies on the noise, SNR was calculated before the moving average was applied. \[SMA_{t}=\frac{1}{N}\sum_{i=t-N+1}^{t}x_{i} \tag{2}\]  
After calculating features using their definition equations, normalization, shown in Equation (3), was applied to the features to account for variations in the walking styles of various people. For example, people with different height may have different normal step length, as shown in Figure 3b. Normalization will reduce such influences from the feature  
Figure 2: Work flow of signal process and analysis. to give a more accurate result. Figure 3c,d shows the minimum-maximum difference feature before and after normalization. \[\text{norm}_{\text{value}}=\frac{\text{Raw Value}}{\text{Average Value of Feature for Same Person}} \tag{3}\]  
Correlation-Based Feature Selection  
We used CFS to identify the best features for gait classification. CFS selects features highly correlated with BAC levels but uncorrelated with each other. For each feature class, we compute correlations with BAC levels and their p-values. Features with \(p\)-values < 0.05 are retained, regardless of correlation strength, for supervised learning. This process is applied to all feature classes. Equation (4) shows the correlation coefficient used for ranking the features based on \(p\)-values. \[\rho(A,B)=\frac{1}{N-1}\sum_{i=1}^{N}\left(\frac{A_{i}-\mu_{A}}{\sigma_{A}} \right)\left(\frac{B_{i}-\mu_{B}}{\sigma_{B}}\right), \tag{4}\]  
As shown in Table 7, 12 out of 13 time-domain features had a \(p\)-value < 0.05 and were useful for alcohol consumption detection. Normalization further increased the correlation  
Figure 3: (**a**) Moving average smoothing effect. (**b**) Step length influence on normal step length. (**c**) MinMax feature scaling before normalization. (**d**) MinMax feature scaling after normalization. of all 12 features by an average of 0.1061. As shown in Table 8, 8 out of 11 features were statistically significant (_p_-value < 0.05) and were useful for alcohol consumption detection. Seven of these eight frequency-domain features showed stronger correlation after normalization by an average of 0.0999. As shown in Table 9, 1 of the 2 wavelet-domain features was useful for the detection of alcohol consumption. Normalization does not improve the performance of the wavelet-domain features. This probably results from the properties of the wavelet domain. The wavelet domain is a time-frequency domain that reflects not only time and frequency properties but also the relationship between time and frequency. However, the normalization process, which usually resizes the range of feature values, can reshape the relationship between time and frequency, causing a decrease in the feature correlation coefficient. Specifically, wavelet features preserve both temporal and spectral structures across multiple scales and inherently encode relative magnitudes. As such, they exhibit a degree of scale invariance, reducing the effect of normalization. As shown in Table 10, all 3 features had a _p_-value < 0.05 and were useful for alcohol consumption detection. Additionally, all 3 features showed stronger correlation after normalization. Table 11 shows that 1 feature had a _p_-value < 0.05 and was useful for alcohol consumption detection. Furthermore, this feature showed a stronger correlation with BAC levels after normalization.