home/ atoms/ a-weighting-loudness

Perceptual loudness in DDSP uses A-weighting to match human hearing sensitivity across frequencies

DDSP’s compute_loudness() computes perceptual loudness in dB by applying A-weighting to the STFT power spectrum before averaging. A-weighting increases the contribution of mid-range frequencies (1-4 kHz where human hearing is most sensitive) and reduces the contribution of very low and very high frequencies. This gives a loudness measure that better correlates with perceived volume than unweighted RMS or peak amplitude. The result is used as a conditioning signal for the DDSP autoencoder decoder alongside f0 and the latent z.

Examples

loudness_db = ddsp.spectral_ops.compute_loudness(
    audio,           # [batch, n_samples] at 16kHz
    sample_rate=16000,
    frame_rate=250,  # Hz
    n_fft=2048)

Assessment

Why is A-weighted loudness a better conditioning signal than simple RMS amplitude for a music synthesis model? What frequency range is most amplified by A-weighting?

“# Perceptual weighting. frequencies = librosa.fft_frequencies(sr=sample_rate, n_fft=n_fft) a_weighting = librosa.A_weighting(frequencies)[lib.newaxis, lib.newaxis, :]”
corpus · ddsp-differentiable-digital-signal-processing-magenta-code-c · chunk 56