ezmsg.sigproc.downsample#
Integer downsampling by selecting every Nth sample along an axis.
Functions
Classes
- class Downsample(*args, settings=None, **kwargs)[source]#
Bases:
BaseTransformerUnit[DownsampleSettings,AxisArray,AxisArray,DownsampleTransformer]- Parameters:
settings (Settings | None)
- SETTINGS#
alias of
DownsampleSettings
- async on_signal(message)[source]#
Skip the publish when no samples accumulated.
At
factor > 1most input chunks span less than one downsample period, soDownsampleTransformer._processreturns a payload with a zero-length axis. Suppressing the broadcast in that case avoids shipping an empty AxisArray across SHM/socket every input chunk.- Parameters:
message (AxisArray)
- Return type:
- class DownsampleSettings(axis='time', target_rate=None, factor=None)[source]#
Bases:
SettingsSettings for
Downsamplenode.- 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.
- 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.