*2.3. Verification of the CWT Based Gait Event Detection Algorithm*

As a direct measure of pressure distribution under the foot during walking, the FSR method is commonly used as the gold standard for gait event detection in previous gait literatures [8]. Thus, the FSR method was utilized as the reference method to evaluate the performance of the proposed CWT based gait event detection method in our study. In the FSR method, the HS and TO events were detected by a set of threshold values. The threshold value for the detected HS event was calculated as 5% of the maximum heel FSR amplitude at the foot force increasing stage. Meanwhile, the threshold value for the detected TO event was calculated as 5% of the maximum toe FSR amplitude at the foot force decreasing stage. Detailed description is provided in previous literatures [26,37]. It should be noted that the heel and toe FSR signals of each subject were collected simultaneously with the walking

acceleration signals through a pair of FSR sensors, which was described in the experimental procedure (see Section 2.1).

In this study, the time-error and F1-score were utilized as the metrics to assess the gait event detection performances, which were commonly adopted in the previous gait literatures [13,20,38]. It is worthy to note that the gait events detected with the FSR recordings were used as the reference events for each subject. And the gait events detected by using the proposed general CWT method based on the AP acceleration signals were designated as the estimated events. Time-error, a measure of the time agreement between the reference events and the estimated events, was utilized to assess the time accuracy among the correctly detected gait events when the proposed method was applied. The time-errors of the estimated HS and TO gait events, designated as *TEHS* and *TETO*, respectively, were defined as the following Equations (6) and (7):

$$TE\_{HS} = \left| T\_{HS\\_CWT} - T\_{HS\\_FSR} \right| \tag{6}$$

$$TE\_{TO} = \left| T\_{TO\\_CWT} - T\_{TO\\_FSR} \right| \tag{7}$$

where *THS*\_*CWT* and *TTO*\_*CWT* represent the time indexes of the estimated HS and TO gait events via the CWT-based algorithm, and *THS*\_*FSR* and *TTO*\_*FSR* represent the time indexes of the reference HS and TO gait events via the FSR method, respectively.

In cases of possibly missed and wrongly detected gait events, the F1-score was adopted as a measure of the precision and recall of the gait event detection, which is calculated as follows:

$$\text{F1} = \frac{2PR}{P+R} \tag{8}$$

where *P* denotes Precision and *R* denotes Recall, which are computed as Equations (9) and (10), respectively:

$$P = \frac{TP}{TP + FP} \tag{9}$$

$$R = \frac{TP}{TP + FN} \tag{10}$$

where *TP* denotes the true positives, *FN* denotes false negatives, and *FP* denotes false positives. Note that in the context of this study, *TP* actually represented the number of correctly estimated gait events, *FN* denoted the number of unidentified/missed gait events, and *FP* represented the number of wrongly estimated gait events.
