skdh.features.DimensionlessJerk#

class skdh.features.DimensionlessJerk(log=False, signal_type='acceleration')#

The dimensionless normalized sum of jerk, or its log value. Will take velocity, acceleration, or jerk as the input signal, and compute the jerk accordingly.

Parameters:
logbool, optional

Take the log of the dimensionless jerk. Default is False.

signal_type{‘acceleration’, ‘velocity’, ‘jerk’}, optional

The type of the signal being provided. Default is ‘acceleration’

Attributes:
i_type
log

Methods

compute(signal, *[, axis])

Compute the dimensionless jerk metric

Notes

For all three inputs (acceleration, velocity, and jerk) the squaring and summation of the computed jerk values is the same as JerkMetric. The difference comes in the normalization to get a dimensionless value, and in the computation of the jerk.

For the different inputs, the pre-normalized metric \(\hat{J}\) is computed per

\[\begin{split}\hat{J}_{vel} = \sum_{i=2}^{N-1}\left(\frac{v_{i+1} - 2v_{i} + v_{i-1}}{\Delta t^2}\right)^2 \\ \hat{J}_{acc} = \sum_{i=2}^N\left(\frac{a_{i} - a_{i-1}}{\Delta t}\right)^2 \\ \hat{J}_{jerk} = \sum_{i=1}^Nj_i^2\end{split}\]

The scaling factor also changes depending on which input is provided, per

\[\begin{split}s_{vel} = \frac{max(|v|)^2}{N^3\Delta t^4} \\ s_{acc} = \frac{max(|a|)^2}{N \Delta t^2} \\ s_{jerk} = Nmax(|j|)^2\end{split}\]

Note that the sampling period ends up cancelling out for all versions of the metric. Finally, the dimensionless jerk metric is simply the negative pre-normalized value divided by the corresponding scaling factor. If the log dimensionless jerk is required, then the negative is taken after taking the natural logarithm

\[\begin{split}DJ = \frac{-\hat{J}_{type}}{s_{type}} \\ DJ_{log} = -ln\left(\frac{\hat{J}_{type}}{s_{type}}\right)\end{split}\]
compute(signal, *, axis=-1)#

Compute the dimensionless jerk metric

Parameters:
signalarray-like

Array-like containing values to compute the dimensionless jerk metric for.

axisint, optional

Axis along which the signal entropy will be computed. Ignored if signal is a pandas.DataFrame. Default is last (-1).

Returns:
dimless_jerk_metricnumpy.ndarray

Computed [log] dimensionless jerk metric.