Skip to content

ir_stats' PRE_IMPULSE_SNR_MIN_DB may have the same stimulus-dependence #471 found on the reference leg #474

Description

@mkovero

problem

#471 established that sweep::pre_impulse_snr_db is not a signal-to-noise ratio on a short electrical loopback leg: the pre-peak region is dominated by the deconvolution's own residue, whose level relative to the peak is set by the sweep shape, not by the capture's noise. Measured and reproduced synthetically within 0.5 dB — 100 dB of added noise moves it 0.0 dB, a route attenuated 40 dB reads like a good cable, and the figure ranges ~17 dB (20–20000 Hz) to ~35 dB (500–4000 Hz).

report::ir_stats judges the measurement IR with that same statistic, against a fixed PRE_IMPULSE_SNR_MIN_DB of 18.0 dB (#376). plot ir's default band floors at 17.2 dB in the configuration #471 characterised.

If the same dependence holds in ir_stats' configuration, the IR read-out's verdict is partly a property of the sweep the operator chose rather than of the capture — the defect #471 fixed for the reference leg.

why this is not yet a confirmed defect

The two call sites do not use the same configuration, so #471's numbers do not transfer:

reference leg (#471) ir_stats
window τ window, 2 × ceil(0.05 × sr) (9600 at 96 kHz) the request's window_len (default 4096)
harmonics 1 the request's n_harmonics (default 5)
path short electrical loopback long ESS, acoustic

The guard band is (ir_len / 32).max(8), so a different ir_len changes both the region measured and its length. The floor for ir_stats' actual configuration is unmeasured — that is the first thing this issue needs, not an assumption that 17.2 dB carries over.

TAU_SNR_THRESHOLD_DB's own doc comment already records that these are two constants with different evidence and deliberately not one, which is the right starting point: the question is whether 18.0 dB is anchored to a stimulus the same way 24.0 dB was.

what would settle it

  1. Characterise pre_impulse_snr_db over ir_stats' configuration — sweep shapes × window_len × n_harmonics — noiseless and with noise, the way plot_ir's same-capture reference fails calibrate's 24 dB gate at default sweep parameters #471 did. If noiseless ≈ noisy, the statistic is stimulus-bound there too.
  2. If it is: decide whether the same derived-floor rule applies (ac_core::measurement::sweep::pre_impulse_snr_floor_db already exists and takes window_len and peak_index, so the machinery is in place), or whether an acoustic capture's genuine noise makes the fixed constant still meaningful.
  3. Either way this changes a visible read-out verdict (IrVerdict::Failed), so it needs a UX pass — unlike plot_ir's same-capture reference fails calibrate's 24 dB gate at default sweep parameters #471, which only moved a refusal threshold inside an unchanged message.

provenance

related

#471 / PR #473 (the reference-leg fix and the characterisation), #376 (where 18.0 dB came from), #368 (the shared formula, and why the two thresholds are separate constants). Flagged by the architect in #471's design decision as explicitly out of that PR's scope.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-designArchitect must review before implementationsoftwareac Python/Rust codebasetier-1ac-core/measurement/ — QA runs the standards check

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions