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 data

  • sm_max: maximum duration of static moments, i.e., longest duration

  • sm_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 moments

  • sm_mean: mean duration of static moments

  • sm_std: standard deviation of static moment durations

  • sm_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 data

  • static_moments (DataFrame) – dataframe with beginning and end of static moments

  • start (Timestamp or str, optional) – start timestamp in input data for feature extraction or None to set start index to the first index in data. All samples before start will not be used for feature extraction.

  • end (Timestamp or str, optional) – end timestamp in input data for feature extraction or None to set end index to the last index in data. All samples after end 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

DataFrame

biopsykit.signals.imu.feature_extraction.static_moments.static_moment_duration(data, start_end)[source]

Compute duration of static moment.

Parameters
  • data (DataFrame) – input data

  • start_end (array) – start and end index of static moment to compute duration

Returns

duration in seconds

Return type

float

biopsykit.signals.imu.feature_extraction.static_moments.mean_orientation(data, static_moments)[source]

Compute mean orientation of acceleration signal within static moment windows.

Parameters
  • data (DataFrame) – input data

  • static_moments (DataFrame) – dataframe with start and end indices of static moments

Returns

mean orientation (x, y, z) of acceleration signal for each static moment window

Return type

DataFrame