ezmsg.sigproc.decimate#

Decimation (downsample with anti-alias filtering).

Classes

class ChebyForDecimate(*args, settings=None, **kwargs)[source]#

Bases: BaseTransformerUnit[ChebyshevFilterSettings, AxisArray, AxisArray, ChebyForDecimateTransformer]

Parameters:

settings (Settings | None)

SETTINGS#

alias of ChebyshevFilterSettings

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

Bases: ChebyshevFilterTransformer[tuple[NDArray, NDArray] | NDArray]

A ChebyshevFilterTransformer with a design filter method that additionally accepts a target sampling rate,

and if the target rate cannot be achieved it returns None, else it returns the filter coefficients.

get_design_function()[source]#

Return a function that takes sampling frequency and returns filter coefficients.

Return type:

Callable[[float], tuple[NDArray, NDArray] | NDArray | None]

class Decimate(*args, settings=None, **kwargs)[source]#

Bases: Collection

A Collection chaining a Filter node configured as a lowpass Chebyshev filter and a Downsample node.

Parameters:

settings (Settings | None)

SETTINGS#

alias of DecimateSettings

INPUT_SIGNAL = InputTopicStream:unlocated[AxisArray]()#
OUTPUT_SIGNAL = OutputTopicStream:unlocated[AxisArray]()#
FILTER = <ezmsg.sigproc.decimate.ChebyForDecimate object>#
DOWNSAMPLE = <ezmsg.sigproc.downsample.Downsample object>#
configure()[source]#

A lifecycle hook that runs when the Collection is instantiated.

This is the best place to call Unit.apply_settings() on each member Unit of the Collection. Override this method to perform collection-specific configuration of child components.

Return type:

None

network()[source]#

Override this method and have the definition return a NetworkDefinition which defines how InputStreams and OutputStreams from member Units will be connected.

The NetworkDefinition specifies the message routing between components by connecting output streams to input streams.

Returns:

Network definition specifying stream connections

Return type:

NetworkDefinition

class DecimateSettings(target_rate=None, factor=None, axis=None)[source]#

Bases: DownsampleSettings

Settings for Decimate.

Adds the anti-aliasing filter’s axis on top of the downsampler’s settings. The filter has one because a filter legitimately runs along any dimension; the downsampler does not, because its phase counter only means something along the dimension messages accumulate along. Leave axis matching the stream’s stream dimension – filtering one dimension and decimating another is not decimation.

Parameters:
  • target_rate (float | None)

  • factor (int | None)

  • axis (str | None)

axis: str | None = None#

Deprecated since version 3.8.

Scheduled for removal in 4.0. The dimension messages accumulate along now comes from stream_dim; see ezmsg.sigproc.util.deprecation.

__init__(target_rate=None, factor=None, axis=None)#
Parameters:
  • target_rate (float | None)

  • factor (int | None)

  • axis (str | None)

Return type:

None