# Template-Based Step Detection with Inertial Measurement Units

Laurent Oudre, Rémi Barrois-Müller, Thomas Moreau, Charles Truong, Aliénor Vienne-Jumeau, Damien Ricard, Nicolas Vayatis, Pierre-Paul Vidal

► To cite this version:

Laurent Oudre, Rémi Barrois-Müller, Thomas Moreau, Charles Truong, Aliénor Vienne-Jumeau, et al. Template-Based Step Detection with Inertial Measurement Units. Sensors, 2018, 18 (11), pp.4033. 10.3390/s18114033. [https://hal.science/hal-02442709](https://hal.science/hal-02442709)

HAL Id: hal-02442709

https://hal.science/hal-02442709

Submitted on 27 May 2021

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

Article

# Template-Based Step Detection with Inertial Measurement Units

Laurent Oudre<sup>1,2,*</sup>, Rémi Barrois-Müller<sup>2</sup>, Thomas Moreau<sup>3,2</sup>, Charles Truong<sup>3,2</sup>, Aliénor Vienne-Jumeau<sup>2</sup>, Damien Ricard<sup>4,2</sup>, Nicolas Vayatis<sup>3,2</sup> and Pierre-Paul Vidal<sup>5,2 ID</sup>

Received: 7 October 2018; Accepted: 16 November 2018; Published: 19 November 2018

<figure><img src="image_3.png" /></figure>

check for
updates

**Abstract:** This article presents a method for step detection from accelerometer and gyrometer signals recorded with Inertial Measurement Units (IMUs). The principle of our step detection algorithm is to recognize the start and end times of the steps in the signal thanks to a predefined library of templates. The algorithm is tested on a database of 1020 recordings, composed of healthy subjects and patients with various neurological or orthopedic troubles. Simulations on more than 40,000 steps show that the template-based method achieves remarkable results with a 98% recall and a 98% precision. The method adapts well to pathological subjects and can be used in a medical context for robust step estimation and gait characterization.

**Keywords:** inertial measurement units; gait analysis; biomedical signal processing; pattern recognition; step detection; physiological signals

## 1. Introduction

Human locomotion is a complex mechanism composed of a succession of strides, steps, and phases [1,2]. Some pathologies (such as Parkinson's disease, arthritis, stroke, obesity, diabetes, etc.) may alter the locomotion, threatening the autonomy of patients and increasing the risk of fall. The objective quantification and assessment of locomotion is therefore a crucial problem, that has been addressed in the literature by measuring the movement with several types of sensors such as inertial sensors, instrumented mat, force platforms, camera-optical tracking system or force-sensitive resistors insoles. The signals obtained from these sensors are processed (automatically or manually) so as to extract some features that characterize the locomotion (speed, variability, smoothness, etc.). Computing these features can help to compare subjects or to provide a follow-up on a particular subject [3–10].

Since the breakthrough of low-cost sensors, numerous works have focused on the quantification and characterization of locomotion with Inertial Measurement Units (IMU) composed of accelerometers, gyroscopes and magnetometers. The main advantages of these sensors is that they are relatively low-cost, they do not require a dedicated room for the experiments, and their small size makes them easy to handle in day-to-day clinical situations. They have proven to give interesting results in several clinical studies in rehabilitation [2,11,12], neurology [13–15], orthopedics, physical therapy, functional electrical stimulation (FES) [16,17] etc.

Among the gait features that have proved their relevance in a medical context, several are linked to the notion of step (step duration, variation in step length, etc.), which can be seen as

<footnote n="1">1 L2TI, University Paris 13, 93430 Villetaneuse, France</footnote>

<footnote n="2">2 COGNAC-G (UMR 8257), CNRS Service de Santé des Armées University Paris Descartes, 75006 Paris, France</footnote>

<footnote n="3">3 CMLA (UMR 8536), CNRS ENS Paris-Saclay, 94235 Cachan, France</footnote>

<footnote n="4">4 Service de neurologie, Hôpital d'Instruction des Armées Percy, Service de Santé des Armées, 92190 Clamart, France</footnote>

<footnote n="5">5 Hangzhou Dianzi University, Hangzhou 310005, Zhejiang, China</footnote>

<footnote>* Correspondence: laurent.oudre@univ-paris13.fr; Tel.: +33-1-49-40-40-63</footnote>
the core atom of the locomotion process [3–9]. Many algorithms have therefore been developed to automatically (or semi-automatically) detect the gait events (such as heel-strikes, heel-off, etc.) from accelerometer/gyrometer signals [4,6,7,11–15,18–32]. Most of the time, the algorithms used for step detection are dedicated to a specific population (healthy subjects [6,22,24–28], elderly subjects [3,19,20], Parkinson patients [33], etc.) and only a few publications deal with heterogeneous populations composed of several types of subjects [4,5,7,11,13,15,18,23]. Another limit to existing algorithms is that they often focus on locomotion in established regime (once the subject has initiated its gait) and do not deal with steps during U-turn, gait initiation or gait termination. Yet, initiation and termination steps are particularly sensitive to pathological states. For example, the first step of Parkinsonian patients has been described as slower and smaller than the first step of age-matched subjects [34]. U-turn steps are also interesting since 45% of daily living walking is made up of turning steps, and when compared to straight-line walking, turning has been emphasized as a high-risk fall situation [35]. This argues for reliable algorithms that could detect initiation, termination and turning steps in both healthy and pathological subjects.

The common approach for step detection is based on the use of filtering/thresholding/peak
detection techniques [6,7,11–15,21–32] that are applied on the accelerometer/gyrometer signals.
The aim is to recognize one specific event, supposedly characteristic of the step (such as a local
maximum or the time when the signal exceeds a threshold). First, a preprocessing step is performed
where the signal is filtered so as to emphasize the event that they seek to detect or to remove
other events. The most well-known preprocessing stage was introduced by Pan-Tompkins [36]
and is composed of several signal processing blocks (bandpass filtering, derivation, squaring,
etc.). Designed at first for ECG signals, this preprocessing has been used in various step detection
methods [11,21,29,30]. Wavelets transforms have also proven to give good preprocessing results [25].
After this possible preprocessing stage, the steps are detected with empirical or dynamic thresholds,
peak detection methods, of a combination of both. Other methods seek to detect each phase of the
walking process by using dedicated signal processing techniques (such as peak detection, zero-crossing,
etc.). Unfortunately, all these methods heavily rely on the calibration of several parameters (width of
the bandpass filter, window length, thresholds, etc.) which are difficult to estimate and thus often set
according to empirical experience. This calibration might be tricky, especially if the algorithm is to be
used on subjects with different pathologies or different degrees of severity [7]. In addition, most of
the algorithms designed for a particular type of subject may suffer from degraded performance in
other cohorts [11].

For these reasons, some articles have mentioned the use of templates for step detection [18–21,37].
In this context, a template can be seen as a typical step, whose characteristics (amplitude, shape,
duration) are typical of a type of step. Existing step detection methods using templates have only
investigated the possibility of using one [19–21] or two [18] templates. These templates can either be
manually defined [20] or extracted from the data for one subject [19,21] or from a training database [18].
We propose to extend this idea by constructing and using a library of several templates, composed of a
large set of typical steps that may be found in several pathologies or experimental conditions. The main
intuition behind this is that it is a known medical fact that there exist several types of steps (according to
interpersonal variability, age, speed and pathology). The existence of different types of steps is in
fact a taxonomy based on the clinical examination of the patients as it developed throughout the past
century in hospitals. In that sense, the use of templates can be seen as an attempt to emulate clinics.
Therefore, it might be complicated to try to detect steps with one specific model (which is implicitly
what is done when using one template or when using filtering/thresholding/peak detection methods
that depend on one set of parameters, thresholds, detection criteria, etc.) In order to overcome this
issue, it can be useful to use a library of models (in our case, a library of templates) which represent
typical step cycles from healthy, pathological, young, elderly, etc. subjects. Hopefully, the use of this
library can improve the robustness of the detection and paradoxically, prevent the overfitting induced
by the choice of many parameters. This approach can also enable one to deal with complicated cases
such as pathological steps, or steps that occur during initiation, U-turn or termination.

This article is organized as follows: Section 2 describes the data and the protocol, as well as the
data annotation process. Section 3 describes the step detection method based on template matching.
Section 4 presents the results of our method and a comparison to state-of-the art methods. Section 5
provides a discussion on the robustness of the method and several insights for the possible use of this
algorithm in a clinical context.

## 2. Data and Experiments

### 2.1. *Data Acquisition and Protocol*

The data used for the conception and testing of the method presented in the article has been
provided by the following medical departments: Service de chirurgie orthopédique et de traumatologie
de l'Hôpital Européen Georges Pompidou, Assistance Publique des Hôpitaux de Paris, Service de
médecine physique et de réadaptation de l'Hôpital Fernand Widal, Assistance Publique des Hôpitaux
de Paris, Service de neurologie de l'Hôpital d'Instruction des Armées du Val de Grâce, Service de Santé
des Armées. The study was validated by a local ethic committee (Comité de Protection des Personnes
Ile de France II, CPP 2014-10-04 RNI) and both patients and control subjects gave their written consent
to participate. All signals have been acquired at 100 Hz with wireless XSens MTw™ sensors (autonomy
6 h, device dimension 47 × 30 × 13 mm, weigth 16 g, acceleration range ±160 m/s², angular velocity
range ±2000 deg/s, dynamic accuracy roll/pitch 0.75 deg RMS, dynamic accuracy heading 1.5 deg
RMS) located at the right and left foot and fixed using a Velcro band designed by XSens™. XSens sensors
were chosen based on their relatively low cost, the availability of raw data as well as previous analysis
that enlightened their widespread use in clinical settings [38]. As for the location of the sensors,
we used data from a sensor placed on the dorsal part of one foot to detect steps based on previous work
which proved high reliability and precise phase detection using such an apparatus [2]. One noticeable
advantage of such a position is the possibility to use a second symmetrical sensor for direct back-up
without changing the algorithm. Besides, as opposed to detection algorithm from lower back sensors,
direct data are used (one step being defined as the foot—and not the trunk—displacement). For the
routine clinical examination of patients, two other sensors were also placed in the back at L5 level and
on the front of the head. These data, although of use for the description of the clinical syndromes we
quantified, will not be considered further as this manuscript focuses on step detection.

The signals obtained with both sensors were automatically synchronized by the acquisition
software. All subjects were asked to:

* stand quiet for 6 s

* walk 10 m at preferred walking speed on a level surface

* make a U turn

* walk back

* stand quiet 2 s

For practical reasons, patients kept their own shoes. Average speeds ranged from 1 m·s⁻¹
to 1.8 m·s⁻¹. The database is composed of 230 subjects who performed the protocol between
1 and 10 times, which totals 1020 recordings. The subjects' characteristics are presented in Table 1.
Healthy subjects had no known medical impairment. The orthopedic group is composed of 2 cohorts
of distinct pathologies: lower limb osteoarthrosis and cruciate ligament injury. The neurological group
is composed of 4 cohorts: hemispheric stroke, Parkinson's disease, toxic peripheral neuropathy and
radiation induced leukoencephalopathy.
<table><caption>**Table 1.** Subjects' characteristics. For the age, height and weight, the mean and the standard deviations are displayed.</caption><thead><tr><th>Group</th><th>Number of Exercises</th><th>Number of Subjects</th><th>Sex (M/F)</th><th>Age (year)</th><th>Height (cm)</th><th>Weight (kg)</th></tr></thead><tbody><tr><td>Healthy subjects</td><td>242</td><td>52</td><td>35/17</td><td>36.4 (20.6)</td><td>173.4 (10.8)</td><td>70.7 (12.2)</td></tr><tr><td>Orthopedic diseases</td><td>243</td><td>53</td><td>26/27</td><td>60.1 (19.3)</td><td>169.2 (10.2)</td><td>77.4 (16.8)</td></tr><tr><td>Neurological diseases</td><td>535</td><td>125</td><td>80/45</td><td>61.6 (13.2)</td><td>169.8 (8.7)</td><td>72.7 (15.5)</td></tr><tr><td><strong>Total</strong></td><td>1020</td><td>230</td><td>141/89</td><td>55.5 (19.6)</td><td>170.5 (9.7)</td><td>73.4 (15.3)</td></tr></tbody></table>

The protocol includes 2 sensors (left and right foot), and each of them records a 9-dimensional signal (3D accelerations, 3D angular velocities, 3D magnetic fields), possibly with some re-calibrated data provided by the XSens™ software (such as the vertical acceleration in the direction of the gravity). Instead of considering all these dimensions, we decided to only use a subset of them, and select the most relevant in the context of step detection. This decision has been made based on observations of real data and physiological reasons provided by medical doctors (see Acknowledgments and [2,39,40]). We decided to only select the components that were most reflective of the locomotion process (see Figure 1 for the definition of the axis): the Z-axis acceleration, the recalibrated vertical acceleration (vertical movements of the foot) and the Y-axis angular velocity (swing in the direction of the walk).

<figure><img src="image_4.png" /><figcaption>**Figure 1.** Presentation of the XSens™ sensor. (a) XSens™ sensor; (b) Definition of the axis for the XSens™ sensor located at the left foot.</figcaption></figure>

## 2.2. Data Annotation

Several publications related to automatic step detection have provided a comparison of their results with existing systems such as 3D motion tracking systems [15,19,22,27], video camera [19,26], force platforms [26,27] or instrumented mat [5,7,20,24,25]. However, this comparison, while allowing an objective evaluation of the algorithm, is not easily feasible on a large scale due to practical reasons. Indeed, a strict comparison of our results with other types of step detection would require to test the six different cohorts of patients we have presently tested with IMUs with a 3D tracking system, which is not easily transported in various hospitals and impossible to use in the context of a daily clinical routine. Since the aim of this article is to provide a method that adapts well to different contexts and types of subjects and pathologies, we chose to use a light protocol that was compatible with clinical constraints, so as to maximize the size of the cohorts.

In that context, the evaluation of the method and the determination of the library of templates was therefore performed thanks to manual annotations provided by experts that were trained to deal with physiological signals. These experts have been trained on two gait validation tools (instrumented mat: GAITRite from CIR Systems and motion capture: CodaMotion) in a preliminary study, so as
to learn how to annotate the signals. This learning phase was performed on five healthy subjects in laboratory conditions and the manual annotation error was calculated as 2 samples (std : 1.0) with CodaMotion and 1.7 samples (std : 1.2) with the GAITRite.

All steps were manually annotated by specialists using a software allowing to point with the mouse the starts (foot-flat) and the ends (heel-off) of the foot flat periods during which the sensor is not moving. The annotations were performed thanks to the Z-axis acceleration (normal to the upper foot surface) which is the most sensitive direction to detect the movements of the foot with respect to the floor. For the tricky cases of pathological gaits, a first gross annotation was made and then refined by zooming in on each step. The uncertainty of this annotation is evaluated to less than 0.2 s (20 samples) for each mouse click. In total, the database is composed of 40,465 steps (20,240 extracted on the right foot and 20,225 on the left foot). Even though they had a distinct shape, the U-turn steps were also taken into account. In the database, 2671 steps are considered as belonging to the U-turn.

Examples of these 3 components (Z-axis acceleration, vertical acceleration and Y-axis angular velocity) recorded at the right foot are presented on Figure 2a,b for respectively an healthy and hip-injured patient. It appears in these figures that the amplitudes of the signals are clearly different and it is likely that classical threshold-based methods would hardly perform well on both subjects. However, the structure and shape of the step is roughly the same for both subjects so it might be relevant to use a template-based method. Nevertheless, these examples also display the main difficulties in conceiving an automatic algorithm for step detection:

* The uncertainties in the definition of the starts and ends of the steps. Indeed, we can see in Figure 2a, that many choices would be acceptable: depending on the considered definition, the results may be different.

* The variability of the step patterns according to the pathology, the age, the weight, etc. For example, on Figure 2b, the subject is dragging his feet, causing an abrupt change in the step pattern (noisy part at the end of the step).

<figure><img src="image_5.png" /><figcaption>**Figure 2.** Vertical acceleration, Z-axis acceleration and the Y-axis angular velocity recorded from the right foot. The vertical dot lines display the different possibilities for start/end times and the plain lines display the choice made by the experts.</figcaption></figure>

# 3. Method

## 3.1. *Library of Templates*

The library of templates was manually chosen by the experts that made the annotations in order to cover most of the cases that were seen in the data. In total, 55 templates have been chosen by the experts. Among these 55 templates, 14 belong to healthy subjects, 12 to orthopedic subjects and 29 to neurological subjects. One template corresponds to a U turn step, 10 templates to initiation steps and one template to a termination step. The step durations go from 65 samples to 96 samples with an average of 76.9 samples.
## 3.2. Step Detection

The principle of our step detection algorithm is to recognize the steps in the signals thanks to a predefined set of templates. More precisely, our method uses a set of templates $\mathcal{P}$: these templates have been manually extracted from real accelerometer data and checked by medical doctors and specialists of locomotion. Each template $p \in \mathcal{P}$ is a matrix of size $3 \times N_p$ and corresponds to one step. $N_p$ is the number of samples of the template, and 3 is the number of components (vertical acceleration, Z-axis acceleration and Y-axis angular velocity).

These templates are to be compared to the signal we want to study by calculating some correlation coefficients. As the sequences we want to detect are variable in duration as well as in amplitude, we want to use a measure of fit that is independent of the scale but is able to identify the correspondences in shape. In addition, we want the comparison to be independent of the orientation of the sensor, so any DC component should be removed. In this context, it seems natural to use the Pearson correlation coefficient, which satisfies all these conditions, and is defined for two one-dimensional vectors $y$ and $z$ of length $n$ as

$$ \rho(y,z) = \frac{\operatorname{cov}(y,z)}{\sigma_y \sigma_z} = \frac{E[(y - \mu_y)(z - \mu_z)]}{\sigma_y \sigma_z} \quad (1) $$

where $(\mu_y, \mu_z)$, $(\sigma_y, \sigma_z)$ are respectively the mean and standard deviation of $y$ and $z$.

Let $x$ be a multivariate signal, represented by a matrix of size $3 \times N_x$: we want to detect the steps by using the set of templates $\mathcal{P}$. Let us introduce the following notations:

* $N_p$ is the number of three-dimensional templates

* $N_x$ (resp. $N_p$) is the number of samples of $x$ (resp. $p$)

* $x^{(k)}$ (resp. $p^{(k)}$) is the $k$th component of $x$ (resp. $p$). In our case we have $k \in \{1, 2, 3\}$

* $x^{(k)}[t_1 : t_2]$ is the portion of $x^{(k)}$ between time samples $t_1$ and $t_2$ (we therefore have $x^{(k)}[1 : N_x] = x^{(k)}$)

The first step of the algorithm consists in calculating the Pearson correlation coefficients between the templates and the signal, for all possible time positions and all three components:

$$ \forall k \in \{1, 2, 3\}, \forall p \in \mathcal{P}, \forall t \in [1, N_x - N_p + 1] \quad r(k, p, t) = \rho(p^{(k)}, x^{(k)}[t : t + N_p - 1]) \quad (2) $$

$r(k, p, t)$ is the correlation between the $k$th component of template $p$ and the $k$th component of the signal at time sample $t$. More precisely, we first pick one template $p$ and one its component (for instance the Z acceleration $p^{(1)}$). This template is then slid along the corresponding component of the signal $x$ (i.e., the Z acceleration $x^{(1)}$) and the correlation coefficient is computed for all lag positions. This process is then reiterated with the second and the third component, and then for each template. The algorithm runs until all correlations have been computed (all templates $p \in \mathcal{P}$, all components $\in \{1, 2, 3\}$ and all lag positions $t \in [1, N_x - N_p + 1]$).

The second step is a local maxima search among the $r(k, p, t)$ coefficients in order to extract the possible steps. $r(k, p, t)$ is selected as a local maximum if it is greater than its nearest temporal neighbors. We define the set $\mathcal{L}$ of possible steps as:

$$ \mathcal{L} = \{(k, p, t) \text{ s.t. } r(k, p, t) > r(k, p, t-1) \text{ and } r(k, p, t) > r(k, p, t+1)\} \quad (3) $$

The set $\mathcal{L}$ contains all acceptable positions for the steps, and the coefficients $r(k, p, t)$ with $(k, p, t) \in \mathcal{L}$ can be interpreted as the likelihood of having a step similar to the pattern $p$ starting at time sample $t$.

Our step detection algorithm takes as input the set $\mathcal{L}$ and works as a greedy process. At each iteration, the largest value $r(k^*, p^*, t^*)$ with $(k^*, p^*, t^*) \in \mathcal{L}$ is selected: if the step $p^*$ positioned at time
sample $t^*$ overlaps with a previously detected step, it is discarded and we switch to the next largest value. Otherwise, if step $p^*$ can be positioned at time $t^*$, the step is detected and all time samples between $t^*$ and $t^* + N_{p^*} - 1$ are forbidden for the next iterations. The process is stopped when all time samples are forbidden, when the set of possible steps $\mathcal{L}$ is empty, or when all values $r(k, p, t)$ with $(k, p, t) \in \mathcal{L}$ are lower than a threshold $\lambda$. Note that in practice, the main purpose of threshold $\lambda$ is to speed up the algorithm, as it reduces the size of set $\mathcal{L}$. The algorithm is summarized in Algorithm 1 and illustrated in Figure 3.

<figure><img src="image_6.png" /><figcaption>Figure 3. Chartflow of the step detection method.</figcaption></figure>

A last post-processing step can be performed so as to discard the steps detected when the subject was actually not moving. These false detections occur when a fit is found with one template, even though the signal is almost equal to zero after DC component removal: this is in fact due to the invariance in scale provided by the Pearson correlation coefficients. A solution can be found by processing the final list of detected steps, and removing the steps whose standard deviation is way lower than the one of the template that was used for the detection. Formally, this step involves a threshold $\mu$: given a detected step with start and end times $t_{start}$ and $t_{end}$, detected thanks to the pattern $p^{(k)}$, the step is to be discarded if

$$ \sigma_{x^{(k)}[t_{start}:t_{end}]} < \mu \sigma_{p^{(k)}} \quad (4) $$

where $\sigma$ stands for the empirical standard deviation operator.

In the presented method, $\lambda$ is set to 0.6 and $\mu$ to 0.1. The influence of these parameters will be described in the Discussion section.
**Algorithm 1:** Step detection algorithm.

**Input:** Set of possible steps $\mathcal{L}$

**Output:** Set of start times $\mathcal{T}_{start}$, set of end times $\mathcal{T}_{end}$

Set of forbidden time positions $\mathcal{F} = \emptyset$;

$\mathcal{T}_{start} = \emptyset, \mathcal{T}_{end} = \emptyset$;

while $\mathcal{F} \neq \{1, \dots, |x|\}$ or $\mathcal{L} \neq \emptyset$ or $\max_{(k,p,t) \in \mathcal{L}} r(k, p, t) > \lambda$ do

$\mathcal{L} = \argmax_{(k,p,t) \in \mathcal{L}} r(k, p, t);$

if $\{t^*, \dots, t^* + N_{p^*} - 1\} \notin \mathcal{F}$ then

$t^* \to \mathcal{T}_{start};$

$t^* + N_{p^*} - 1 \to \mathcal{T}_{end};$

$\{t^*, \dots, t^* + N_{p^*} - 1\} \to \mathcal{F};$

end

$\mathcal{L} = \mathcal{L} \setminus (k^*, p^*, t^*);$

end

# 4. Results

This section presents the results of the template-based method and of a state-of-the-art method on the database composed of healthy, neurological and orthopedic subjects.

## 4.1. Evaluation Metrics

The following precision/recall metrics are used for the evaluation of our method based on the annotations provided by the specialists.

* **Precision (or positive predictive value).** A detected step is counted as correct if the mean of its start and end times lies inside an annotated step. An annotated step can only be detected one time. If several detected steps correspond to the same annotated step, all but one are considered as false. The precision is the number of correctly detected steps divided by the total number of detected steps.

* **Recall (or sensitivity).** An annotated step is counted as detected if the mean of its start and end times lies inside a detected step. A detected step can only be used to detect one annotated step. If several annotated steps are detected with the same detected step, all but one are considered undetected. The recall is the number of detected annotated steps divided by the total number of annotated steps.

* **ΔStart.** For a correctly detected step, it is the difference between the detected start time and the annotated start time.

* **ΔEnd.** For a correctly detected step, it is the difference between the detected end time and the annotated end time.

* **ΔDuration.** For a correctly detected step, it is the difference between the duration of the detected step and the duration of the annotated step.

## 4.2. State-of-the-Art

The reference procedure for step counting/detection is based on the Pan-Tompkins method [36]. First intended for ECGs, it was later adapted to detect steps in the vertical accelerometer signal [11,21,29,30]. It is composed of several successive signal processing steps, which are designed to emphasize the structure of the step, making it easier to detect. These steps can be summarized as:
* Bandpass filtering (between $f_{min}$ and $f_{max}$): removes the gravity component and the noise.

* Derivation: amplifies the slope changes in the filtered signal. Whenever the foot rises from the ground or the heel hits the ground, the acceleration slope changes significantly and it translates into a burst in the filtered signal.

* Squaring: makes all points positive and enhances the large values of the filtered signal.

* Integration: the signal is smoothed using a moving-window integrator of length $N_{inte}$.

* Peak search procedure: originally, Pan & Tompkins [36] used a threshold to find the phenomena they were looking for in the heart rate signal (every time the filtered signal was above the threshold, it was considered as detected). When they adapted the algorithm to the step detection problem, Ying et al. [21] relied on the fact that the filtered signal showed great regularity: a small peak was always followed by a bigger one (respectively matching the foot lift and the heel strike). The time span of the second peak was defined as the peak-searching interval on the real acceleration signal. The maximum on that interval was considered a step.

Note that this step detection procedure only allows to detect steps but not to precisely know the start and end times of the step. In addition, this method is not designed to perform properly during periods of no activity. We therefore added a post-processing step, which, once a step is detected, compares the standard deviation of a neighborhood around the detected peak to a noise level. The size of the neighborhood, as well as the noise level, are optimized by grid search so as to give the best performances.

In Ying et al. [21], the parameters used are $f_{min} = 0$ Hz, $f_{max} = 20$ Hz, $N_{inte} = 0.1$ s. The peak search procedure is performed sequentially: they select one peak every other peak, starting with the second one. With these parameters, we obtain from our database a recall of 99.53% and a precision of 51.20%. In fact, the peak-search procedure is not adapted and tends to detect several peaks within a step except for one. This phenomenon has already been described by several authors [29,30].

In order to objectively compare our method to the Pan-Tompkins, we tested several values for $f_{min}$, $f_{max}$ and $N_{inte}$, as well as a more relevant peak-search procedure, which only selects the local maxima among the detected peaks, thus preventing multiple detections. In total, 5 parameters need to be optimized by grid search (filter bandpass × 2, integration window, neighborhood size and noise level). The results presented for this method are therefore optimized on the whole database so as to maximize the F-measure.

### 4.3. Results

The average recall for the template-based method is 98.34% and the average precision is 98.30%. For the Pan-Tompkins method, the average recall is 97.82% and the average precision is 95.72%. Detailed results by group of subjects are presented in Table 2. Differences between the two methods are significant (signed-rank Wilcoxon test, *p*-value < 0.01) for all groups and all metrics except for recall in the Healthy group (see Table 2). For the template-based method, the differences between the groups are all significant (Mann-Whitney rank test, *p*-value < 0.01) except for the precision between the Healthy and Orthopedic groups and the precision between the Orthopedic and Neurological groups. For the Pan-Tompkins method, the differences between the groups are all significant (Mann-Whitney rank test, *p*-value < 0.01) except for the recall between the Healthy and Orthopedic groups and for the precision between the Orthopedic and Neurological groups.
<table><caption>**Table 2.** Precision and recall scores for the template-based method and the Pan-Tompkins method. Means and standard deviations are displayed, along with *p*-values of the signed-rank Wilcoxon test.</caption><thead><tr><th rowspan="2">Group</th><th colspan="2">Template-Based Method</th><th colspan="2">Pan-Tompkins</th><th colspan="2">p-Value</th></tr><tr><th>Recall</th><th>Precision</th><th>Recall</th><th>Precision</th><th>Recall</th><th>Precision</th></tr></thead><tbody><tr><td>Healthy subjects</td><td>99.31 (1.75)</td><td>99.13 (1.86)</td><td>99.14 (1.71)</td><td>97.09 (3.60)</td><td>0.286</td><td>1.57 × 10<sup>-19</sup></td></tr><tr><td>Orthopedic diseases</td><td>97.64 (2.73)</td><td>98.20 (3.93)</td><td>98.78 (2.09)</td><td>94.87 (5.09)</td><td>1.73 × 10<sup>-8</sup></td><td>4.02 × 10<sup>-23</sup></td></tr><tr><td>Neurological diseases</td><td>98.23 (3.42)</td><td>97.98 (3.33)</td><td>96.80 (3.52)</td><td>95.49 (4.55)</td><td>9.90 × 10<sup>-24</sup></td><td>6.95 × 10<sup>-42</sup></td></tr><tr><td><strong>Total</strong></td><td>98.34 (3.00)</td><td>98.30 (3.25)</td><td>97.82 (3.07)</td><td>95.72 (4.56)</td><td>7.49 × 10<sup>-7</sup></td><td>6.95 × 10<sup>-80</sup></td></tr></tbody></table>

The performances of our method vary according to the type of steps (initiation/termination, U-turn or normal steps): detailed results by types of steps are presented in Table 3. The best results are obtained for normal steps (99.58% recall and 99.04% precision) and the worst obtained for U-turn steps (83.87% recall and 90.76% precision). The same situation is observed for the Pan-Tompkins method (95.59% recall and 98.86% precision for normal steps) with a large drop in the precision for U-turn steps (88.12% recall and 50.51% precision). Detailed results

<table><caption>**Table 3.** Precision and recall scores for the template-based method and the Pan-Tompkins method for different types of steps. Means and standard deviations are displayed.</caption><thead><tr><th rowspan="2">Type of steps</th><th colspan="2">Template-Based Method</th><th colspan="2">Pan-Tompkins</th></tr><tr><th>Recall</th><th>Precision</th><th>Recall</th><th>Precision</th></tr></thead><tbody><tr><td>Normal (33,764 steps)</td><td>99.58 (1.51)</td><td>99.04 (3.39)</td><td>95.59 (5.20)</td><td>98.86 (2.54)</td></tr><tr><td>Initiation (2040 steps)</td><td>96.37 (13.88)</td><td>97.75 (11.50)</td><td>95.59 (15.02)</td><td>95.93 (15.02)</td></tr><tr><td>Termination (2040 steps)</td><td>94.17 (17.37)</td><td>95.10 (15.83)</td><td>93.77 (16.95)</td><td>93.77 (16.95)</td></tr><tr><td>U-turn (2621 steps)</td><td>83.87 (27.88)</td><td>90.76 (23.96)</td><td>88.12 (23.45)</td><td>50.51 (30.23)</td></tr></tbody></table>

For all 39,706 steps that have been correctly detected by the template-based method, the average ΔStart is -0.7 samples (std : 9.4 samples), the average ΔEnd is -2.1 samples (std : 10.3 samples) and the average ΔDuration is -1.4 samples (std : 13.5 samples). Metrics are not available for the Pan-Tompkins method since it does not retrieve the start and end times of the steps. The histograms or the metrics ΔStart, ΔEnd, ΔDuration for all the correctly detected steps (39,706 here) for the template-based method are presented in Figure 4.

<figure><img src="image_7.png" /><figcaption>**Figure 4.** Cont.</figcaption></figure>
<figure><img src="image_8.png" /><figcaption>**Figure 4.** Differences between detected and annotated times ΔStart, ΔEnd, ΔDuration for the template-based method. The histograms are computed from the 39,706 steps that are correctly detected by the template-based method.</figcaption></figure>

The median absolute errors for the start times, end times and durations are displayed in Table 4. For standard configurations (healthy subjects and normal steps), these median errors range from four samples (0.04 s) to seven samples (0.07 s). However, for complex cases such as U-turn steps or pathological subjects, the median error can increase up to 15 samples (0.15 s).

<table><caption>**Table 4.** Median absolute errors of ΔStart, ΔEnd, ΔDuration (in samples) for different types of subjects and steps. Results are displayed as ΔStart / ΔEnd / ΔDuration.</caption><thead><tr><td>Type of Steps</td><td>Healthy Subjects</td><td>Orthopedic Diseases</td><td>Neurological Diseases</td></tr></thead><tbody><tr><td>Normal</td><td>4/4/7</td><td>5/5/7</td><td>5/6/8</td></tr><tr><td>Initiation</td><td>5/6/6</td><td>6/5/7</td><td>6/7/11</td></tr><tr><td>Termination</td><td>5/6/10</td><td>6/7/9</td><td>6/8/10</td></tr><tr><td>U-turn</td><td>8/8/12</td><td>9/15/13</td><td>7/8/10</td></tr></tbody></table>

Examples of step detections obtained by our algorithm for a healthy subject and an osteoarthritis patient are displayed in Figure 5.

<figure><img src="image_9.png" /><figcaption>**Figure 5.** *Cont.*</figcaption></figure>
<figure><img src="image_10.png" /><figcaption>**Figure 5.** Comparison between step detection and annotations for a healthy subject (**top figure**) and a patient with osteoarthritis (**bottom figure**). The annotations are displayed as gray area and the step detection results as lines.</figcaption></figure>

The algorithm is based on two parameters $\lambda$ and $\mu$ that control the speed of the algorithm and the outlier rejection. The influence of these parameters on the results are displayed in Figure 6.

<figure><img src="image_11.png" /><figcaption>**Figure 6.** Influence of $\lambda$ (**top figure**) and $\mu$ (**bottom figure**) on the precision and recall of the method. In the top figure, $\mu$ is set to its default value $\mu = 0.1$. In the bottom figure, $\lambda$ is set to its default values $\lambda = 0.6$.</figcaption></figure>
# 5. Discussion and Perspectives

The results presented in Table 2 show that the scores of the template-based method are consistent on all groups of subjects. The best performances are obtained for healthy subjects, but there is no large drop between the groups. This clearly shows that the method adapts well to different types of pathologies. One interesting observation is that the precision and recall of the method are well balanced, and the standard deviations of the scores are always lower than 4%. The results obtained with Pan-Tompkins are in the same order of magnitude but a different phenomenon seems to occur. While the scores are comparable with our method on healthy subjects, it is noticeable that the Pan-Tompkins method has difficulty dealing with neurological and orthopedics subjects. In particular, on these subjects, an over-detection occurs, thus decreasing the precision. One possible explanation is that signals associated to pathological subjects tend to have smaller amplitudes and to be noisier than those belonging to healthy subjects. Thus, if the parameters of the filtering are unadapted, the preprocessing tends to increase the level of noise and to create artifacts that are mis-detected as steps. This may be one limit of step detection methods based on signal processing: if the signals to be studied have different properties (noise, frequency content, amplitudes), it is tricky to find one unique processing adapted to all signals. This problem is overcome in template-based methods which inherently consider several models. The main idea behind the algorithm presented in this article is that there is not one typical step but rather several typical steps. This assumption is confirmed by the results obtained with state-of-the-art methods, which inherently define only one model and obtain degraded performances when confronted with pathological data.

The type of step (initiation/termination, U-turn, etc.) also impacts the detection results. As seen in Table 3, regular steps are more likely to be correctly detected. For both our method and the Pan-Tompkins approach, it appears that normal steps are easier to detect but their detection is also more robust than those of other steps (the standard deviations are at least three times smaller for normal steps). For initiation and termination steps, the performances do not drop but the results are more erratic than for normal steps. This suggests that in most cases, these steps are similar to normal steps, which allows to keep acceptable performances. However, for some patients with degraded gait, the initiation/termination steps strongly differ, and may not be detected, which causes the increase in the standard deviation. In addition, note that since the number of initiation/termination steps is small, the precision/recall is assessed on only 1 or 2 steps, so it is natural that the variations are large. The most challenging steps are the U-turn steps. For our method, the recall decreases because of the low amplitude of these steps, that are sometimes discarded in the last step of the algorithm because they are mistaken as outliers. For Pan Tomkins, an over detection appears during the U turn, due to the presence of several peaks in the signal that are mistaken as heel-strikes. Although both methods struggle with these steps, the Pan Tomkins strategy is here irrelevant, with a precision decreasing as low as 50%.

Interestingly, it appears from Tables 2 and 3, that the differences between our method and the Pan Tomkins approach are more visible for complicated cases (pathological subjects and irregular steps). For these steps, standard signal processing procedures perform less accurately than for standard gait condition. In fact, it is difficult to tune the various parameters (filters, thresholds) so as to have them perform accurately in all situations. We believe this could also be the reason why the detection of these steps is less covered in the literature.

The repartition of the time estimation errors on all 39,694 correctly detected steps is presented in Figure 4. One interesting result is that our method does not introduce a bias: the average of the differences for all times (start, end, duration) is approximately equal to zero, and the distributions are approximately symmetric (skewness for ΔStart : 1.7, ΔEnd : -1.0, ΔDuration : -0.9). This tends to prove that the library is able to accurately detect the step boundaries and to adapt to various step durations. For 90% of the correctly detected steps, the errors for start and end times are lower than 0.15 s (in absolute value) and 0.21 s (in absolute value) for duration. These results are satisfactory when compared to the annotations uncertainties of experts and specialists, which are
around 20 samples (0.2 s—see Section 2.2). Outliers are in fact due to two specificities of the database: tiny steps (under 50 samples) mainly located during U-turn (causing underestimation for start times and overestimation of end and duration times), and highly pathological steps for stroke subjects whose duration exceeds one second (causing upper outliers for start times and lower outliers on end and duration times). The method tested here is using templates of durations between 65 and 96 samples (see Section 3.1) and the detection is inevitably constrained by these step durations. While this phenomenon does not penalize the results on most steps, it is one limit of the algorithm. Should these outliers become more frequent, one possible solution is to increase the number of templates and to add typical steps corresponding to these outliers within the library.

The median absolute errors displayed in Table 4 confirm these assumptions. For standard conditions (healthy subjects and normal steps), the error is around four samples (0.04 s) for start/end times and seven samples (0.07 s) for durations. These values are coherent with state-of-the-art results that, depending on the publication, report gait events detection errors from 0.02 s to 0.06 s [11,19,24,25,41]. For normal steps and pathological subjects, the errors are still limited and compare with state-of-the-art which go from 0.06 s to 0.1 s [42,43]. For complex cases (especially U-turn steps), the error increases up to more than 10 samples (0.1 s) since the frontiers of the steps are more difficult to estimate and the amplitude of the steps is lower. As no algorithm in the literature currently deals with all these types of steps and such heterogeneous populations, we believe that the results on U-turn, although less precise than for normal steps, are still promising.

Figure 5 shows examples of step detection for a healthy and a pathological subject. For the healthy subject, the detection is very similar to the annotations with only a few samples of difference (for example on the first step). For the pathological subject who suffers from osteoarthritis, the shapes of the initiation and U-turn steps differ from the standard shape of the steps. For these reasons, the algorithm still detects the first step but is less precise for the start/end times. The U-turn step is not detected by the algorithm as its shape is unusual and its amplitude is too low. In fact, it is likely that the patient (who suffered from severe gait troubles and obesity), dragged his foot during the U-turn, and did not perform a proper step. In particular, his foot did not leave the ground, thus making it very difficult to detect this phenomenon with accelerometers. Thankfully these cases remained rare in the database, and U-turn steps still had an 83% average recall. Nevertheless, future works will investigate these situations by conceiving dedicated templates.

The algorithm uses two parameters $\lambda$ and $\mu$ and one library of templates. Parameter $\lambda$ is a threshold that allows to speed up the algorithm by discarding step matches that are unlikely to appear in the signal. Parameter $\mu$ is used in the postprocessing step in order to remove steps with low amplitude that may be due to noise and may cause false detection. The influence of both these parameters are displayed in Figure 6. It appears that these parameters mostly control the tradeoff between precision and recall. When $\lambda$ is too large, the algorithm goes faster but discards true steps. When $\mu$ is too large, all low amplitude steps are discarded but true steps may be as well. However, all precision/recall values obtained with $\lambda \in [0.5, 0.8]$ and $\lambda \in [0.05, 0.15]$ are almost the same, which shows that a fine tuning is not necessary to make the algorithm work.

Intuitively, the composition of the library is a fundamental feature of the algorithm. The choice of the templates to be used is an interesting question that can be answered in many different ways. In a medical context, templates can, for example, be introduced according to the characteristics and pathologies of the subjects to be studied: a neurologist may benefit from a library of templates composed of a selection of different neurological pathologies. They can also be specified by experts such as biomechanists who can extract typical steps covering the whole range of types of locomotion (this is the approach we used in this article). Unsupervised machine learning techniques (such as dictionary learning) can also be used to automatically extract typical steps that are found on several exercises. It is also relevant to test semi-supervised techniques that could automatically choose the best library according to the input signal. All these leads are to be studied soon in collaboration with medical doctors and experts, and on more pathologies.
The aim of this study was to conceive an algorithm that only required data from small wireless sensors, and was able to perform robustly in the field, for various types of steps and heterogeneous populations. These constraints have led to the use of an adaptive methodology, that, instead of increasing the precision for standard conditions, sought to handle types of steps and cases that have rarely been addressed in the literature. The algorithm is usable in real clinical conditions and can provide results in all situations (degraded gait, U-turn, etc.). The method can also be used in offline software solutions, thanks to the low computational cost of the algorithm. Indeed, the processing of the whole database (more than 8.5 h of signals) takes less than 30 s.

**6. Conclusions**

We described in this article a template-based method for step detection. This method, based on a greedy algorithm and a library of annotated step templates, achieves good and robust performances even with a small number of templates. When used on a large database composed of healthy and pathological subjects walking at different speeds, the method obtains a 98% recall and 98% precision. Moreover, the algorithm allows one to detect the start and end times of each step with an acceptable precision, even on pathological subjects.

Thanks to its robustness and low computational cost, this method could be extended to process
signals acquired in free-living conditions. Indeed, the actual protocol is composed of a no activity
period and a U-turn, and there are no obstacles for testing the algorithm on unconstrained walking.
The algorithm may also be adapted to a lighter protocol using only waist accelerometer signals and
based on the same principle.

Another topic of interest is the choice of template to be used in the library. Several selection
processes could be implemented in order to automatically adapt to any type of pathology and to
optimize the performance of the algorithm.

**Author Contributions:** All authors have contributed equally to this work, in conceiving and designing the experiments, analysing the data and writing the paper.

**Funding:** This work was supported by SATT-IDF INNOV.

**Acknowledgments:** The authors would like to thank Juan Mantilla, Alain Yelnik, Catherine De Waele, Danping Wang, Flavien Quijoux, Albane Moreau, Emna Jelili, Clément Provost, Thomas Grégory, Stéphane Buffat and Christophe Labourdette for the useful discussions, their help in the data acquisition and clinical annotation.

**Conflicts of Interest:** The authors declare no conflict of interest.

**References**

1. Auvinet, B.; Berrut, G.; Touzard, C.; Moutel, L.; Collet, N.; Chaleil, D.; Barrey, E. Reference data for normal subjects obtained with an accelerometric device. *Gait Posture* **2002**, *16*, 124–134. [CrossRef]

2. Mariani, B. Assessment of Foot Signature Using Wearable Sensors for Clinical Gait Analysis and Real-Time Activity Recognition. Ph.D. Thesis, EPFL, Lausanne, Switzerland, 2012.

3. Dadashi, F.; Mariani, B.; Rochat, S.; Büla, C.J.; Santos-Eggimann, B.; Aminian, K. Gait and Foot Clearance Parameters Obtained Using Shoe-Worn Inertial Sensors in a Large-Population Sample of Older Adults. *Sensors* **2013**, *14*, 443–457. [CrossRef] [PubMed]

4. Zijlstra, W. Assessment of spatio-temporal parameters during unconstrained walking. *Eur. J. Appl. Physiol.* **2004**, *92*, 39–44. [CrossRef] [PubMed]

5. Lopez-Meyer, P.; Fulk, G.D.; Sazonov, E.S. Automatic detection of temporal gait parameters in poststroke individuals. *IEEE Trans. Inf. Technol. Biomed.* **2011**, *15*, 594–601. [CrossRef] [PubMed]

6. Shin, S.H.; Park, C.G. Adaptive step length estimation algorithm using optimal parameters and movement status awareness. *Med. Eng. Phys.* **2011**, *33*, 1064–1071. [CrossRef] [PubMed]

7. Trojaniello, D.; Cereatti, A.; Pelosi, E.; Avanzino, L.; Mirelman, A.; Hausdorff, J.M.; Della Croce, U. Estimation of step-by-step spatio-temporal parameters of normal and impaired gait using shank-mounted magneto-inertial sensors: Application to elderly, hemiparetic, parkinsonian and choreic gait. *J. Neuroeng. Rehabil.* **2014**, *11*, 152. [CrossRef] [PubMed]
8. Sejdic, E.; Lowry, K.A.; Bellanca, J.; Redfern, M.S.; Brach, J.S. A comprehensive assessment of gait accelerometry signals in time, frequency and time-frequency domains. *IEEE Trans. Neural Syst. Rehabil. Eng.* **2014**, *22*, 603–612. [CrossRef] [PubMed]

9. Chang, M.D.; Sejdić, E.; Wright, V.; Chau, T. Measures of dynamic stability: Detecting differences between walking overground and on a compliant surface. *Hum. Mov. Sci.* **2010**, *29*, 977–986. [CrossRef] [PubMed]

10. Jiang, X.; Chu, K.H.; Khoshnam, M.; Menon, C. A Wearable Gait Phase Detection System Based on Force Myography Techniques. *Sensors* **2018**, *18*, 1279. [CrossRef] [PubMed]

11. Marschollek, M.; Goevercin, M.; Wolf, K.H.; Song, B.; Gietzelt, M.; Haux, R.; Steinhagen-Thiessen, E. A performance comparison of accelerometry-based step detection algorithms on a large, non-laboratory sample of healthy and mobility-impaired persons. In Proceedings of the Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Vancouver, BC, Canada, 20–24 August 2008; pp. 1319–1322.

12. Willemsen, A.; Bloemhof, F.; Boom, H. Automatic stance-swing phase detection from accelerometer data for peroneal nerve stimulation. *IEEE Trans. Biomed. Eng.* **1990**, *37*, 1201–1208. [CrossRef] [PubMed]

13. Dijkstra, B.; Zijlstra, W.; Scherder, E.; Kamsma, Y. Detection of walking periods and number of steps in older adults and patients with Parkinson's disease: Accuracy of a pedometer and an accelerometry-based method. *Age Ageing* **2008**, *37*, 436–441. [CrossRef] [PubMed]

14. Han, J.; Jeon, H.S.; Jeon, B.S.; Park, K.S. Gait detection from three dimensional acceleration signals of ankles for the patients with Parkinson's disease. In Proceedings of the International Special Topic Conference on Information Technology in Biomedicine, Ioannina, Greece, 26–28 October 2006.

15. Lee, H.K.; You, J.; Cho, S.P.; Hwang, S.J.; Lee, D.R.; Kim, Y.H.; Lee, K.J. Computational methods to detect step events for normal and pathological gait evaluation using accelerometer. *Electron. Lett.* **2010**, *46*, 1185–1187. [CrossRef]

16. Rueterbories, J.; Spaich, E.G.; Andersen, O.K. Gait event detection for use in FES rehabilitation by radial and tangential foot accelerations. *Med. Eng. Phys.* **2014**, *36*, 502–508. [CrossRef] [PubMed]

17. Seel, T.; Werner, C.; Schauer, T. The adaptive drop foot stimulator—Multivariable learning control of foot pitch and roll motion in paretic gait. *Med. Eng. Phys.* **2016**, *38*, 1205–1213. [CrossRef] [PubMed]

18. Soaz, C.; Diepold, K. Step Detection and Parameterization for Gait Assessment Using a Single Waist-Worn Accelerometer. *IEEE Trans. Biomed. Eng.* **2016**, *63*, 933–942. [CrossRef] [PubMed]

19. Micó-Amigo, M.E.; Kingma, I.; Ainsworth, E.; Walgaard, S.; Niessen, M.; van Lummel, C.R.; van Dieën, H.J. A novel accelerometry-based algorithm for the detection of step durations over short episodes of gait in healthy elderly. *J. NeuroEng. Rehabil.* **2016**, *13*, 38. [CrossRef] [PubMed]

20. Rampp, A.; Barth, J.; Schülein, S.; Gaßmann, K.G.; Klucken, J.; Eskofier, B.M. Inertial Sensor-Based Stride Parameter Calculation From Gait Sequences in Geriatric Patients. *IEEE Trans. Biomed. Eng.* **2015**, *62*, 1089–1097. [CrossRef] [PubMed]

21. Ying, H.; Silex, C.; Schnitzer, A.; Leonhardt, S.; Schiek, M. Automatic step detection in the accelerometer signal. In Proceedings of the International Workshop on Wearable and Implantable Body Sensor Networks (BSN), Aachen, Germany, 26–28 March 2007; pp. 80–85.

22. Köse, A.; Cereatti, A.; Della Croce, U. Bilateral step length estimation using a single inertial measurement unit attached to the pelvis. *J. NeuroEng. Rehabil.* **2012**, *9*, 9. [CrossRef] [PubMed]

23. Gouwanda, D.; Gopalai, A.A. A robust real-time gait event detection using wireless gyroscope and its application on normal and altered gaits. *Med. Eng. Phys.* **2015**, *37*, 219–225. [CrossRef] [PubMed]

24. Greene, B.R.; Foran, T.G.; McGrath, D.; Doheny, E.P.; Burns, A.; Caulfield, B. A comparison of algorithms for body-worn sensor-based spatiotemporal gait parameters to the GAITRite electronic walkway. *J. Appl. Biomech.* **2012**, *28*, 349–355. [CrossRef] [PubMed]

25. McCamley, J.; Donati, M.; Grimpampi, E.; Mazzà, C. An enhanced estimate of initial contact and final contact instants of time using lower trunk inertial sensor data. *Gait Posture* **2012**, *36*, 316–318. [CrossRef] [PubMed]

26. González, R.C.; López, A.M.; Rodriguez-Uría, J.; Álvarez, D.; Alvarez, J.C. Real-time gait event detection for normal subjects from lower trunk accelerations. *Gait Posture* **2010**, *31*, 322–325. [CrossRef] [PubMed]

27. Trojaniello, D.; Cereatti, A.; Della Croce, U. Accuracy, sensitivity and robustness of five different methods for the estimation of gait temporal parameters using a single inertial sensor mounted on the lower trunk. *Gait Posture* **2014**, *40*, 487–492. [CrossRef] [PubMed]
28. Zijlstra, W.; Hof, A.L. Assessment of spatio-temporal gait parameters from trunk accelerations during human walking. *Gait Posture* **2003**, *18*, 1-10. [CrossRef]

29. Libby, R. A Simple Method for Reliable Footstep Detection in Embedded Sensor Platforms. Available online: http://ozeo.org/lib/exe/fetch.php?media=bodytrack:libby_peak_detection.pdf (accessed on 19 November 2018).

30. Thüer, G.; Verwimp, T. Step Detection Algorithms for Accelerometers. Master's Thesis, Artesis University College of Antwerp, Antwerpen, Belgium, 2008.

31. Mladenov, M.; Mock, M. A step counter service for Java-enabled devices using a built-in accelerometer. In Proceedings of the International Workshop on Context-Aware Middleware and Services (COMSWARE 2009), Dublin, Ireland, 15-19 June 2009; pp. 1-5.

32. Fortune, E.; Lugade, V.; Morrow, M.; Kaufman, K. Step counts using a tri-axial accelerometer during activity. In Proceedings of the American Society of Biomechanics Annual Meeting (ASB), Gainsville, FL, USA, 15-18 August 2012.

33. Djurić-Jovicić, M.D.; Jovicić, N.S.; Radovanović, S.M.; Kresojević, N.D.; Kostić, V.S.; Popović, M.B. Quantitative and qualitative gait assessments in Parkinson's disease patients. *Vojnosanit. Pregl. 2014*, **71**, 809-816. [CrossRef] [PubMed]

34. Dibble, L.E.; Nicholson, D.E.; Shultz, B.; MacWilliams, B.A.; Marcus, R.L.; Moncur, C. Sensory cueing effects on maximal speed gait initiation in persons with Parkinson's disease and healthy elders. *Gait Posture* **2004**, *19*, 215-225. [CrossRef]

35. Glaister, B.C.; Bernatz, G.C.; Klute, G.K.; Orendurff, M.S. Video task analysis of turning during activities of daily living. *Gait Posture* **2007**, *25*, 289-294. [CrossRef] [PubMed]

36. Pan, J.; Tompkins, W.J. A real-time QRS detection algorithm. *IEEE Trans. Biomed. Eng.* **1985**, *32*, 230-236. [CrossRef] [PubMed]

37. Mantilla, J.; Oudre, L.; Barrois, R.; Vienne, A.; Ricard, D. Template-DTW based on inertial signals: Preliminary results for step characterization. In Proceedings of the Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Jeju Island, Korea, 1-15 July 2017.

38. Vienne, A.; Barrois, R.; Vidal, P.P.; Buffat, S.; Ricard, D. Inertial sensors to assess gait quality in patients with neurological disorders: A systematic review. *Front. Psychol.* **2017**, *8*, 817. [CrossRef] [PubMed]

39. Salarian, A.; Russmann, H.; Vingerhoets, F.; Dehollain, C.; Blanc, Y.; Burkhard, P.; Aminian, K. Gait assessment in Parkinson's disease: Toward an ambulatory system for long-term monitoring. *IEEE Trans. Biomed. Eng.* **2004**, *51*, 1434-1443. [CrossRef] [PubMed]

40. Ben Mansour, K.; Rezzoug, N.; Gorce, P. Comparison between several locations of gyroscope for gait events detection. *Comput. Methods Biomech. Biomed. Eng.* **2015**, *1-2*. [CrossRef] [PubMed]

41. Mannini, A.; Sabatini, A.M. Gait phase detection and discrimination between walking—Jogging activities using hidden Markov models applied to foot motion data from a gyroscope. *Gait Posture* **2012**, *36*, 657-661. [CrossRef] [PubMed]

42. Jasiewicz, J.M.; Allum, J.H.; Middleton, J.W.; Barriskill, A.; Condie, P.; Purcell, B.; Li, R.C.T. Gait event detection using linear accelerometers or angular velocity transducers in able-bodied and spinal-cord injured individuals. *Gait Posture* **2006**, *24*, 502-509. [CrossRef] [PubMed]

43. Barth, J.; Oberndorfer, C.; Pasluosta, C.; Schülein, S.; Gassner, H.; Reinfelder, S.; Kugler, P.; Schuldhaus, D.; Winkler, J.; Klucken, J.; et al. Stride segmentation during free walk movements using multi-dimensional subsequence dynamic time warping on inertial sensor data. *Sensors* **2015**, *15*, 6419-6440. [CrossRef] [PubMed]

<figure><img src="image_12.png" /></figure>

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).