*2.4. Appropriate Mother Wavelet Selection*

Considering the fact that mother wavelet selection plays an important role in the overall performance of CWT based algorithms, there is a need for an effective means of determining the appropriate mother wavelet especially in the context of gait event detection for hemiplegic patients. In order to determine an appropriate mother wavelet, we systematically investigated the performance of 32 commonly applied mother wavelets in detecting gait events using the measures of both accuracy and quantitative criteria. The targeted mother wavelet functions included ten Daubechies (db1–db10), five Coiflets (coif1–coif5), seven Symlets (sym2–sym8), eight Gaussian (gaus1–gaus8), one Morlet (morl), and one Meyer (meyr). Table 3 briefly summarizes the definitions and main properties of the investigated wavelet families in this study.


**Table 3.** Brief summary of the definitions and main properties of the studied wavelet families.

*N* is the order of the mother wavelet. ψ is the mother wavelet function if the wavelet has the explicit expression. *fc* is the wavelet central frequency, *t* denotes the time, and *f* denotes the frequency.

Generally, the basic properties of each mother wavelet, such as the orthogonality and symmetry, are considered in order to help select the appropriate mother wavelet in the first step. The orthogonality characteristics can ensure that the signal will not be decomposed into overlapping sub-frequency bands. Symmetry property can help avoid phase distortion, which is mainly concerned in the wavelet-based filtering operation because the mother wavelet can be served as a linear phase filter. As pointed out in [30], there is possibly more than one mother wavelet sharing similar fundamental properties. Thus, the selection of an appropriate mother wavelet cannot solely rely on the basic properties of the wavelets. Besides, the visual similarity generally applied in the optimal mother wavelet selection is also reported to be not always proper for all wavelet-based processing [30,31]. Additionally, the wavelet selection that is based on accuracy related to specific application is more recommended [30]. In this case, both accuracy (time-error, F1-score of the gait event detection) and quantitative (cross-correlation coefficient, energy-to-Shannon entropy ratio) criteria were investigated to search for an effective mother wavelet associated with HS and TO event detection for healthy and hemiplegic subjects. For the accuracy criteria, kindly note that the definition of time-error and F1-score can be referred in Section 2.3.

For the quantitative criteria, cross-correlation coefficient (*Xcorr*) and energy-to-Shannon entropy ratio (*ESER*) metrics were applied to evaluate the performances of the 32 mother wavelets in gait event detection in this study. Note that they were two commonly used quantitative wavelet selection criterion in various applications such as signal de-noising, signal processing/decoding, and vibration signal analysis [15,17,39]. In the cross-correlation measure, the cross-correlation coefficient (*XCorr*) between the recorded acceleration signal (*X*) and a specific mother wavelet (*Yi*) was obtained and utilized to quantify the performance of the mother wavelet (*Yi*) in detecting the associated gait events [31,32]. It is noteworthy that the higher the absolute *XCorr*(*X*,*Yi*), the stronger the correlation will be and a value of 0 indicates that the two variables are linearly independent. The cross-correlation coefficient *XCorr*(*X*, *Yi*) is computed using the formula in Equation (11).

$$XCorr(X,Y) = \frac{\Sigma\{X-\overline{X}\}\{Y-\overline{Y}\}}{\sqrt{\Sigma\{X-\overline{X}\}^2\{Y-\overline{Y}\}^2}}\tag{11}$$

In the energy-to-Shannon entropy ratio (*ESER*) measure, the goal is to obtain a mother wavelet that provides the maximum energy, and at the same time minimum Shannon entropy associated with the wavelet coefficients [39]. Thus, the energy-to-Shannon entropy ratio is computed using the formula in Equation (12).

$$ESER(s) \, = \, \frac{E(s)}{\mathcal{S}\_{entropy}\,\,(s)}\tag{12}$$

where the energy *E*(*s*) associated with *s* scale was computed using Equation (3) and the Shannon entropy *Sentropy* (*s*) was defined as the Equation (13).

$$S\_{\text{entropy}}\left(s\right) = -\sum\_{i=1}^{N} p\_i \cdot \log\_2 p\_i \tag{13}$$

where *pi* is the energy probability distribution of each wavelet coefficient and is computed using the formula in Equation (14). *Wn*(*s*) represents the wavelet transform of the signal associated with the *s* scale, which was defined in Equation (1). *Es* represents the energy density spectrum which is computed based on the above mentioned CWT coefficients *Wn*(*s*) and was defined in Equation (3). *N* is the total

number of wavelet coefficients. Specifically, if *pi* <sup>=</sup> 0, then *<sup>N</sup> i*=1 *pi* = 1.

$$p\_i = \frac{\left|W\_n(s)\right|^2}{E(s)}\tag{14}$$

In summary, the mother wavelet that provides the maximum F1-score, *XCorr*, and *ESER* as well as the minimum time-error is generally considered to be the most appropriate mother wavelet for gait event detection.
