Measuring SNR on real recordings with no clean reference
When there is no clean reference, SNR is an estimate with assumptions. Three methods, their biases, and the checks that catch a bad number.
The definition of signal-to-noise ratio assumes you hold both signals. On a field recording you hold one: the mixture. What you can measure is the relationship between the speech-active parts and the pauses in the same file, and every method for doing that rests on assumptions worth stating next to the number.
Three methods follow, in increasing order of what they assume, then the sanity checks that tell you whether to believe the result.
The percentile method
Frame the file into 20 to 30 millisecond windows with 50 percent overlap, compute the level of each frame in decibels, and read two percentiles. The 10th percentile stands in for the noise floor and the 90th for the speech level. Percentiles rather than minimum and maximum, because one click sets the minimum and one plosive sets the maximum.
The method fails in a predictable way: it needs pauses. A file that is nearly all speech has no noise to measure, and the method quietly returns the quietest phonemes as the noise floor, which inflates the estimate by 10 dB or more. Check the speech fraction first. If frames above the threshold account for more than about 90 percent of the file, refuse to report an SNR from this method.
The voice-activity method
A voice activity detector splits the file into speech and non-speech, and you compute the level of each region separately. webrtcvad accepts 8, 16, 32, and 48 kHz input in 10, 20, or 30 millisecond frames, and its aggressiveness mode is the parameter to tune. A neural detector expects 16 kHz and tends to be more accurate in noise.
The direction of the bias is worth knowing. In a noisy file, a detector tuned on clean audio marks noise as speech, which raises the estimated noise level and lowers the reported SNR: conservative. A detector that misses speech in noise lowers the speech estimate instead: liberal. Report which detector and which mode produced the number, because the same recording can move several decibels between them.
When there are no pauses and no detector you trust
WADA-SNR estimates the ratio from the distribution of sample amplitudes alone, without a voice activity detector. It is a published method, implementations are available, and it works best on speech with a wide dynamic range. It degrades on compressed, limited, or heavily processed audio, which describes a fair share of real collections.
The honest fallback, when nothing is trustworthy, is to report a range with the methods named rather than a single value. A number like 12 to 18 dB with two methods cited is more useful to a colleague than a false precision of 14.6 dB.
Sanity checks before you trust a number
Each of these catches a specific way the estimate goes wrong.
- Gain invariance: multiply the file by 0.5 and rerun. An estimator whose answer moves with absolute level is measuring the wrong thing.
- Clipping: if samples sit at the full-scale limit, the recording is distorted and the estimate is not meaningful until you know how much of the file is affected.
- Limiting: check the crest factor, meaning peak level minus RMS level. Below about 10 dB the audio has been compressed hard, which flattens the noise floor and pushes the estimate up.
- Cross-method agreement: if the percentile and voice-activity methods disagree by more than about 5 dB, report both and the reason, rather than choosing the one you prefer.
What a single number cannot tell you
SNR is a scalar summary of a process that is not stationary. Two files at the same 15 dB can behave completely differently in a recognizer. A steady fan is easy to adapt to. Intermittent babble at the same average level is not, because competing speech is confusable with the target speaker.
So report a small tuple instead of one number: the estimate, the method, the speech-active fraction of the file, and a stationarity measure such as the standard deviation of frame levels in the non-speech region. Four numbers that explain a recording beat one number that misleads about it.