x (ndarray) – Input data. Use the axis argument to specify the “time axis”.
axis (int, optional) – The axis to compute the feature along. By default, it is computed along
rows, so the input is assumed to be shape (n_channels, n_samples).
keepdims (bool, optional) – Whether or not to keep the dimensionality of the input. That is, if the
input is 2D, the output will be 2D even if a dimension collapses to
size 1.
For electrophysiological signals that are mean-zero, this is the log of the
mean square value, making it similar to root_mean_square() but
scaling differently (slower) with \(x\).
For EMG data recorded from forearm muscles, log-var has been found to
relate to wrist angle fairly linearly [1]_.
Note: base-10 logarithm is used, though the base is not specified in [1]_.
Parameters:
x (ndarray) – Input data. Use the axis argument to specify the “time axis”.
axis (int, optional) – The axis to compute the feature along. By default, it is computed along
rows, so the input is assumed to be shape (n_channels, n_samples).
keepdims (bool, optional) – Whether or not to keep the dimensionality of the input. That is, if the
input is 2D, the output will be 2D even if a dimension collapses to
size 1.
Computes the mean absolute value (MAV) of each signal.
Mean absolute value is a popular feature for obtaining amplitude
information from EMG, especially in gesture classification contexts [1]_.
There is an optional windowing function applied to the rectified signal,
described as MAV1 and MAV2 in some references. A custom window can also be
used. The general definition is given as:
Normal MAV does not use a windowing function, equivalent to setting all
\(w_i = 1\).
MAV1 refers to a rectangular window which de-emphasizes the beginning and
ending of an input window. The first quarter of the input samples receive
a weight of 0.5, the middle half of the input samples receive a weight of
1, and the final quarter recieves a weight of 0.5:
MAV2 uses a similar window structure to MAV1 (i.e. broken into first
quarter, middle half, and final quarter), but the window is trapezoidal
in shape, ramping from 0 to 1 over the first quarter and from 1 to 0 over
the last quarter:
\[\begin{split}w_i =
\begin{cases}
1, & \frac{N}{4} \leq i \leq \frac{3N}{4} \\
\frac{4i}{N}, & i < \frac{N}{4} \\
\frac{4(i - N)}{N}, & i > \frac{3N}{4}
\end{cases}\end{split}\]
Parameters:
x (ndarray) – Input data. Use the axis argument to specify the “time axis”.
’mav’ : all samples in the signal are weighted equally (default).
’mav1’ : rectangular window with the middle half of the signal
receiving unit weight and the first and last quarters of the
signal receiving half weight.
’mav2’ : similar to ‘mav1’, but weights on the first and last
quarters increase and decrease between 0 and 1 respectively,
forming a trapezoidal window.
[ndarray] : user-supplied weights to apply. Must be a 1D array
with the same length as the signals received in the compute
method.
axis (int, optional) – The axis to compute the feature along. By default, it is computed along
rows, so the input is assumed to be shape (n_channels, n_samples).
keepdims (bool, optional) – Whether or not to keep the dimensionality of the input. That is, if the
input is 2D, the output will be 2D even if a dimension collapses to
size 1.
x (ndarray) – Input data. Use the axis argument to specify the “time axis”.
axis (int, optional) – The axis to compute the feature along. By default, it is computed along
rows, so the input is assumed to be shape (n_channels, n_samples).
keepdims (bool, optional) – Whether or not to keep the dimensionality of the input. That is, if the
input is 2D, the output will be 2D even if a dimension collapses to
size 1.
Computes the number of slope sign changes (SSC) of each signal.
A slope sign change occurs when the middle value of a group of three
adjacent values in the signal is either greater than or less than both of
the other two.
Parameters:
x (ndarray) – Input data. Use the axis argument to specify the “time axis”.
threshold (float, optional) – A threshold for discriminating true slope sign changes from those
caused by low-level noise fluctuating about a specific value. By
default, no threshold is used, so every slope sign change in the signal
is counted.
axis (int, optional) – The axis to compute the feature along. By default, it is computed along
rows, so the input is assumed to be shape (n_channels, n_samples).
keepdims (bool, optional) – Whether or not to keep the dimensionality of the input. That is, if the
input is 2D, the output will be 2D even if a dimension collapses to
size 1.
x (ndarray) – Input data. Use the axis argument to specify the “time axis”.
axis (int, optional) – The axis to compute the feature along. By default, it is computed along
rows, so the input is assumed to be shape (n_channels, n_samples).
keepdims (bool, optional) – Whether or not to keep the dimensionality of the input. That is, if the
input is 2D, the output will be 2D even if a dimension collapses to
size 1.
Computes the number of zero crossings (ZC) of each signal.
A zero crossing occurs when two adjacent values (in time) of the signal
have opposite sign. A threshold is used to mitigate the effect of noise
around zero. It is used as a measure of frequency information.
Parameters:
x (ndarray) – Input data. Use the axis argument to specify the “time axis”.
threshold (float, optional) – A threshold for discriminating true zero crossings from those caused
by low-level noise situated about zero. By default, no threshold is
used, so every sign change in the signal is counted.
axis (int, optional) – The axis to compute the feature along. By default, it is computed along
rows, so the input is assumed to be shape (n_channels, n_samples).
keepdims (bool, optional) – Whether or not to keep the dimensionality of the input. That is, if the
input is 2D, the output will be 2D even if a dimension collapses to
size 1.