pyFDN.MatchPhaseSpectrogram#
- class pyFDN.MatchPhaseSpectrogram(target, *, nfft=(256, 512, 1024, 2048), overlap=0.75)[source]#
Circular distance of the STFT phase against a reference, multi-resolution.
The windowed sibling of
MatchPhase: rather than a single FFT over the whole response, phase is compared frame by frame at each ofnfft’s window sizes and averaged across scales – whatMatchSpectrogramis toMatchMagnitude, but for phase. The per-bin distance is \(1 - \cos(\Delta\phi)\), circular so the \(\pm\pi\) wrap costs nothing extra.- Parameters:
target (
Any) – Reference IR, shape(n_samples,),(n_samples, n_out)or(n_samples, n_out, n_in). Zero-padded or truncated to the model’snfft.nfft (
tuple[int,...]) – STFT window sizes, each no longer than the model’snfft.overlap (
float) – Fractional overlap between frames (0.75 -> hop of a quarter window).
Methods
__init__(target, *[, nfft, overlap])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.