Lab 2 — Analyse output with Wave Compare
Take two renders of the same signal — a float reference and a fixed-point port — into Mantissa's Wave Compare mode. Run wav-diff, read the MLD / MAD / SSNR report per channel, and jump from the worst-mismatch marker straight to the sample that broke. 20–30 minutes.
What you'll need
- Mantissa (you have it — that's how you got here).
- Two
.wavfiles of the same signal — a float reference and a fixed-point port. Either theout_float.wav/out_fixed.wavyou produced in Lab 1, or the sample pair below. - No compiler and no IDE this time — this lab lives entirely inside the app.
1. Get the two files
If you finished Lab
1, you already have its two outputs — use
out_float.wav as the reference and
out_fixed.wav as the candidate.
Otherwise, grab the sample pair — a float reference and a fixed-point port carrying a deliberate, audible regression:
2. Load the pair into Wave Compare
- Click the button above to open the Wave Compare mode. (On the public web this navigates to the Wave Compare info page — the mode itself lives in the desktop app.)
- Load the float
.wavas the reference, and the fixed.wavas the candidate. Wave Compare overlays them on one shared time axis. - The mode accepts a second fixed candidate too (the optional Fixed2 row) — one is enough for this lab, but that's how you'd A/B two ports against the same reference.
3. Run wav-diff
Press Compare. Wave Compare runs wav-diff per channel and fills in the report. For each channel you get four numbers:
- MLD — maximum loudness difference: the peak perceptual-loudness mismatch under the BS.1387 / 3GPP TR 26.843 §5.3.3 PEAQ ear-model. Picks up the kind of error a human listener would notice, not just bit-for-bit deltas.
- MAD — maximum absolute difference: the single worst sample-by-sample error, in raw amplitude.
- min SSNR — minimum segmental SNR: the signal is split into 20 ms windows and a per-segment SNR (in dB) is computed; the report shows the worst (lowest) one. Catches localized blow-ups that a global RMS error would average away.
- The sample index of each worst-mismatch point — one per metric, so you can seek directly to it.
A stereo file reports each channel separately — a regression that hits only one channel shows up immediately.
4. Jump to the worst mismatch
- Click the MLD marker on the plot. Every overlay seeks to that sample at once.
- Zoom in. You can see exactly where the fixed port left the reference — a clipped peak, a stuck sample, a slow drift.
- Note the shape of the divergence: a lone spike reads differently from a sustained gap (see below).
5. Read the verdict
Each metric flags a different kind of failure — read them together, not just the worst number:
- MLD flags errors a human listener would notice. It's a perceptual-loudness diff under BS.1387's ear-model, so a high MLD means audible divergence in critical bands — even if the raw amplitude error is tiny.
- MAD flags large raw-amplitude errors. It says nothing about audibility: a big MAD can land in an inaudible frequency range or during a silent passage and never be heard.
- min SSNR flags time-localized blowups. The signal is split into 20 ms segments, each segment's SNR is computed, and the worst one is reported. A much-lower min SSNR than the average SNR means one specific window broke — usually a transient where a fixed-point op overflowed, saturated, or quantized into noise.
Reading the three together:
- All three healthy — small MLD, small MAD, high min SSNR. The port is doing its job; whatever error is left is uniform broadband quantization noise at half-LSB level.
- MLD high, MAD modest, min SSNR fine — the error isn't huge in raw amplitude but the ear-model says it lands in an audible band. Suspect quantization in a critical band, or a small bias the ear is sensitive to.
- MAD large, MLD modest — big raw errors the ear doesn't object to. Suspect errors in inaudible high frequencies, or large errors during silent passages.
- min SSNR collapses, MLD/MAD only moderate — a localized glitch. One or a few 20 ms windows are far worse than the rest: a saturation or overflow on a loud peak. That's the bug Lab 1 hunts. Click the SSNR marker on the plot to jump to the offending segment.
- MAD lifted across the board, MLD moderate, SSNR steady — a systemic fault: a wrong Q-factor, a scaling error, or a DC offset from a truncated stage (step 5). The mismatch is uniform, so no single segment stands out — the average ratio is what suffers.
That diagnosis — perceptual vs. amplitude, localized vs. systemic — is what points you back at the right fix: a single bad operation, or a format decision taken too early.
And that's the loop end to end — pick a format, port the arithmetic, debug it against the float reference, and verify the output. The same five tools and two modes carry any fixed-point port, however large.
Finished this step?
Mark it complete to track your progress through the tutorial.