Open Science
How LabSound computes every number it shows, what has been verified, and what remains unknown.
Three different questions
LabSound keeps three answers apart: what can be measured (numbers computed from the samples), what can be visualized (pictures of those numbers, which depend on display choices), and what you can actually hear (only answered by a blind test under your conditions). A large measured difference is not proof of an audible one, and a failed blind test is not proof that two files are identical.
Decoding at the native rate
WAV, AIFF/AIFC and FLAC are decoded by LabSound’s own TypeScript decoders into exact integer samples at the file’s native rate. FLAC frame CRCs and the stored MD5 signature are verified. MP3, AAC, Opus and Vorbis are decoded by the browser inside an offline audio context created at the file’s own sample rate, so the browser does not resample them; declared encoder delay and padding are trimmed when the file states them.
Lossless decoding is tested against independently generated files: integer sample hashes must match exactly (16, 24 and 32-bit; 44.1, 96 and 192 kHz; mono and stereo; FLAC levels 0 and 8).
Spectra and spectrograms
FFTs are unnormalised forward transforms with periodic windows. Amplitude spectra are one-sided and divided by the window’s coherent gain, so a full-scale sine centred on a bin reads 0 dBFS. Power spectral density uses the window’s energy and the sample rate (FS²/Hz). Spectrogram frames are centred with N/2 zero padding at both ends. Paired views always share the same settings, range and colour scale. The difference view subtracts two magnitude spectrograms in dB and is labelled as such; the spectrogram of the time-domain difference is shown separately.
Loudness and level matching
Loudness follows ITU-R BS.1770-5: K-weighting recomputed for each sample rate, 400 ms blocks with 75% overlap, an absolute gate at −70 LUFS and a relative gate at −10 LU; true peak uses polyphase oversampling. For comparisons, both versions are measured over the same aligned interval, one constant gain is applied (no limiter or compressor), and a common attenuation keeps true peaks at or below −1 dBTP. Loudness is then measured again.
Alignment
Lag is estimated with normalised FFT cross-correlation on the mid signal, with sub-sample refinement and an ambiguity check for periodic or silent material. Positive lag means the candidate is late. For listening, only whole-sample shifts are applied (trimming), so neither signal is interpolated; the fractional remainder is reported. Uncertain or incompatible pairs are excluded from difference views and formal tests.
Blind ABX statistics
The number of trials is fixed before the test. X is assigned independently in each trial with the browser’s cryptographic random generator. There is no feedback until the end. The result is the exact one-sided binomial probability of scoring at least as well by guessing (for example, 15 of 20 gives p ≈ 0.0207 and 14 of 20 gives p ≈ 0.0577), with a Clopper–Pearson 95% confidence interval. All versions play through one identical path, with constant gains and identical 5 ms linear crossfades, so that switching itself cannot reveal X.
Perception and preference experiments
Pitch and gap experiments use two-alternative forced choice with a 2-down-1-up adaptive staircase (Levitt 1971), which converges near 70.7% correct; the threshold is the geometric mean of the last six reversals. In simulation with a known psychometric function, the median estimate over 200 runs lies within ±25% of the true 70.7% point. Noise stimuli are low-passed at 8 kHz with a 511-tap FIR (measured ≥ 60 dB down at 12 and 20 kHz). No tone above 16 kHz is ever played. The Loudness Illusion uses randomized pairs with a 1 dB level difference implemented as constant attenuation only (−0.5 dB vs −1.5 dB). Results describe one person under declared conditions; they are not clinical measurements or population findings.
How this was verified
Two independent teams worked on the engine: one implemented it, the other wrote reference fixtures with NumPy, SciPy and FFmpeg without seeing the implementation, with tolerances fixed in advance. The current build passes all of them, including: FFT agreement with NumPy within 5·10⁻¹⁰; window gains; spectrum levels within ±0.01 dB; resampler passband within ±0.01 dB and stopband rejection of at least 100 dB at tested ratios; loudness within 0.04 LU and true peak within 0.011 dB of FFmpeg’s ebur128 on generated signals; integer and fractional lag recovery (fractional error ≤ 0.05 samples at high SNR); exact binomial and Clopper–Pearson values.
Known limitations
A browser cannot guarantee or verify bit-perfect output to your DAC, cannot see your system volume or audio effects, and may resample to the device rate. No physical DAC or headphone measurements have been made for this release. Loudness tests cover generated signals and the EBU Tech 3341 cases 1–2; the full EBU conformance suite has not yet been run. Lossy decoding depends on your browser’s decoders. The sample recordings are procedurally generated originals, not commercial music.
- Source code, tests and fixtures: public repository (Apache 2.0).
- Sample manifest with encoder versions, exact commands and checksums: /audio/manifest.json.