dispel.providers.generic.preprocessing module#
Core functionalities to preprocess signal data.
- class dispel.providers.generic.preprocessing.AmplitudeRangeFilter[source]#
Bases:
LevelFilter
Filter aberrant signal amplitude.
- Parameters:
data_set_id – The data set id on which the transformation is to be performed (‘accelerometer’, ‘gyroscope’).
max_amplitude – A float which is the maximum expected amplitude values.
min_amplitude – A float which is the minimum expected amplitude values.
columns – The columns onto which the detrending steps have to be applied.
- class dispel.providers.generic.preprocessing.Detrend[source]#
Bases:
Apply
A detrending preprocessing step according a given data set.
- Parameters:
data_set_id – The data set id on which the transformation is to be performed (‘accelerometer’, ‘gyroscope’).
columns – The columns onto which the detrending steps have to be applied.
kwargs – Additional arguments that are passed to the
process()
function of each step. This allows to provide additional values, such as placeholder values in value definitions to the actual processing function.
- class dispel.providers.generic.preprocessing.FilterPhysiologicalNoise[source]#
Bases:
Apply
Apply a filter that will remove any physiological noise into a dataset.
This filter is a butterworth high-pass one.
- Parameters:
data_set_id – The data set id on which the transformation is to be performed (‘accelerometer’, ‘gyroscope’).
columns – The columns onto which the filtering step has to be applied.
sampling_frequency – Optional the initial sampling frequency.
kwargs – Additional arguments that are passed to the
process()
function of each step. This allows to provide additional values, such as placeholder values in value definitions to the actual processing function.
Notes
The Butterwoth highpass filter is tuned as in [Martinez et. al. 2012]_ to remove physiological noise. The cut-off of is of 0.2HZ which is the standard breath frequency.
- class dispel.providers.generic.preprocessing.FilterSensorNoise[source]#
Bases:
Apply
Apply a filter that will remove any sensor noise into a given dataset.
This filter is a Savitzky-Golay one.
- Parameters:
data_set_id – The data set id on which the transformation is to be performed (‘accelerometer’, ‘gyroscope’).
columns – The columns onto which the filtering step has to be applied.
kwargs – Additional arguments that are passed to the
process()
function of each step. This allows to provide additional values, such as placeholder values in value definitions to the actual processing function.
Notes
The Savitzky-Golay is tuned as in [Martinez et. al. 2012]_ to remove sensor noise and to smooth the signal. The windows size is thus set up to 41 points and the filter is of order-3.
- class dispel.providers.generic.preprocessing.PreprocessingSteps[source]#
Bases:
ProcessingStepGroup
A changing referential preprocessing step according a given data set.
- Parameters:
data_set_id – The data set id on which the transformation is to be performed.
limb – The modality regarding if the exercise is upper or lower limb.
sensor – The modality regarding the type of sensor either accelerometer or gyroscope.
resample_freq – Optionally, the frequency to which resample the data during the resample step.
columns – Optionally, the columns on which the preprocessing steps need to be applied.
level_filter (dispel.processing.level.LevelFilter) – An optional
LevelFilter
to determine the levels to be transformed. If no filter is provided, all levels will be transformed. Thelevel_filter
also acceptsstr
,LevelId
s and lists of either and passes them to aLevelIdFilter
for convenience.
- __init__(data_set_id, limb, sensor, resample_freq=None, columns=None, level_filter=<DefaultLevelFilter: *>)[source]#
- Parameters:
data_set_id (str) –
limb (LimbModality) –
sensor (SensorModality) –
resample_freq (float | None) –
level_filter (str | LevelId | List[str] | List[LevelId] | LevelFilter) –
- class dispel.providers.generic.preprocessing.RotateFrame[source]#
Bases:
ProcessingStepGroup
A changing referential preprocessing step according a given data set.
- Parameters:
data_set_id – The data set id on which the transformation is to be performed.
gravity_data_set_id – The dataset id containing the gravity components.
frame – The new desired frame.
columns – The columns onto which the resampling steps have to be applied.
kwargs (Dict[str, Any]) – Additional arguments that are passed to the
process()
function of each step. This allows to provide additional values, such as placeholder values in value definitions to the actual processing function.