*2.6. Filter*

To enhance the prediction performance of the UIR system, we incorporate a majority voting filter (MVF). MVF alleviates transient jumps between classifier output classes and leads to smooth transitions from one classified gait mode to another. We implement the MVF using 2*q* + 1 classified modes [41]: the current, *q* previous, and *q* subsequent values. The MVF output is the most frequently classified mode among those 2*q* + 1 values.

To obtain *q* subsequent classified gait modes, MVF enforces a time delay to allow the classifier to access the required data. The real-time constraint discussed in Section 2.2 requires a time delay less than 300 ms. Therefore, an appropriate value for *q* should be chosen to avoid violation of the real-time constraint. The constraint requires

$$\begin{aligned} q \times L\_f &\le 300 \text{ ms} & & \text{Disjoint winding} \\ q \times I &\le 300 \text{ ms} & & \text{Overlapped winding} \end{aligned} \tag{2}$$

An MVF with very small *q* may not significantly improve classification performance, whereas an MVF with very large *q* may cause misclassification because of time delay. In this paper, we will choose a trade-off value for *q*, and will investigate the effect of the MVF on classification performance.
