ezmsg.sigproc.downsample#

Functions

downsample(axis='time', target_rate=None, factor=None)[source]#
Parameters:
  • axis (str)

  • target_rate (float | None)

  • factor (int | None)

Return type:

DownsampleTransformer

Classes

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

Bases: BaseTransformerUnit[DownsampleSettings, AxisArray, AxisArray, DownsampleTransformer]

Parameters:

settings (Settings | None)

SETTINGS#

alias of DownsampleSettings

class DownsampleSettings(axis='time', target_rate=None, factor=None)[source]#

Bases: Settings

Settings for Downsample node.

Parameters:
  • axis (str)

  • target_rate (float | None)

  • factor (int | None)

axis: str = 'time'#

The name of the axis along which to downsample.

target_rate: float | None = None#

Desired rate after downsampling. The actual rate will be the nearest integer factor of the input rate that is the same or higher than the target rate.

factor: int | None = None#

Explicitly specify downsample factor. If specified, target_rate is ignored.

__init__(axis='time', target_rate=None, factor=None)#
Parameters:
  • axis (str)

  • target_rate (float | None)

  • factor (int | None)

Return type:

None

class DownsampleState[source]#

Bases: object

q: int = 0#

The integer downsampling factor. It will be determined based on the target rate.

s_idx: int = 0#

Index of the next msg’s first sample into the virtual rotating ds_factor counter.

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

Bases: BaseStatefulTransformer[DownsampleSettings, AxisArray, AxisArray, DownsampleState]

Downsampled data simply comprise every factor`th sample. This should only be used following appropriate lowpass filtering. If your pipeline does not already have lowpass filtering then consider using the :obj:`Decimate collection instead.

class DownsampleSettings(axis='time', target_rate=None, factor=None)[source]#

Bases: Settings

Settings for Downsample node.

Parameters:
  • axis (str)

  • target_rate (float | None)

  • factor (int | None)

axis: str = 'time'#

The name of the axis along which to downsample.

target_rate: float | None = None#

Desired rate after downsampling. The actual rate will be the nearest integer factor of the input rate that is the same or higher than the target rate.

factor: int | None = None#

Explicitly specify downsample factor. If specified, target_rate is ignored.

__init__(axis='time', target_rate=None, factor=None)#
Parameters:
  • axis (str)

  • target_rate (float | None)

  • factor (int | None)

Return type:

None

class DownsampleState[source]#

Bases: object

q: int = 0#

The integer downsampling factor. It will be determined based on the target rate.

s_idx: int = 0#

Index of the next msg’s first sample into the virtual rotating ds_factor counter.

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

Bases: BaseStatefulTransformer[DownsampleSettings, AxisArray, AxisArray, DownsampleState]

Downsampled data simply comprise every factor`th sample. This should only be used following appropriate lowpass filtering. If your pipeline does not already have lowpass filtering then consider using the :obj:`Decimate collection instead.

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

Bases: BaseTransformerUnit[DownsampleSettings, AxisArray, AxisArray, DownsampleTransformer]

Parameters:

settings (Settings | None)

SETTINGS#

alias of DownsampleSettings

downsample(axis='time', target_rate=None, factor=None)[source]#
Parameters:
  • axis (str)

  • target_rate (float | None)

  • factor (int | None)

Return type:

DownsampleTransformer