## Materials and Methods
### Data Processing and Feature Extraction  
The 3D trajectory data from the motion-capture system were labeled, using QTM 2.12 software. After the labeling process, the data were exported in.c3d format, for further analysis with Visual 3D Professional (C-Motion Inc., Germantown, MD, USA) software.  
In Visual 3D software, the trajectory data were combined with the GRF data, to define the heel-strike (HS) and toe-off (TO) gait events. The defined HS and TO events were used for data segmentation. The 3D acceleration data were filtered by using a fourth-order Butterworth low-pass filter with a cutoff frequency of 2 Hz [16; 17]. Then, the events defined using Visual 3D were applied to segment the acceleration data into one stride (HS to another HS on the same foot). The filtered and segmented data could only be used with the time-domain features. The time- and frequency-domain features were extracted for each of the three axes respectively. In this study, we decided to used data from a 3D-motion-capture system, to define the gait events, since we included stroke patients as our subject, and according to our best knowledge, there is no validated algorithm to define gait cycle for stroke patient population from an accelerometer placed on lower-back.  
The problem of automatic gait-event detection with a wearable device was that the algorithm was developed specifically for particular sensor placement. For example, [PERSON], in 2020 [18], compared some algorithms that used a heel-placed sensor to identify gait event, and [PERSON] et al., in 2019, used 3 sensors placed on the ankle and L5, with a deep learning method, to identify gait event [19]. Moreover, even if we could find an algorithm that used the same sensor placement, it may not validate abnormal gaits, like hemiparesis, myelopathic, or other neurological disease gait. [PERSON] et al. proved that none of the available algorithms in the literature could maintain high accuracy when being used to identify gait event on hemiparesis or myelopathic subjects, even though they had good results on normal subjects [18]. Nevertheless, [PERSON] et al. successfully validated gait-event detection with an accelerometer on a Parkinson's disease patient, but still not on hemiparesis or stroke patients [15]. Therefore, in our study, we preferred to used data from a 3D-motion-capture system for gait-event detection.  
The time-domain features extracted in this study were standard deviation, skewness, and kurtosis of the acceleration in the vertical, anteroposterior, and mediolateral directions. The root mean square (RMS) of the acceleration data and peak-to-peak value of the gyroscope in the vertical, anteroposterior, and mediolateral directions were also extracted  
Figure 1: Illustration of synchronized sensor and equipment (motion-capture system). IMU, inertial measurement unit; AMTI, Advanced Mechanical Technology, Inc. (Watertown, MA, USA).  
to examine gait stability, according to previous studies in which gait stability have been examined by using wearable devices [9; 20; 21; 22].  
The frequency-domain features extracted in this study were peak frequency [8; 23], bandwidth, lower bound frequency, upper bound frequency, power at 99% occupied bandwidth, and power at half-power bandwidth. All the accelerometer and gyroscope signal processing and feature extraction procedures were performed by using MATLAB (The MathWorks Inc., Natick, MA, USA). Table 1 presents the list of features and their descriptions.