ezmsg.sigproc.adaptive_lattice_notch#

Classes

class AdaptiveLatticeNotchFilterSettings(gamma=0.995, mu=0.99, eta=0.99, axis='time', init_notch_freq=None, chunkwise=False)[source]#

Bases: Settings

Settings for the Adaptive Lattice Notch Filter.

Parameters:
gamma: float = 0.995#

Pole-zero contraction factor

mu: float = 0.99#

Smoothing factor

eta: float = 0.99#

Forgetting factor

axis: str = 'time'#

Axis to apply filter to

init_notch_freq: float | None = None#

Initial notch frequency. Should be < nyquist.

chunkwise: bool = False#

Speed up processing by updating the target freq once per chunk only.

__init__(gamma=0.995, mu=0.99, eta=0.99, axis='time', init_notch_freq=None, chunkwise=False)#
Parameters:
Return type:

None

class AdaptiveLatticeNotchFilterState[source]#

Bases: object

State for the Adaptive Lattice Notch Filter.

s_history: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Historical s values for the adaptive filter.

p: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Accumulated product for reflection coefficient update

q: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Accumulated product for reflection coefficient update

k1: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Reflection coefficient

freq_template: CoordinateAxis | None = None#

Template for the frequency axis on the output

zi: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Initial conditions for the filter, updated after every chunk

class AdaptiveLatticeNotchFilterTransformer(*args, **kwargs)[source]#

Bases: BaseStatefulTransformer[AdaptiveLatticeNotchFilterSettings, AxisArray, AxisArray, AdaptiveLatticeNotchFilterState]

Adaptive Lattice Notch Filter implementation as a stateful transformer.

https://biomedical-engineering-online.biomedcentral.com/articles/10.1186/1475-925X-13-170

The filter automatically tracks and removes frequency components from the input signal. It outputs the estimated frequency (in Hz) and the filtered sample.

class AdaptiveLatticeNotchFilterSettings(gamma=0.995, mu=0.99, eta=0.99, axis='time', init_notch_freq=None, chunkwise=False)[source]#

Bases: Settings

Settings for the Adaptive Lattice Notch Filter.

Parameters:
gamma: float = 0.995#

Pole-zero contraction factor

mu: float = 0.99#

Smoothing factor

eta: float = 0.99#

Forgetting factor

axis: str = 'time'#

Axis to apply filter to

init_notch_freq: float | None = None#

Initial notch frequency. Should be < nyquist.

chunkwise: bool = False#

Speed up processing by updating the target freq once per chunk only.

__init__(gamma=0.995, mu=0.99, eta=0.99, axis='time', init_notch_freq=None, chunkwise=False)#
Parameters:
Return type:

None

class AdaptiveLatticeNotchFilterState[source]#

Bases: object

State for the Adaptive Lattice Notch Filter.

s_history: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Historical s values for the adaptive filter.

p: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Accumulated product for reflection coefficient update

q: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Accumulated product for reflection coefficient update

k1: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Reflection coefficient

freq_template: CoordinateAxis | None = None#

Template for the frequency axis on the output

zi: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#

Initial conditions for the filter, updated after every chunk

class AdaptiveLatticeNotchFilterTransformer(*args, **kwargs)[source]#

Bases: BaseStatefulTransformer[AdaptiveLatticeNotchFilterSettings, AxisArray, AxisArray, AdaptiveLatticeNotchFilterState]

Adaptive Lattice Notch Filter implementation as a stateful transformer.

https://biomedical-engineering-online.biomedcentral.com/articles/10.1186/1475-925X-13-170

The filter automatically tracks and removes frequency components from the input signal. It outputs the estimated frequency (in Hz) and the filtered sample.