pyFDN.SpectralFlatness#
- class pyFDN.SpectralFlatness(target=1.0, *, channels='none')[source]#
Spectral flatness measure of \(|H|\) fit to flat – colorless.
The ratio of the geometric to the arithmetic mean of \(|H|\), the classic flatness measure: 1 for a perfectly flat spectrum, towards 0 for a peaky one. Unlike
FlatMagnitude, both means scale the same way with an overall gain, so the loss is gain-invariant without needing to assume \(|H| \approx 1\). A silent response has flatness 0, the opposite end from flat.- Parameters:
Notes
A lossless FDN has every pole exactly on the unit circle, where the frequency-domain evaluation breaks down;
check()warns if the model was built without thealias_decay_dbthat avoids it.Methods
__init__([target, channels])check(model)Preflight against the model it will train, before the first step.
terms()Flatten into
(weight, loss)leaves.Attributes
nameShort label, used as the key in
pyFDN.TrainLog.loss_log.