*2.2. Data Windowing*

To effectively classify human gait modes, we extract appropriate features from a frame (window) of measurement signals. *Lf* is the length of a frame in milliseconds. The number of samples in the frame depends on the frame length *Lf* and the sampling rate. A short frame fails to provide an informative data set and may lead to significant classification bias and variance. On the other hand, a long frame is a computational burden for real-time implementation. In this paper, *Lf* is chosen to trade off feature informativeness and computational load.

We apply two different methods for data windowing: disjoint windowing and overlapped windowing [35]. Figure 4 illustrates the two windowing approaches. In disjoint windowing, the class outcome *Oi* corresponding to frame *Si* is output every *Lf* ms. *τ* is the time required for feature extraction, classification, commanding the appropriate low-level controller, and prosthesis response time. In overlapped windowing, we use a sliding frame with length *Lf* and increment *I*, and the class outcome is output every *I* ms. Disjoint windowing is a special case of overlapped windowing when *I* = *Lf* . To achieve real-time operation, the parameters of the windowing approaches should satisfy

$$\begin{aligned} \tau &\le L\_f & \text{disjoint winding}\_{\nu} \\ \tau &\le I \le L\_f & \text{overlapped winding}\_{\nu} \end{aligned} \tag{1}$$

In this paper, we apply disjoint and overlapped windowing with various frame and increment lengths. We consider two important characteristics to determine *Lf* [35]: (1) the minimum interval between two distinct muscle contractions is 200 ms [36], and (2) the delay between user intent and the resultant prosthesis motion should be no more than 300 ms [37,38]. The first property implies that a 200 ms frame of data should have the potential to provide informative features for gait mode classification. The second property, which is known as the real-time constraint, ensures that the amputee will experience the prosthesis as responsive to his or her intent. The real-time constraint requires *τ* ≤ *Lf* ≤ 300 ms for disjoint windowing, and *I* ≤ 300 ms for overlapped windowing. Therefore, we use overlapped windowing when the frame length is larger than 300 ms, noting that a larger frame will require a higher computational load.

(**a**) Disjoint windowing

(**b**) Overlapped windowing

**Figure 4.** Data windowing. *Si* represents the *i*-th data segment, *Lf* is the frame length, *τ* is the required processing time, *I* is the increment length for overlapped windowing, and *Oi* is the detected gait mode corresponding to frame *Si*.

## *2.3. Feature Extraction*

Various features can be extracted from a frame of measurement data and used for classification. Features should be informative enough to discriminate between various gait modes. In addition, feature extraction needs to be computationally fast for real-time implementation. In general, both time-domain (TD) and frequency-domain (FD) features are frequently used for classification [35,39,40]. We compare TD and FD features in this paper, and select the optimal subset of features for UIR.

TD features are computationally fast, and include information about the data waveform and frequency. We extract the following TD features from each frame of data: slope sign change (SSC), zero crossing (ZC), waveform length (WL), variance (VAR), mean absolute value (MAV), modified MAV (MAV1 and MAV2), root mean square (RMS), Willison amplitude (WAMP), skewness (SK), kurtosis (KU), and correlation coefficient (COR) and angle (ANG) between two frames of data from different measurement signals. The mathematical definitions of these TD features are given in [39].

In addition, multiple FD features have been extracted. FD features are computationally slower than TD features, but include information about the frame's frequency content. We use periodograms to measure the power spectrum density (PSD) of a frame, and calculate the following FD features: mean frequency (MNF), median frequency (MDF), maximum frequency (MAXF), and fourth-order auto-regressive coefficients (AR4). The mathematical definitions of these FD features are given in [39].

Previous research has shown the applicability of these TD and FD features for prosthetic limb pattern recognition [39–41]. Therefore, we are motivated to investigate the performance of these features for gait mode recognition.

After extracting TD and FD features from a frame of measurement data, the features are concatenated and labeled to create a single training pattern. For instance, extraction of VAR, MAV + RMS, and AR4 features from a frame of three measurement signals (e.g., vertical hip position, thigh angle, and thigh moment) would produce a training vector with 3, 6, and 12 elements, respectively. We perform the above procedure for all features and all frames of measurement data to create the training data set. The training set is then normalized to equalize the relative magnitude of each feature.
