import { spectralDistance } from '@datamoc/mwg/audio';
declare const reference: { sampleRate: number; left: Float32Array; right: Float32Array };
declare const candidate: { sampleRate: number; left: Float32Array; right: Float32Array };
console.log(spectralDistance(reference, candidate).decibels);
How far apart two renders sound, as the mean absolute difference of their log spectra: the number to watch when one synthesis engine is tuned toward another's reference, or when a change must not alter a render. Both are folded to mono and brought to the first one's sample rate; the shorter is padded with silence. Bins more than
floorDbbelow the loudest of the pair do not count, so inaudible noise cannot dominate the figure.