ltbio.processing.filters.FrequencyDomainFilter#

Overview#

Classes#

BandType

str(object=’’) -> str

FrequencyDomainFilter

Describes the design of a digital frequency-domain filter and holds the ability to apply that filter to any array of samples.

FrequencyResponse

str(object=’’) -> str

Contents#

class ltbio.processing.filters.FrequencyDomainFilter.BandType#

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

BANDPASS = 'Band-pass'#
BANDSTOP = 'Band-stop'#
HIGHPASS = 'High-pass'#
LOWPASS = 'Low-pass'#
class ltbio.processing.filters.FrequencyDomainFilter.FrequencyDomainFilter(fresponse: FrequencyResponse, band_type: BandType, cutoff: float | Tuple[float, float], order: int, name: str = None, **options)#

Bases: ltbio.processing.filters.Filter.Filter

Describes the design of a digital frequency-domain filter and holds the ability to apply that filter to any array of samples. It acts as a concrete visitor in the Visitor Design Pattern.

To instantiate, give:
  • fresponse: The frequency response of the filter. Choose one from FrequencyResponse enumeration.

  • band_type: Choose whether it should low, high, or band pass or reject a band of the samples’ spectrum. Choose one from BandType enumeration.

  • order: The order of the filter (in int).

  • cutoff: The cutoff frequency at 3 dB (for lowpass and highpass) or a tuple of two cutoffs (for bandpass or bandstop) (in Hertz, float).

property last_denominator_coefficients: numpy.array#
property last_numerator_coefficients: numpy.array#
plot_bode(show: bool = True, save_to: str = None)#
class ltbio.processing.filters.FrequencyDomainFilter.FrequencyResponse#

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

BESSEL = 'IIR Bessel'#
BUTTER = 'IIR Butterworth'#
CHEBY1 = 'IIR Chebyshev 1'#
CHEBY2 = 'IIR Chebyshev 2'#
ELLIP = 'IIR Elliptic'#
FIR = 'Finite Impulse Response (FIR)'#