IcdIonescu#

class mobgap.initial_contacts.IcdIonescu(
*,
pre_filter: BaseFilter = cf(EpflDedriftedGaitFilter(zero_phase=True)),
cwt_width: float = 9.0,
)[source]#

Implementation of the IC detection algorithm by McCamley (2012) [1] modified by Ionescu (2020) [2].

The algorithm includes the following steps starting from vertical acceleration of the lower-back during a gait sequence:

  1. Resampling: 100 Hz –> 40 Hz

  2. Band-pass filtering –> lower cut-off: 0.15 Hz; higher cut-off: 3.14 Hz

  3. Cumulative integral –> cumulative trapezoidal integration

  4. Continuous Wavelet Transform (CWT) –> Ricker wavelet

  5. Zero crossings detection

  6. Detect peaks between zero crossings –> negative peaks = ICs

This is based on the implementation published as part of the mobilised project [3]. However, this implementation deviates from the original implementation in some places. For details, see the notes section and the examples.

Parameters:
pre_filter

A pre-processing filter to apply to the data before the ICD algorithm is applied.

cwt_width

The width of the wavelet

Other Parameters:
data

The raw IMU data of the gait sequence in the body frame passed to the detect method.

sampling_rate_hz

The sampling rate of the IMU data in Hz passed to the detect method.

Attributes:
ic_list_

A pandas dataframe with the indices of the detected initial contacts in the input data. It only has one column, ic, which contains the indices of the detected initial contacts.

Notes

Points of deviation from the original implementation and their reasons:

  • We use a different downsampling method, which should be “more” correct from a signal theory perspective, but will yield slightly different results.

  • We use a slightly different approach when it comes to the detection of the peaks between the zero crossings. However, the results of this step are identical to the matlab implementation.

[1]

J. McCamley, M. Donati, E. Grimpampi, C. Mazzà, “An enhanced estimate of initial contact and final contact instants of time using lower trunk inertial sensor data”, Gait & Posture, vol. 36, no. 2, pp. 316-318, 2012.

[2]

A. Paraschiv-Ionescu, A. Soltani and K. Aminian, “Real-world speed estimation using single trunk IMU: methodological challenges for impaired gait patterns,” 2020 42nd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), Montreal, QC, Canada, 2020, pp. 4596-4599, doi: 10.1109/EMBC44109.2020.9176281.

Methods

clone()

Create a new instance of the class with all parameters copied over.

detect(data, *, sampling_rate_hz, **_)

Detect Initial contacts in the passed data.

get_params([deep])

Get parameters for this algorithm.

set_params(**params)

Set the parameters of this Algorithm.

__init__(
*,
pre_filter: BaseFilter = cf(EpflDedriftedGaitFilter(zero_phase=True)),
cwt_width: float = 9.0,
) None[source]#
clone() Self[source]#

Create a new instance of the class with all parameters copied over.

This will create a new instance of the class itself and all nested objects

detect(
data: DataFrame,
*,
sampling_rate_hz: float,
**_: Unpack[dict[str, Any]],
) Self[source]#

Detect Initial contacts in the passed data.

We expect the data to be a single gait sequence. If the data does not contain any gait sequences, the algorithm might behave unexpectedly.

Parameters:
data

The raw IMU in the body frame.

sampling_rate_hz

The sampling rate of the IMU data in Hz.

Returns:
self

The instance of the class with the icd_list_ attribute set to the detected initial contacts.

get_params(deep: bool = True) dict[str, Any][source]#

Get parameters for this algorithm.

Parameters:
deep

Only relevant if object contains nested algorithm objects. If this is the case and deep is True, the params of these nested objects are included in the output using a prefix like nested_object_name__ (Note the two “_” at the end)

Returns:
params

Parameter names mapped to their values.

set_params(**params: Any) Self[source]#

Set the parameters of this Algorithm.

To set parameters of nested objects use nested_object_name__para_name=.

Examples using mobgap.initial_contacts.IcdIonescu#

ICD Ionescu

ICD Ionescu

ICD Evaluation

ICD Evaluation