spectral_entropy
spectral_entropy(
patch: Patch ,
dim: str | None[str, None] = None,
fmin: float | None[float, None] = None,
fmax: float | None[float, None] = None,
normalize: bool = True,
spectral_format: Literal[‘auto’, ‘fft’, ‘amplitude’, ‘power’, ‘density’] = auto,
negative_frequencies: Literal[‘auto’, ‘drop’, ‘raise’, ‘keep’] = auto,
)-> ‘PatchType’
Compute spectral entropy from a Fourier-domain patch.
Spectral entropy measures the disorder of the spectral power distribution. Low values indicate concentrated spectral energy, while high values indicate broadband or noisy spectra. The input patch must already be transformed with Patch.dft or Patch.stft.
Parameters
| Parameter | Description |
|---|---|
| patch |
Fourier-domain DASCore patch from dft or stft.
|
| dim |
Frequency dimension over which to compute the descriptor. This can be either the original dimension name, such as "time", or the Fourierdimension name, such as "ft_time". If omitted, a single Fourierdimension is inferred. |
| fmin | Optional lower frequency bound. |
| fmax | Optional upper frequency bound. |
| normalize | If True, normalize entropy to [0, 1]. Defaults to True. |
| spectral_format |
Representation of the spectral data. "auto" uses DASCore DFT/STFTmetadata when available. Other options are "fft" for complex Fouriercoefficients, "amplitude" for amplitude spectra, "power" forpower spectra, and "density" for power spectral densities.
|
| negative_frequencies |
How to handle negative frequency bins. "auto" drops negative binsonly when power is symmetric, "drop" always uses non-negativefrequencies, "raise" rejects spectra with negative bins, and"keep" includes them in the calculation.
|
Returns
PatchType Patch containing spectral entropy.