# New Framework for Human Activity Recognition for Wearable Gait Rehabilitation Systems
## 4 Proposed Approach for Lower Limb Activity Detection
### Signal Segmentation and Decomposition by Autocepstrum Analysis  
A signal's segmentation function is to split it up into many epochs with identical statistical properties, like frequency and amplitude [45]. The pre-processing stage for non-stationary signal analysis is typically signal segmentation because stationary signals are easier to analyze than non-stationary signals. Signal segmentation can be divided into two types: adaptive segmentation and constant segmentation. Signals are separated into fixed epochs in continuous segmentation. Constant segmentation has low reliability even though it is straightforward and easy to execute.  
Before the feature extraction, each sEMG sample is segmented into 200 ms windows with 20 ms overlap between segments. Segmentation separates muscle contraction from rest, shortening response time without accuracy loss. Some segments contain mostly noise, providing little information. Others show clear patterns during exertion. A few long, convoluted segments displayed alternating contraction and relaxation over several cycles. Overall, the technique revealed the key characteristics of muscle activity in a format suited for further processing while preserving temporal data essential for modeling dynamic movement. The autocepstrum of a given signal essentially refers to the inverse Fourier transform of the natural logarithm of the signal's power spectral density and provides useful information for signal detection. Computing the autocepstrum of a discrete-time signal involves taking the IFT of the log of its Power Spectral Density (PSD), which is defined by the following:  
\[c_{a}(\hat{n})=\frac{1}{\sqrt{N_{r}}}\Sigma_{k=0}^{N_{r}-1}Z\left(\hat{k} \right)exp\left(\frac{2\pi\hat{k}\hat{n}}{N_{r}}\right), \tag{2}\]  
Figure 11: Example of denoised EMG signals.  
where \(Z\left(\hat{k}\right)\) denotes the natural logarithm of the signal's PSD, \(N_{r}\) denotes the size of the raw sensory signal, \(\hat{n}\) is the quefrency parameter, and \(\hat{k}\) is the discrete frequency parameter. Previously, employing the autocepstrum approach has proven effective in detecting communications signals in low signal-to-noise ratio environments. Research has shown that the autocepstrum of certain signal patterns exhibits a major peak correlating to the reciprocal of the operating frequency along with other minor peaks at multiples of this frequency [46].  
On the other hand, there is only one prominent peak at the zeroth quefrency value and very few other peaks in the autocepstrum of additive white Gaussian noise. When analyzing a signal in the cepstral domain, this unique feature is helpful for reducing noise and interference. Figure 12a shows an IMU signal representing ramp-walking activity after being analyzed by the autocepstrum approach, revealing a high peak during the burst interval. Accordingly, our proposed feature extraction method is formulated dependent on this distinguishing observation. To the best of our knowledge, the exploration of raw sensory signals within the autocepstrum domain remains relatively novel and has yet to be substantially discussed in existing literature. The autocepstral peaks can be utilized to distinguish between different activities, considering the peaks' widths and energy. Figure 12b illustrates the segmented data after rectification and denoising for ramp and walking upstairs.