dispel.signal.sensor module#

Sensor functionality for signal processing tasks.

dispel.signal.sensor.SENSOR_UNIT = {'acc': 'G', 'diss': 'pixel', 'gyr': 'rad/s'}#

A dictionary for sensor units.

dispel.signal.sensor.check_amplitude(data, min_amplitude, max_amplitude)[source]#

Check if the signal amplitudes belong to a reasonable range.

The function will return true only if all the values of each column are between the min and max amplitude bounds.

Parameters:
  • data (DataFrame) – A data frame containing one column or more. The data contains in columns must all have the same nature as the bounds are applied on the entire data frame.

  • min_amplitude (float) – The expected min amplitude.

  • max_amplitude (float) – The expected max amplitude.

Returns:

True if all the values are in the range. False otherwise.

Return type:

bool

dispel.signal.sensor.detrend_signal(signal)[source]#

Detrend signal and remove offset component.

The final signal will end up centered on zero and stationary. This function is based on scipy.stats.linregress().

Parameters:

signal (pandas.Series) – The raw signal.

Returns:

The detrended signal.

Return type:

pandas.Series

dispel.signal.sensor.find_zero_crossings(data, col)[source]#

Find zero crossing in the signal.

Parameters:
Return type:

DataFrame