dispel.signal.filter module#

Signal filtering functions.

dispel.signal.filter.butterworth_band_pass_filter(data, lower_bound, upper_bound, order=2, freq=None, zero_phase=True)[source]#

Filter a series with a butterworth band-pass filter.

Parameters:
  • data (Series) – The time series to be filtered

  • lower_bound (float) – The lower bound of frequencies to filter

  • upper_bound (float) – The upper bound of frequencies to filter

  • freq (float | None) – The sampling frequency of the time series in Hz. If the passed data has an evenly spaced time series index it will be determined automatically.

  • order (int) – The order of the filter

  • zero_phase (bool | None) – Boolean indicating whether zero phase filter (filtfilt) to be used

Returns:

The filtered data.

Return type:

pandas.Series

dispel.signal.filter.butterworth_high_pass_filter(data, cutoff, order=2, freq=None, zero_phase=True)[source]#

Filter a series with a butterworth high-pass filter.

Parameters:
  • data (Series) – The time series to be filtered

  • cutoff (float) – The upper bound of frequencies to filter

  • freq (float | None) – The sampling frequency of the time series in Hz. If the passed data has an evenly spaced time series index it will be determined automatically.

  • order (int) – The order of the filter

  • zero_phase (bool | None) – Boolean indicating whether zero phase filter (filtfilt) to be used

Returns:

The filtered data.

Return type:

pandas.Series

dispel.signal.filter.butterworth_low_pass_filter(data, cutoff, order=2, freq=None, zero_phase=True)[source]#

Filter a series with a butterworth low-pass filter.

Parameters:
  • data (Series) – The time series to be filtered

  • cutoff (float) – The lower bound of frequencies to filter

  • order (int) – The order of the filter

  • freq (float | None) – The sampling frequency of the time series in Hz. If the passed data has an evenly spaced time series index it will be determined automatically.

  • zero_phase (bool | None) – Boolean indicating whether zero phase filter (filtfilt) to be used

Returns:

The filtered data.

Return type:

pandas.Series

dispel.signal.filter.savgol_filter(data, window=41, order=3)[source]#

Apply the Savitzky-Golay filter on a class:~pandas.Series.

Parameters:
  • data (Series) – Input data

  • window (int) – the length of the filter window

  • order (int) – The order of the polynomial used to fit the samples

Returns:

Filtered data

Return type:

pandas.Series