ezmsg.sigproc.bandpower#
Spectral band power estimation via windowed FFT and aggregation.
Functions
- bandpower(spectrogram_settings, bands=[(17, 30), (70, 170)], aggregation=AggregationFunction.MEAN, materialize=MaterializeMode.ASYNC)[source]#
Calculate the average spectral power in each band.
- Returns:
- Parameters:
spectrogram_settings (SpectrogramSettings)
aggregation (AggregationFunction)
materialize (MaterializeMode)
- Return type:
Classes
- class BandPower(*args, settings=None, **kwargs)[source]#
Bases:
BaseTransformerUnit[BandPowerSettings,AxisArray,AxisArray,BandPowerTransformer]- Parameters:
settings (Settings | None)
- SETTINGS#
alias of
BandPowerSettings
- class BandPowerSettings(spectrogram_settings=<factory>, bands=<factory>, aggregation=AggregationFunction.MEAN, materialize=MaterializeMode.ASYNC)[source]#
Bases:
SettingsSettings for
BandPower.- Parameters:
spectrogram_settings (SpectrogramSettings)
aggregation (AggregationFunction)
materialize (MaterializeMode)
- spectrogram_settings: SpectrogramSettings#
Settings for spectrogram calculation.
- aggregation: AggregationFunction = 'mean'#
AggregationFunctionto apply to each band.
- materialize: MaterializeMode = 'async'#
How to evaluate the output on a lazy backend (MLX); see
MaterializeMode. No-op elsewhere.Defaults to
ASYNC: this node’s output is the end of a spectrogram chain, so evaluating it here keeps a lazy graph from accumulating even if nothing downstream forces it – but the caller has no need of the values on the host, so there is nothing to block for. SetOFFif a downstream node already materializes every cycle, orSYNCto time this stage’s work as its own.
- __init__(spectrogram_settings=<factory>, bands=<factory>, aggregation=AggregationFunction.MEAN, materialize=MaterializeMode.ASYNC)#
- Parameters:
spectrogram_settings (SpectrogramSettings)
aggregation (AggregationFunction)
materialize (MaterializeMode)
- Return type:
None
- class BandPowerTransformer(*args, **kwargs)[source]#
Bases:
CompositeProcessor[BandPowerSettings,AxisArray,AxisArray]