pyFDN.MatchMelEnergyDecayRelief#

class pyFDN.MatchMelEnergyDecayRelief(target, *, fft_sizes=(1024, 2048, 512), win_lengths=(600, 1200, 240), hop_lengths=(120, 240, 50), n_mels=64, p=1.0)[source]#

Multi-resolution mel energy decay relief (EDR) distance to a reference.

At each STFT resolution, the mel power spectrogram of both signals is backward-integrated over time and taken to dB (with an 80 dB floor), and the normalized \(L^p\) error \(\overline{|E - \hat E|^p} / \overline{|\hat E|^p}\) is averaged over the resolutions. Decay and colour at once, like MatchCumulativeEnergy, but banded on the mel scale.

Contributed by Riccardo Giampiccolo. The defaults are his, tuned at 16 kHz; at 48 kHz the same STFT sizes span a third of the time.

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.

  • fft_sizes (tuple[int, ...]) – One STFT resolution per entry; all three the same length.

  • win_lengths (tuple[int, ...]) – One STFT resolution per entry; all three the same length.

  • hop_lengths (tuple[int, ...]) – One STFT resolution per entry; all three the same length.

  • n_mels (int) – Number of mel bands.

  • p (float) – Exponent of the error.

__init__(target, *, fft_sizes=(1024, 2048, 512), win_lengths=(600, 1200, 240), hop_lengths=(120, 240, 50), n_mels=64, p=1.0)[source]#

Methods

__init__(target, *[, fft_sizes, ...])

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.