Temporal Filters

class doc_octopy.datasets.filters.temporal.ARFilter(n_coefficients=4, input_is_chunked=True, representations_to_filter=(0,))[source]

Bases: FilterBaseClass

Filter that computes n autoregressive coefficients for each window of the input array.

Parameters:
  • n_coefficients (int)

  • input_is_chunked (bool)

  • representations_to_filter (Union[Literal['all'], Sequence[int]])

class doc_octopy.datasets.filters.temporal.GaileyFeature2(window_size, shift=1, input_is_chunked=True, is_output=False, name=None)[source]

Bases: FilterBaseClass

Computes the second EMG feature from the Gailey et al. paper with given window length and window shift over the input signal. See formula in the following paper: https://doi.org/10.3389/fneur.2017.00007.

Parameters:
class doc_octopy.datasets.filters.temporal.GaileyFeature3(window_size, shift=1, input_is_chunked=True, is_output=False, name=None)[source]

Bases: FilterBaseClass

Computes the third EMG feature from the Gailey et al. paper with given window length and window shift over the input signal. See formula in the following paper: https://doi.org/10.3389/fneur.2017.00007.

Parameters:
class doc_octopy.datasets.filters.temporal.HISTFilter(window_size, shift=1, bins=10, input_is_chunked=True, is_output=False, name=None)[source]

Bases: FilterBaseClass

Computes the Histogram with given window length and window shift over the input signal.

Parameters:
class doc_octopy.datasets.filters.temporal.IAVFilter(window_size, shift=1, input_is_chunked=True, is_output=False, name=None)[source]

Bases: FilterBaseClass

Computes the Integrated Absolute Value with given window length and window shift over the input signal. See formula in the following paper: https://doi.org/10.1080/10255842.2023.2165068.

Parameters:
class doc_octopy.datasets.filters.temporal.MAVFilter(window_size, shift=1, input_is_chunked=True, is_output=False, name=None)[source]

Bases: FilterBaseClass

Computes the Mean Absolute Value with given window length and window shift over the input signal. See formula in the following paper: https://doi.org/10.1080/10255842.2023.2165068.

Parameters:
class doc_octopy.datasets.filters.temporal.RMSFilter(window_size, shift=1, input_is_chunked=None, is_output=False, name=None)[source]

Bases: FilterBaseClass

Filter that computes the root mean squared value [1] of the input array.

Parameters:
  • window_size (int) – The window size to use.

  • shift (int) – The shift to use.

  • input_is_chunked (bool) – Whether the input is chunked or not.

  • is_output (bool)

  • name (str)

__call__(input_array: np.ndarray) np.ndarray

Filters the input array. Input shape is determined by whether the allowed_input_type is “both”, “chunked” or “not chunked”.

References

class doc_octopy.datasets.filters.temporal.RectifyFilter(input_is_chunked=None, is_output=False)[source]

Bases: ApplyFunctionFilter

Filter that rectifies the input array.

Parameters:
  • input_is_chunked (bool) – Whether the input is chunked or not.

  • is_output (bool) – Whether the filter is an output filter. If True, the resulting signal will be outputted by and dataset pipeline.

class doc_octopy.datasets.filters.temporal.SOSFrequencyFilter(sos_filter_coefficients, forwards_and_backwards=True, input_is_chunked=None, is_output=False, name=None)[source]

Bases: FilterBaseClass

Filter that applies a second-order-section filter to the input array.

Parameters:
  • sos_filter_coefficients (tuple[np.ndarray, np.ndarray | float, np.ndarray]) – The second-order-section filter coefficients. This is a tuple of the form (sos, gain, delay).

  • forwards_and_backwards (bool) – Whether to apply the filter forwards and backwards or only forwards.

  • input_is_chunked (bool) – Whether the input is chunked or not.

  • is_output (bool) – Whether the filter is an output filter. If True, the resulting signal will be outputted by and dataset pipeline.

  • name (str)

__call__(input_array: np.ndarray) np.ndarray

Filters the input array. Input shape is determined by whether the allowed_input_type is “both”, “chunked” or “not chunked”.

class doc_octopy.datasets.filters.temporal.SSCFilter(window_size, shift=1, input_is_chunked=True, is_output=False, name=None)[source]

Bases: FilterBaseClass

Computes the Slope Sign Change with given window length and window shift over the input signal. See formula in the following paper: https://doi.org/10.1080/10255842.2023.2165068.

Parameters:
class doc_octopy.datasets.filters.temporal.SpectralInterpolationFilter(bandwidth=(47.5, 50.75), number_of_harmonics=5, emg_frequency=2044, input_is_chunked=True, representations_to_filter='all')[source]

Bases: FilterBaseClass

Parameters:
  • bandwidth (Tuple[float, float])

  • number_of_harmonics (int)

  • emg_frequency (float)

  • input_is_chunked (bool)

  • representations_to_filter (Union[Literal['all'], Sequence[int]])

class doc_octopy.datasets.filters.temporal.VARFilter(window_size, shift=1, input_is_chunked=True, is_output=False, name=None)[source]

Bases: FilterBaseClass

Computes the Variance with given window length and window shift over the input signal.

Parameters:
class doc_octopy.datasets.filters.temporal.WFLFilter(window_size, shift=1, input_is_chunked=True, is_output=False, name=None)[source]

Bases: FilterBaseClass

Computes the Waveform Length with given window length and window shift over the input signal. See formula in the following paper: https://doi.org/10.1080/10255842.2023.2165068.

Parameters:
class doc_octopy.datasets.filters.temporal.ZCFilter(window_size, shift=1, input_is_chunked=True, is_output=False, name=None)[source]

Bases: FilterBaseClass

Computes the Zero Crossings with given window length and window shift over the input signal. See formula in the following paper: https://doi.org/10.1080/10255842.2023.2165068.

Parameters: