Keywords

1 Introduction

Gait analysis has recently gained significant attention for several applications such as medical diagnostics, bio-metric identification, robotics, animation etc. Among different gait assessment tools, 3D-motion capture systems are considered the best tool because of their high accuracy and reliability. Unfortunately, it is not affordable for clinics, specially in developing and poor countries. Wearable sensors such as, Inertial Measurement Unit (IMU) may be considered as a low-cost gait analysis tool in the clinical domain [1,2,3,4].

Inertial Measurement Unit. An Inertial Measurement Unit (IMU) consists of a tri-axial accelerometer, a tri-axial gyroscope and a tri-axial magnetometer. The accelerometer data provides the information about acceleration of the sensor, gyroscope measures the angular velocity of the sensor, and magnetometer measures the magnetic field vector with respect to the gravity vector. Additionally, the information about orientation of the sensors can be obtained by integrating the angular velocity. Presence of magnetic disturbances can limit the accuracy of the estimated orientations. In our experimental setup, we have used wearable IMUs as a cost-effective approach.

Periodic vs. Quasi-periodic. Periodic signals are the signals that recur the same behavior after regular intervals. In signal processing, quasi-periodic signals are defined as signals that show periodicity microscopically, but may not be periodic macroscopically i.e. one period is more similar to its adjacent periods than the periods at farther away in time. Non-stationary processes that changes in time generates quasi-periodic signals. Gait signal is also quasi-periodic in nature, specially when captured for a long duration and slower speed [5, 6]. This is mainly due to the fact that walking in lower speed permits the candidate to change the time intervals to complete a gait cycle. This changing periodicity poses as a challenge while detecting a full gait cycle during gait analysis (here by periodicity, we refer to the time interval to complete a gait cycle).

Gait Cycle Events. A gait cycle consists of two phases: (1) stance phase (60% approximately) and (2) swing phase (40% approximately). Each of these phases consists of sub-phases i.e. initial contact, loading response, mid-stance, terminal stance, pre-swing, initial swing, mid-swing, terminal-swing. These phases can be distinguished with events like heel strike, foot flat, heel off, toe off, mid-swing. To obtain spatio-temporal features like stride length, step length etc., detection of the previously mentioned events are important. Gait cycle extraction can be used to detect these events.

In this paper, we proposed a new approach which is used for extracting gait cycles taking the varying periodicity of a long gait signals of slow walking pattern. We collected normal and equinus gait data as samples using wearable IMU sensors. Equinus gait has been simulated by the participants due to lack of availability of medical gait data. A comparison between the existing methods and proposed method for slow speed gait data with different speeds is presented. We compared the feature values extracted, and presented a comparison of standard errors caused due to each methods. We also analyzed complexity of the proposed method. We performed a statistical analysis among the features extracted. In Sect. 2, we discuss the data acquisition procedure and pre-processing of the acquired data. In Sect. 3, we briefly explain the existing methods for gait cycle extraction. Next in Sect. 4, we propose a new approach that considers varying periodicity. In Sect. 5, we analyze and discuss the results. Finally, we conclude our study and state our future plans in Sect. 6.

Fig. 1.
figure 1

(a) A closer look at Sparkfun 9DoF Razor IMU sensor. (b) Placement of the two IMU sensors around the shank of both legs of the candidate walking on the treadmill.

Fig. 2.
figure 2

Sample clips of a signal: filtered vs. original (a) for 3 km/h (b) for 1.5 km/h.

2 Data Collection and Pre-processing

For our experimental setup, we have used wearable IMUs as a cost-effective approach. Two Sparkfun 9DoF Razor IMU sensors having sampling frequency of 200 Hz were attached with a band along with batteries and on-board memory chip. These bands were tied around the shanks of both legs of each participant. Figure 1a is an image of the used IMU sensor. The gyroscope in IMU measures the angular velocity of the sensor. Signal values in gyroscope “X”-axis is ignored because movement in x-axis is negligible. Figure 1b shows placement of the IMU sensors and gyroscopic axes for both shanks. We performed our analysis on three categories of gait: normal gait, equinus gait on both legs and equinus gait on right leg only. Due to lack of medical gait data, we simulated equinus gaits. Three participants walked normally, two participants simulated walking with equinus on the right leg, and two participants simulated walking with equinus on both legs. The candidates were asked to walk on a treadmill with two different pre-specified speeds: normal (1.5 km/h) and high (3 km/h). We did not opt for higher speed considering it will be difficult for a differently-abled person to walk with higher speed.

The preprocessing of the data was done in three steps: (i) Clipping: During the process of capturing signal data, the person is in standing position before starting walking and after stopping. The signals occurred during this phase is discarded in the clipping process. (ii) Interpolation: The collected data does not have equal time intervals. We interpolated the signal data using linear interpolation method. (iii) Filtering: The signal data collected from the IMU contains high frequency noise. To remove high frequency noise, we filtered the signal using high-pass filtering with help of convolution process. Figure 2 shows the original signals and filtered signals for left shank gyroscope z-axis data of both leg equinus gait at 3 km/h and 1.5 km/h respectively.

3 Gait Cycle Extraction

For a fully periodic signal, periodicity can be utilized to extract complete cycles. Periodogram is used to identify the highest occurring periodicity in a signal. There are two general methods to generate periodogram: a. circular auto-correlation method [7,8,9], b. spectrum analysis using Fast Fourier Transform (FFT) [10, 11].

3.1 Circular Auto-correlation

In this method, correlation value of a time series to itself with increasing lag is computed. For a discrete signal y, it is defined as,

$$\begin{aligned} ACF_{l}{(y)}\,=\,\sum _{n\in L}{y(n)*\bar{y}(n-l)} , \end{aligned}$$
(1)

where L is the signal length and l is the lag. Figure 3 represents normalized cACF plots with 400 lag in sample signals shown in Fig. 2. As it can be observed that the peaks are not at regular intervals, specially in Fig. 3(b) i.e. normalized cACF plot of slower speed gait data, signifying that gait signals are not fully periodic. In the periodogram, the highest peak is at lag 0 because the correlation between same signals is 1 and the next highest peak is considered as the most dominant period.

Fig. 3.
figure 3

Circular auto-correlation values of sample clips of (a) 3 km/h (b) 1.5 km/h respectively.

Fig. 4.
figure 4

Spectrum analysis after Fourier transformation of sample clips of (a) 3 km/h (b) 1.5 km/h respectively.

3.2 Spectrum Analysis

In spectrum analysis method, first the signal is converted to frequency domain using FFT. The periodogram is generated by plotting the spectrum or power distribution against different frequencies. Figure 4 are spectrum distributions against frequency for sample signals shown in Fig. 2. The dominant frequencies are easily observable from the plot. We observe that number of peaks in Fig. 4(b) is larger than number of peaks in Fig. 4(a). It shows that quasi-periodicity of gait signals increase as the speed decreases which leads to multiple periodicity values.

4 Proposed Method

The traditional methods considers a fixed periodicity and segments the signal of equal size. Due to wrong segmentation, cycles extracted are not always complete. For example, a cycle may be missing one or more phases e.g. heel strike and again, some cycles may contain two heel strikes. Only complete cycles are selected for further processing. During this process, if the data is highly quasi-periodic, there is higher chance of information loss as many cycles will remain undetected. Our objective is to track the varying time intervals taken to complete each gait cycle of the signal. Pseudo-code for the proposed process is shown as GetVarPeriodicity procedure in Algorithm 1. A graphical representation of the whole process is shown in Fig. 5.

Fig. 5.
figure 5

(a) A base cycle under consideration, (b) Test cycles’ window range (w_size) in a single iteration (c) Generated combined value of Kolmorogrov-Smirnov (KS) tests and Hausdorff’s distance

figure a

In our approach, we use the pre-defined knowledge of a complete gait cycle. Initially, a complete cycle, called base cycle (\(base\_cycle\)), is taken as reference. Along with it, an initial period i.e. init_period is required as input which is the time length of the base cycle. Figure 5(a) is base cycle of the example signal from Fig. 2(b). Considering the microscopic property of quasi-periodic signals, it is expected that adjacent cycles may have more or less similar time period. Therefore, to find the next cycle, a window is taken into account that depends upon the time-period of the previous complete, within which it is assumed the next cycle lies. In our case, we have taken the window range to be (\(0.5\,*\,est\_per\), \(1.8\,*\,est\_per\)), where \(est\_per\) is the estimated time period of the previously detected cycle. Figure 5(b) shows the window range for the text cycles. Signals corresponding to this window range is taken sequentially as test cycles (\(test\_cycle\)) and compared with base cycle as shown in Fig. 5(b). To measure the similarity of pattern, some statistical tests are performed. Discretized Kolmorogrov-Smirnov test or KS test (kstest), and Hausdorff distances (\(hausdorff\_dist\)) have been used for dissimilarity measurement. The purpose of KS test which is based on empirical distribution function is to find out whether two samples follows the same distribution or not [12]. KS value for two discrete sets X and Y is defined by

$$\begin{aligned} d_{ks}(n,m)\,=\,sup_{x} \Vert F_{1,m}{x} - F_{2,n}{x}\Vert \end{aligned}$$
(2)

where sup is the supremum function, and \(F_{1,m}\) and \(F_{2,n}\) are empirical distributions of the two samples respectively, with m and n to be the sizes of two samples respectively. KS test generates a statistical value that is the measure of similarity and a p-value (\(p\_val\)) that is the measurement of confidence associated with each hypothesis. Hausdorff distance measures how much two subsets of a metric space are distant from each other [13]. Hausdorff value for two subsets X and Y is defined by

$$\begin{aligned} \begin{aligned} d_{ks}(X,Y)\,=\,max\{sup_{x \in X} \{inf_{y \in Y} d(x,y)\}, \\ sup_{y \in Y} \{inf_{x \in X} d(x,y)\}\} \end{aligned} \end{aligned}$$
(3)

where sup is the supremum function and inf is the infimum function and d is the distance metric used. For our approach, KS statistical values only with p-value more than a threshold probability is taken into consideration. Both Hausdorff and KS statistical values are combined after normalization process, denoted as \(cmb\_dist\). Plot in Fig. 5(c) shows how the combined value of KS test and Hausdorff distance is changing for the test signals in the window range. The test cycle generating minimum combined distance (\(min\_cmbdist\)) is selected as the final complete cycle.

Fig. 6.
figure 6

A complete single cycle extracted from a signal with highlighted features i.e. maximum foot flat, toe off, maximum swing, and heel strike.

Gait Features Selection. After gait cycles are extracted, values of the signal at events such as toe off, heel strike, foot flat were computed from each gait cycle. Then average values of these features for all extracted gait cycles are taken as feature representation of a particular signal and has been used for statistical comparison. We discarded outliers from the feature values before averaging process. Figure 6 shows an example of the features selected from an individual cycle.

5 Result Analysis and Discussion

A gait cycle is considered complete if it consists of the following gait events: heel strike, foot flat, toe off, and mid-swing. Table 1 shows a comparison based on the percentage of ‘complete gait cycles’ extracted by each of the methods for different gait types with respect to speed. We define ‘complete gait cycles’ by the cycles which contains all four events i.e. swing, toe-off, heel strike, and foot flat. Any cycle missing even one of the feature values is considered as incomplete gait cycle. From Table 1, it can be observed in most of the cases, performance of FFT is average. Although it produces large number of cycles, but large portion of these cycles are incomplete cycles. ACF on the other hand, shows a remarkable performance for z-axis gyroscopic data, but fails to perform for y-axis gyroscopic data, specially for low speed gait. However, we can observe a consistent good performance of our method for all types of gait data even for slow speed gaits. A clearer representation of the performance of all three methods are presented in Fig. 7 for both high and slow speed.

Fig. 7.
figure 7

Percentage of complete gait cycles extracted by ACF, FFT and proposed method for different types of gait data with (a) 3 km/h and (b) 1.5 km/h

Table 1. Percentage of complete gait cycles extracted by ACF, FFT and proposed method for different types of gait data with 3 km/h and 1.5 km/h speeds.

We analyzed the feature values produced by each methods and a comparative study of the standard error values of each feature for different gait signal categories are shown in Table 2. Standard error (se) is defined by

$$\begin{aligned} \frac{sd(x)}{\sqrt{\sum _{i=1}^{n}(x)}} , \end{aligned}$$
(4)

where sd is the standard deviation and x is a vector of numerical observations. From Table 2 it can be observed, while the performance of cACF and FFT is inconsistent for different conditions, performance of our proposed method is on average good throughout all the test case situations. For low speed gait signals, when the signal is expected to be highly quasi-periodic, both cACF and FFT succeeds occasionally, for example, normal swing phase y-axis data, or equinus both heel strike z-axis data, but fails to perform on most of the other cases. For better understanding, mean and standard deviations of the error values of each methods are also presented as summary in Table 3. From Table 3, lower standard deviation of standard error in low speed gait supports the fact that our proposed method worked well on the overall data compared to cACF and FFT.

Table 2. Standard errors of features generated by ACF, FFT (Spectrum Analysis) and proposed method for different gait types (normal, equinus right, equinus both) of different gait speeds
Table 3. Mean and standard deviations of the standard errors of ACF, FFT and proposed method
Table 4. Fisher Discriminant Ratios (FDRs) of the gait features extracted by the proposed method

To analyze the features extracted by the proposed method, Fisher Discriminant Ratio (FDR) of each of the features are examined. FDR is used to find the contribution of features to distinguish between classes. It is defined by

$$\begin{aligned} \frac{\sum _{k=1}^{C} p_{k}(\mu _{k} - \mu )^2}{{\sum _{k=1}^{C} \sigma _{k}^2}} , \end{aligned}$$
(5)

where C is the number of classes, \(p_{k}\) is the probability of class k and \(\mu _{k}\) and \(\sigma _{k}\) is the standard deviation of each class, whereas \(\mu \) is the overall mean. FDR values of each feature extracted by our proposed method is presented in Table 4. Heel_strike has the highest FDR value, swing amplitude being the second highest FDR value. We can conform from this analysis, these two features are more significant than the rest of the features.

Complexity Analysis

The computational complexity of cACF method is O(\(L^2\)), where L is length of the signal. While using the spectrum analysis method, the signal goes through Fast Fourier Transform which has time complexity of O(\(L*logL\)), where L is length of the signal [14]. In our algorithm, apart from signal length, the complexity depends upon the length of testing range, \(w_{size}\), and the complexity of similarity measurements. Distance calculation methods depends on the length of the vectors, i.e. in our case is length of the base cycle(\(b_l\)) and the test cycles(\(t_l\)) which is again dependent on \(w_{size}\). Therefore, we can say the similarity measurement is of complexity \(O(b_l*w_{size})\). Finally, the total complexity of the proposed method becomes \(O(L*b_l*{w_{size}}^2)\). When the signal is too long, \(b_l\) can be ignored compared to L and the complexity reduces to \(O(L*{w_{size}}^2)\). For small length gait signals, complexity of the proposed method is less than ACF. When \(w_{size}\) is very small compared to length of the signal, L, the proposed method shows lower time complexity than spectrum analysis.

6 Conclusion

For modeling different types of abnormal gait, it is required to capture slow speed gait data from the participants having gait abnormality. In our experimental research we observed that slow speed gait is of highly quasi-periodic nature. Existing methods considering singular periodicity are able to detect relatively less number of complete cycles for quasi-periodic signals which may lead to major loss of information. A varying periodicity detection algorithm has been proposed to address this issue. It has been understood from the comparative result analysis that the proposed approach is able to extract more number of complete gait cycles with significant feature information. For feature analysis, a statistical technique, FDR, has been applied to evaluate the reliability of extracted features for discriminating normal and abnormal gait pattern. From the complexity analysis, the following observations can be stated: (i) Circular ACF is more computationally intensive than the proposed method. (ii) Spectrum analysis method has lower computational complexity for small length signals. For long-duration gait data, our method demonstrates lower computational complexity than spectrum analysis. The proposed algorithm shows promises to be used to extract cycles from other quasi-periodic signals such as electro-myography (EMG) signals of muscles activity or electroencephalography (EEG) signals from brain, with the prior knowledge of the repetitive pattern.