ezmsg.sigproc.denormalize#

Denormalize signals by applying random gains and offsets.

Classes

class DenormalizeSettings(low_rate: float = 2.0, high_rate: float = 40.0, distribution: str = 'uniform', seed: int | None = None)[source]#

Bases: Settings

Parameters:
low_rate: float = 2.0#

Low end of probable rate after denormalization (Hz).

high_rate: float = 40.0#

High end of probable rate after denormalization (Hz).

distribution: str = 'uniform'#

Distribution to sample rates from. Options are ‘uniform’, ‘normal’, or ‘constant’.

seed: int | None = None#

Seed for the per-channel draw. None draws fresh values on every state reset, so a run is not reproducible and a mid-stream channel change silently re-rolls every channel’s rate. Set it for a repeatable simulation.

__init__(low_rate=2.0, high_rate=40.0, distribution='uniform', seed=None)#
Parameters:
Return type:

None

class DenormalizeState[source]#

Bases: object

gains: NDArray | None = None#
offsets: NDArray | None = None#
class DenormalizeTransformer(*args, **kwargs)[source]#

Bases: BaseStatefulTransformer[DenormalizeSettings, AxisArray, AxisArray, DenormalizeState]

Scales data from a normalized distribution (mean=0, std=1) to a denormalized distribution using random per-channel offsets and gains designed to keep the 99.9% CIs between 0 and 2x the offset.

This is useful for simulating realistic firing rates from normalized data.

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

Bases: BaseTransformerUnit[DenormalizeSettings, AxisArray, AxisArray, DenormalizeTransformer]

Parameters:

settings (Settings | None)

SETTINGS#

alias of DenormalizeSettings