ezmsg.sigproc.filterbankdesign#

Classes

class FilterbankDesignSettings(filters: Iterable[ezmsg.sigproc.kaiser.KaiserFilterSettings], mode: ezmsg.sigproc.filterbank.FilterbankMode = <FilterbankMode.CONV: 'Direct Convolution'>, min_phase: ezmsg.sigproc.filterbank.MinPhaseMode = <MinPhaseMode.NONE: 'No kernel modification'>, axis: str = 'time', new_axis: str = 'kernel')[source]#

Bases: Settings

Parameters:
filters: Iterable[KaiserFilterSettings]#
mode: FilterbankMode = 'Direct Convolution'#

“conv”, “fft”, or “auto”. If “auto”, the mode is determined by the size of the input data. fft mode is more efficient for long kernels. However, fft mode uses non-overlapping windows and will incur a delay equal to the window length, which is larger than the largest kernel. conv mode is less efficient but will return data for every incoming chunk regardless of how small it is and thus can provide shorter latency updates.

min_phase: MinPhaseMode = 'No kernel modification'#

If not None, convert the kernels to minimum-phase equivalents. Valid options are ‘hilbert’, ‘homomorphic’, and ‘homomorphic-full’. Complex filters not supported. See scipy.signal.minimum_phase for details.

axis: str = 'time'#

The name of the axis to operate on. This should usually be “time”.

new_axis: str = 'kernel'#

The name of the new axis corresponding to the kernel index.

__init__(filters, mode=FilterbankMode.CONV, min_phase=MinPhaseMode.NONE, axis='time', new_axis='kernel')#
Parameters:
Return type:

None

class FilterbankDesignState[source]#

Bases: object

filterbank: FilterbankTransformer | None = None#
needs_redesign: bool = False#
class FilterbankDesignTransformer(*args, **kwargs)[source]#

Bases: BaseStatefulTransformer[FilterbankDesignSettings, AxisArray, AxisArray, FilterbankDesignState]

Transformer that designs and applies a filterbank based on Kaiser windowed FIR filters.

classmethod get_message_type(dir)[source]#
Parameters:

dir (str)

Return type:

type[AxisArray]

update_settings(new_settings=None, **kwargs)[source]#

Update settings and mark that filter coefficients need to be recalculated.

Parameters:
  • new_settings (FilterbankDesignSettings | None) – Complete new settings object to replace current settings

  • **kwargs – Individual settings to update

Return type:

None

class FilterbankDesignSettings(filters: Iterable[ezmsg.sigproc.kaiser.KaiserFilterSettings], mode: ezmsg.sigproc.filterbank.FilterbankMode = <FilterbankMode.CONV: 'Direct Convolution'>, min_phase: ezmsg.sigproc.filterbank.MinPhaseMode = <MinPhaseMode.NONE: 'No kernel modification'>, axis: str = 'time', new_axis: str = 'kernel')[source]#

Bases: Settings

Parameters:
filters: Iterable[KaiserFilterSettings]#
mode: FilterbankMode = 'Direct Convolution'#

“conv”, “fft”, or “auto”. If “auto”, the mode is determined by the size of the input data. fft mode is more efficient for long kernels. However, fft mode uses non-overlapping windows and will incur a delay equal to the window length, which is larger than the largest kernel. conv mode is less efficient but will return data for every incoming chunk regardless of how small it is and thus can provide shorter latency updates.

min_phase: MinPhaseMode = 'No kernel modification'#

If not None, convert the kernels to minimum-phase equivalents. Valid options are ‘hilbert’, ‘homomorphic’, and ‘homomorphic-full’. Complex filters not supported. See scipy.signal.minimum_phase for details.

axis: str = 'time'#

The name of the axis to operate on. This should usually be “time”.

new_axis: str = 'kernel'#

The name of the new axis corresponding to the kernel index.

__init__(filters, mode=FilterbankMode.CONV, min_phase=MinPhaseMode.NONE, axis='time', new_axis='kernel')#
Parameters:
Return type:

None

class FilterbankDesignState[source]#

Bases: object

filterbank: FilterbankTransformer | None = None#
needs_redesign: bool = False#
class FilterbankDesignTransformer(*args, **kwargs)[source]#

Bases: BaseStatefulTransformer[FilterbankDesignSettings, AxisArray, AxisArray, FilterbankDesignState]

Transformer that designs and applies a filterbank based on Kaiser windowed FIR filters.

classmethod get_message_type(dir)[source]#
Parameters:

dir (str)

Return type:

type[AxisArray]

update_settings(new_settings=None, **kwargs)[source]#

Update settings and mark that filter coefficients need to be recalculated.

Parameters:
  • new_settings (FilterbankDesignSettings | None) – Complete new settings object to replace current settings

  • **kwargs – Individual settings to update

Return type:

None