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 of nfft’s window sizes and averaged across scales – what MatchSpectrogram is to MatchMagnitude, 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’s nfft.

  • nfft (tuple[int, ...]) – STFT window sizes, each no longer than the model’s nfft.

  • overlap (float) – Fractional overlap between frames (0.75 -> hop of a quarter window).

__init__(target, *, nfft=(256, 512, 1024, 2048), overlap=0.75)[source]#

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

name

Short label, used as the key in pyFDN.TrainLog.loss_log.