biopsykit.signals.imu.feature_extraction.static_moments module¶
Extract features from static moments of IMU data.
- biopsykit.signals.imu.feature_extraction.static_moments.compute_features(data, static_moments, start=None, end=None, index=None, timezone=None)[source]¶
Compute features based on frequency and duration of static moments in given input signal.
This function computes the following features:
sm_number
: number of static moments in datasm_max
: maximum duration of static moments, i.e., longest durationsm_max_position
: location of the beginning of the longest static moment in the input data normalized to[0, 1]
where 0 =start
and 1 =end
sm_median
: median duration of static momentssm_mean
: mean duration of static momentssm_std
: standard deviation of static moment durationssm_skewness
: skewness of static moment durations
The features are both computed on all detected static moments and on static moments that are longer than 60 seconds (suffix
_60
).- Parameters
data (
DataFrame
) – input datastatic_moments (
DataFrame
) – dataframe with beginning and end of static momentsstart (
Timestamp
or str, optional) – start timestamp in input data for feature extraction orNone
to set start index to the first index indata
. All samples beforestart
will not be used for feature extraction.end (
Timestamp
or str, optional) – end timestamp in input data for feature extraction orNone
to set end index to the last index indata
. All samples afterend
will not be used for feature extraction.index (int or str, optional) – index label of the resulting dataframe or
None
to assign a default label (0)timezone (str, optional) – timezone of the recorded data or
None
to use default timezone (“Europe/Berlin”)
- Returns
dataframe with extracted static moment features
- Return type
- biopsykit.signals.imu.feature_extraction.static_moments.static_moment_duration(data, start_end)[source]¶
Compute duration of static moment.