IcdIonescu#
- class mobgap.initial_contacts.IcdIonescu(
- *,
- pre_filter: BaseFilter = cf(EpflDedriftedGaitFilter(zero_phase=True)),
- cwt_width: float = 9.0,
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:
Resampling: 100 Hz –> 40 Hz
Band-pass filtering –> lower cut-off: 0.15 Hz; higher cut-off: 3.14 Hz
Cumulative integral –> cumulative trapezoidal integration
Continuous Wavelet Transform (CWT) –> Ricker wavelet
Zero crossings detection
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
detectmethod.- sampling_rate_hz
The sampling rate of the IMU data in Hz passed to the
detectmethod.
- 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,
- 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( ) 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.