diff --git a/HANDOFF.md b/HANDOFF.md index 91cad71..21eb1cb 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -2,6 +2,17 @@ > Context brief for a Claude Code session. Captures decisions and technical direction so the next session can start working without re-deriving anything. Can be adapted into a `CLAUDE.md` for persistent project context. > +> **Rev 5** — planning revision, no code. Rev 4's effort is fully merged +> (both repos); the next effort is chosen and staged: **ITU compliance +> for the AEC, with margin** — prove, via a requirements matrix, a +> calibrated ITU-signal layer, a new residual-echo post-filter, a +> compliance test suite and a proof notebook, that the AEC chain passes +> the applicable clauses of G.167 / P.340 / a G.168-adapted battery / +> P.1100-P.1120 (automotive) with asserted headroom. Scope decisions +> settled with Tim; see "The next effort (Rev 5)". BLOCKER for Stage 0: +> `itu.int` must be allowlisted in the dev environment's network policy +> (Tim's action) so the rec texts can be read. +> > **Rev 4** — planning revision, no code. The next effort is chosen and > staged: **AEC objects + the echo-cancellation book chapter** (former > "What's next" items 5+6 — chosen because items 1–2 need Tim in a real @@ -196,6 +207,91 @@ introduction, README, notebook). The whole effort is complete; what remains of the AEC line is real-call listening, which folds into "What's next" item 1.* +## The next effort (Rev 5): ITU compliance for the AEC, with margin + +Goal (Tim's directive): the AEC passes the applicable ITU specifications, +preferably with LARGE margin, proven by tests/harness and notebooks. What +this repo can prove is **algorithmic compliance with margin**: the AEC +chain, driven by the standardized test signals through simulated and +physically-modeled echo paths, meets every testable clause — each margin +regression-tested, plus a notebook showing requirement vs measured vs +margin per clause. Device-level certification (real transducers, HATS +rigs, TCLw of a physical terminal) inherently needs a lab; this effort +builds the evidence package that makes the lab visit boring. + +Scope decisions settled with Tim (2026-07-16): +- **Normative anchors**: P.340 (hands-free terminal: TCLw, duplex + categories) + G.167 (the AEC-specific rec) + a G.168-adapted battery + (its tests are for line echo; we adapt them to acoustic paths as a + supplementary suite) + **the automotive series P.1100/P.1110/P.1120**. + The automotive recs cover the whole terminal chain — the matrix must + mark which clauses concern the AEC vs out-of-scope terminal items + (frequency response, noise reduction), and they bring two new + simulation axes: car-cabin echo paths and driving-noise conditions. +- **Post-filter approved**: linear cancellation measures ~20 dB; the + single-talk attenuation targets are 40+ dB. Stage 2 builds the + residual-echo suppressor + matched comfort noise as a new pluggable + MuTap stage, plus an integrated AEC-chain type (the specs measure the + chain, not the filter). +- **Spec access**: itu.int gets allowlisted in the dev environment's + network policy (BLOCKER, Tim's action — environment settings on + claude.ai/code). The rec PDFs are free downloads; nothing gets + committed to the repo but our own distilled matrix. P.501 signals are + GENERATED from their algorithmic descriptions, never redistributed. +- **Margin policy (proposed, confirm in Stage 0)**: every requirement + asserted with >= 6 dB (level clauses) or >= 2x (time clauses) headroom, + so margin EROSION fails CI, not just outright failure. + +**Stage 0 — Requirements matrix.** *DONE — `docs/itu-compliance.md`. +Editions read: P.1110/P.1100 (03/2017), P.1120 (10/2025), P.340 +(05/2000), P.501 (04/2025), G.168 (04/2015), G.167 (03/1993, withdrawn), +G.131 (11/2003). Findings that shaped the matrix: (1) the AUTOMOTIVE +series is the operative modern AEC battery (concrete masks: TCL >= 46 dB, +residual < -58 dBm0(A), ERL >= 40 dB by 1.2 s, spectral masks, switching +dynamics, comfort-noise tolerances); (2) P.1120 (2025) normatively cites +P.340 (2000) — the edition in hand — and restates all category tables, +so the P.340-2019 procurement gap is moot for the operative rows; +(3) P.340/G.167 explicitly permit simulated echo paths and P.1110 +clause 8 defines digital insertion interfaces for exactly this kind of +testing; (4) targets chosen: P.340 CATEGORY 1 (full duplex) on all three +double-talk tables, WB+SWB/FB primary bandwidths at 48 kHz; (5) the +P.1110 Annex E stability sweep (far-end ERL 50 -> 0 dB, no howling) is a +closed-loop test — AFC home turf; (6) real-speech gap: three core tests +use ITU attachment WAVs (P.501 7.3.2/7.3.3/7.3.5) — Stage 1 attempts +download for local git-ignored test use, else documented synthetic +stand-ins marked method-equivalent; (7) P.502 still unobtained — +analysis methods reconstructed from the P.340/P.111x test descriptions. +Rec PDFs live in the session scratchpad only (never committed).* + +**Stage 1 — Calibrated ITU signal layer** (`tests/support/`). Level +calibration conventions (dBov/activity-gated levels), a deterministic +P.501 CSS generator, the P.501 double-talk sequences, per-bandwidth +band-limiting, driving-noise generator + car-cabin echo paths for the +P.1100 series (modeled first; Tim's measured cabin RIRs can join via the +existing fixture pipeline). Pass: generated signals match published +spectral/temporal properties. + +**Stage 2 — Residual-echo post-filter + comfort noise.** The big DSP +item. New header (working name `mutap/postfilter.h`): coherence-based +residual-echo estimate, spectral suppression, comfort noise matched to +the near-end noise floor; plus the integrated chain type. House +workflow: scratch-measure first, thresholds with margin, rooms from both +generator families. RT contract as everywhere. + +**Stage 3 — Compliance suite** (`tests/test_itu_*.cpp`). One gtest per +matrix row asserting requirement + margin policy. Swept across fixture +rooms + synthetic rooms + car cabins where the clause demands. + +**Stage 4 — Proof notebook.** `tools/notebook/build_itu_compliance.py` +-> `notebooks/itu_compliance.ipynb`: one section per requirement group, +requirement/measured/margin table per section, convergence curves vs the +specs' time masks, double-talk timelines vs the P.340 windows. + +**Stage 5 — Externals + docs.** Post-filter attribute on `mutap.aec~`, +C ABI extension for the notebook, maxref/help updates, book-chapter +section, README compliance claims with margins. (Submodule dance, +working note 6, as always.) + --- ## What this is diff --git a/docs/itu-compliance.md b/docs/itu-compliance.md new file mode 100644 index 0000000..8e14b37 --- /dev/null +++ b/docs/itu-compliance.md @@ -0,0 +1,289 @@ +# ITU compliance matrix for the MuTap AEC (Stage 0 of HANDOFF Rev 5) + +> The single source of truth for the ITU compliance effort: every testable +> clause of the anchor recommendations, the requirement it imposes, the +> margin we target, and the test that owns it. Downstream stages (signal +> layer, post-filter, compliance suite, proof notebook) key off the rows +> in this document; matrix row IDs become test names. + +## What "compliance" means here + +This repository proves **algorithmic compliance with margin**: the AEC +chain (linear canceller + residual-echo post-filter + comfort noise), +driven by the standardized test signals through simulated and +physically-modeled echo paths, meets every clause marked `[ALGO]` below — +each with regression-tested headroom. Clauses marked `[TERMINAL]` +inherently require a physical terminal in a lab (transducers, HATS, real +cabins); they are listed so "not covered" is always explicit. `[MIXED]` +clauses get their algorithmic component proven against a **defined +simulated echo path** and their physical component flagged. + +Two findings from the texts themselves legitimize the simulation +approach: + +- P.340 (10.3.1) and G.167 (5.2.3.1) **explicitly permit electronically + simulated echo paths** (non-time-varying reflections, envelope similar + to a real room, reverberation times specified per application). +- P.1110 clause 8 defines **digital access interfaces** whose stated + purpose is exactly this: record and digitally re-insert noise, speech + and echo so that "no HATS is necessary at all" for processing tests. + +## Margin policy + +"Pass with large margin" (Tim's directive) is defined as: + +- **Level clauses** (attenuation, loss, residual level, masks): pass by + **>= 6 dB** beyond the required value. +- **Time clauses** (convergence, switching, build-up): pass in + **<= 1/2** of the allowed time. +- **Category clauses** (P.340 duplex categories): meet **Category 1 + (full duplex)** where the category-1 bound is the strictest bound — + margin is then measured against the category-1 value. +- Every margin is asserted in the owning test, so margin EROSION fails + CI — not just outright violation. Measured values live in comments + next to the assertions (house workflow). + +## Recommendation editions used + +| Rec | Edition read | Status | Role | +|---|---|---|---| +| ITU-T P.1110 (automotive, WB) | 03/2017 | 10/2025 ed. not on free portal | **Tier A (primary)** — the operative wideband AEC battery | +| ITU-T P.1120 (automotive, SWB/FB) | 10/2025 | In force, newest text | **Tier A (primary)** — SWB/FB values; normatively references P.340 (2000) — the edition we hold — and restates every table it needs | +| ITU-T P.1100 (automotive, NB) | 03/2017 | 10/2025 ed. not on free portal | Tier A (narrowband deltas only) | +| ITU-T P.340 (hands-free terminals) | 05/2000 | 01/2019 ed. not on free portal | **Tier A (framework)** — duplex categories, build-up/hang-over. NOTE: P.1120 (2025) still normatively cites P.340 (2000), so the operative category tables are fully in hand; refresh against 01/2019 when procured. | +| ITU-T P.501 (test signals) | 04/2025 | In force | Signal definitions for Stage 1 (generated, never redistributed) | +| ITU-T G.168 (network echo cancellers) | 04/2015 | 2022 ed. not on free portal | **Tier B** — ADAPTED battery on acoustic paths, labeled as such | +| ITU-T G.167 (acoustic echo controllers) | 03/1993 | **Withdrawn**; most values bracketed = provisional | **Tier C (historical)** — informative rows only | +| ITU-T G.131 (talker echo) | 11/2003 | In force | Context: when echo control is required; no matrix rows | +| ITU-T P.502 (analysis methods) | — | **Not obtained** (free portal does not serve it) | Analysis methods reconstructed from P.340/P.1110/P.1120 test descriptions; refresh when procured | + +## Targets chosen (Stage 0 decisions) + +- **Duplex target: P.340 Category 1 (full duplex)** on all three + double-talk tables — send attenuation A_H,S,dt <= 3 dB, receive + attenuation A_H,R,dt <= 3 dB, double-talk echo loss >= 27 dB — since + detector-free double-talk adaptation is MuTap's measured strength. +- **Bandwidth: wideband (P.1110) and SWB/FB (P.1120) are primary**; + narrowband (P.1100) variants run as band-limited configurations of the + same tests. Everything executes at 48 kHz with P.501-specified + band-limiting of the receive-direction signals (NB 3.6/4 kHz, WB + 7.2/8 kHz, SWB 14.4/16 kHz, FB 20 kHz low-pass). +- **The simulated echo paths**: the three committed image-source rooms + (fixtures) + a new car-cabin family (small volume ~2.5 m^3, RT ~60 ms + per G.167 5.2.3.1's car figures) + the P.1110/P.1120 time-variant-path + analogue (a time-varying impulse response modeling the rotating + reflector) + delay/attenuation-only paths for the stability sweep. + Tim's measured cabin RIRs can join via the existing fixture pipeline. +- **Levels**: the harness adopts the specs' conventions — dBm0 for + electrical/POI signals (receive nominal **-16 dBm0**), dBPa at MRP for + acoustic send (nominal **-1.7 dBPa**), P.56-style active-speech-level + measurement, and dBov for digital normalization (-26 dBov active + level). A single calibration header maps these onto the simulation's + linear float domain. + +--- + +## Tier A matrix — automotive battery (P.1110 WB / P.1120 SWB-FB / P.1100 NB) + +Row ID = owning test name. "Required" cites the spec value; "Margin +target" is what our tests assert. Tags: [ALGO] provable in simulation, +[MIXED] algorithmic component provable against a defined simulated path, +[TERMINAL] lab-only (listed, not claimed). + +### Echo performance (11.11.x) + +| Row ID | Clause | Requirement | Required | Margin target | Tag | Signal | +|---|---|---|---|---|---|---| +| `ITU_TCL` | P1110/P1120 11.11.1 (P1100 = same) | Terminal coupling loss, quiet, converged (first 17 s discarded), unweighted 100 Hz-8 kHz per generalized G.122 B.4 | **>= 46 dB** (>= 50 dB objective) | **>= 52 dB** | [MIXED] | Compressed real speech (P.501 7.3.3) at -10 dBm0 | +| `ITU_EchoLevel` | P1120 11.11.2 | Max of echo level-vs-time, single talk, steady state, A-weighted, 35 ms integration | **< -58 dBm0(A)** | **< -64 dBm0(A)** | [ALGO] | BE single-talk seq (P.501 7.3.2) at -16 dBm0 | +| `ITU_EchoStability` | P1110 11.11.2 (P1100 11.11.2) | Echo attenuation shall not degrade > 6 dB from its best during single talk | **<= 6 dB** variation | **<= 3 dB** | [ALGO] | CSS at -5 and -25 dBm0; BE seq at -16 dBm0 | +| `ITU_EchoSpectral` | P1110/P1120 11.11.3 | Spectral echo attenuation below mask at any time (8k FFT @ 48 kHz vs reference PSD) | WB mask: 100 Hz:-41, 1300:-41, 3450:-46, 5200:-46, 7500:-37, 8000:-37 dB; P1120 adds 12500:-37; NB mask (P1100 11.11.3): 100:-20, 200:-30, 300:-38, 800:-34, 1500:-33, 2600:-24, 4000:-24 | **mask - 6 dB** everywhere | [ALGO] | 10 s CSS training then periodic CSS (4 periods = 1.4 s), -16 dBm0 | +| `ITU_ConvergenceQuiet` | P1110 11.11.4 / P1120 11.11.4 (P1100 11.11.4: 40 dB from 1200 ms) | Initial convergence from activation, quiet, max volume: ERL-vs-time above the Figure 11-5/11-7 mask | ~6 dB allowed 0-200 ms rising (log t) to **>= 40 dB at 1200 ms**, held to 5000 ms | **>= 40 dB by 600 ms** AND >= 46 dB at 1200 ms | [ALGO] | Periodic CSS at -16 dBm0, >= 5 s, 35 ms integration | +| `ITU_ConvergenceNoise` | P1110 11.11.5 / P1120 11.11.5 (P1100 11.11.5) | Initial convergence with background noise: echo <= BGN+10 dB until 100 ms, decaying (log t) to <= BGN at 1500 ms | mask as stated | **<= BGN by 750 ms** | [ALGO] | CSS / BE seq at -16 dBm0; noise >= 5 s pre-roll | +| `ITU_TimeVariantPath` | P1110 11.11.6/11.11.7 / P1120 11.11.6 | Echo under a time-varying echo path shall not degrade beyond limit (converged first) | P1110: increase **<= 6 dB** vs steady state; P1120: absolute **< -52 dBm0(A)** | <= 3 dB / < -58 dBm0(A) | [ALGO] | CSS -5/-25 dBm0 + BE seq -16 dBm0 over a time-varying IR (rotating-reflector analogue) | + +### Switching characteristics (P1110 11.11.8 / P1120 11.12) + +| Row ID | Clause | Requirement | Required | Margin target | Tag | Signal | +|---|---|---|---|---|---|---| +| `ITU_ActivationSend` | P1110 11.11.8.1 / P1120 11.12.1 | Minimum activation level in send; build-up time | L_S,min **<= -20 dBPa** (MRP); T_r **<= 50 ms** | activation at -26 dBPa; T_r <= 25 ms | [ALGO] | CSS bursts 248.62/451.38 ms (P1120: word "five" 500/500 ms), +1 dB steps, 5 ms integration | +| `ITU_ActivationReceive` | P1110 11.11.8.2 / P1120 11.12.2 | Minimum activation level in receive; build-up time | L_R,min **<= -35.7 dBm0**; T_r **<= 50 ms** | activation at -41.7 dBm0; T_r <= 25 ms | [ALGO] | as above, receive direction | +| `ITU_AttenRangeSend` | P1110 11.11.8.3 / P1120 11.12.3 | Attenuation range in send when switching from receive-active | A_H,S **< 20 dB**; T_r,S **< 50 ms** (rec.: 13 dB down within 15 ms) | < 14 dB; T_r <= 25 ms | [ALGO] | CSS activation + voiced sound, 5 ms integration | +| `ITU_AttenRangeReceive` | P1110 11.11.8.4 / P1120 11.12.4 | Attenuation range in receive after send active | A_H,R **< 15 dB**; T_r,R **< 50 ms** (rec.: < 9 dB within 15 ms) | < 9 dB; T_r <= 25 ms | [ALGO] | mirror of above | + +### Double talk (P1110 11.12 / P1120 11.13) — target: P.340 Category 1 + +| Row ID | Clause | Requirement | Cat-1 bound | Margin target | Tag | Signal | +|---|---|---|---|---|---|---| +| `ITU_DtSendAtten` | P1110 11.12.1 / P1120 11.13.1 | Attenuation range in send during double talk (words AND sentences must both pass; level matrix: nominal, +6S/-6R, +6R/-6S, max volume) | A_H,S,dt **<= 3 dB** | <= 1.5 dB | [ALGO] | P.501 7.3.5 DT speech sequence; recv -16 dBm0, send -1.7 dBPa | +| `ITU_DtReceiveAtten` | P1110 11.12.2 / P1120 11.13.2 | Attenuation range in receive during double talk | A_H,R,dt **<= 3 dB** | <= 1.5 dB | [ALGO] | as above, competing speaker in receive | +| `ITU_DtEchoLoss` | P1110 11.12.3 / P1120 11.13.3 | Echo loss during double talk, met in EACH band 200 Hz-6950 Hz (comb-filter analysis; assumes far-end SLR+RLR = 10 dB) | **>= 27 dB** | >= 33 dB per band | [ALGO] | AM-FM orthogonal sine pair (P.501 7.2.4, Table 7-6 plan); send -25.7 dBPa HFRP, recv -16 dBm0 | +| `ITU_DtSentSpeech` | P1110 11.12.4 / P1120 11.13.4 | Sent-speech attenuation during double talk per band 200-6900 Hz (guards against fast switchers posing as duplex) | **<= 3 dB** | <= 1.5 dB | [ALGO] | AM-FM orthogonal pair, comb on send frequencies | + +### Comfort noise and noise pumping (P1110 11.13 / P1120 11.14) + +| Row ID | Clause | Requirement | Required | Margin target | Tag | +|---|---|---|---|---|---| +| `ITU_ComfortNoiseLevel` | P1110 11.13.6 / P1120 11.14.6 | Injected comfort noise level vs original transmitted background noise (A-weighted) | **+2 / -5 dB** | +1 / -2.5 dB | [ALGO] | +| `ITU_ComfortNoiseSpectrum` | same | Comfort noise spectral deviation within mask | +-12 dB (200-800 Hz), +-10 (800-2k), +-6 (2k-8k WB / 2k-14k SWB, 4k NB) | half-mask | [ALGO] | +| `ITU_NoisePumpFarEnd` | P1110 11.13.4 / P1120 11.14.4 | Send level variation during/after far-end CSS bursts in driving noise | **<= 10 dB** | <= 5 dB | [ALGO] | +| `ITU_NoisePumpNearEnd` | P1110 11.13.5 / P1120 11.14.5 | Send level variation during/after near-end CSS bursts in noise | **<= 10 dB** | <= 5 dB | [ALGO] | + +### Stability (P1110 Annex E / P1120 Appendix I) — MuTap's home turf + +| Row ID | Clause | Requirement | Margin target | Tag | +|---|---|---|---|---| +| `ITU_StabilitySweep` | P1110 Annex E / P1120 App. I | Far-end echo path = pure attenuation swept **50 -> 0 dB in 5 dB steps** at 0 ms delay (mandatory case; car IR = customized case), EC reset each run: NO howling/feedback; document the minimum far-end ERL that remains stable | stable at **0 dB far-end ERL** (the sweep's floor) — this is a closed-loop test and the AFC heritage applies directly | [ALGO] | + +### Listed, not claimed (automotive) + +- **[TERMINAL]** P1110/P1120 clause 7 physical test environment, HATS + positioning, driving-noise playback fidelity; 11.2 total round-trip + delay < 170 ms (the ALGORITHMIC latency contribution — block size — + is reported by `ITU_AlgorithmicDelay` below against the <= 70 ms + implementation budget); 12.x SRW-phone verification. +- **[MIXED, out of scope for this effort]** 11.13.3/11.14.3 + speech-quality-in-noise MOS (needs the ETSI TS 103 281 predictor — a + noise-reduction metric, not an echo metric) and 11.13.2/11.14.2 + Relative Approach analysis (Sottek hearing model). Marked explicitly + as not covered. +- **Out of scope (non-echo terminal clauses)**: P1110 10.x microphone + parameters, 11.3 loudness ratings, 11.4 frequency responses, 11.5/11.6 + speech quality/stability, 11.7 idle channel noise, 11.8 out-of-band, + 11.9/11.10 distortion; P1120 equivalents (11.3-11.10). + +## Tier A matrix — P.340 framework rows (05/2000) + +The automotive rows above already enforce P.340's Tables via their +category bounds; these rows pin the P.340-native items not repeated +there. Bracketed values are provisional in P.340 — noted per row. + +| Row ID | Clause | Requirement | Required | Margin target | Tag | +|---|---|---|---|---|---| +| `ITU_P340_BuildUpSingle` | 10.3.2.7 | Build-up time, single talk, either direction: onset to within [3 dB] | **<= [20 ms]** (provisional) | <= 10 ms | [ALGO] | +| `ITU_P340_BuildUpDouble` | 10.3.2.8 | Build-up time, double talk (if attenuation > 6 dB) | **< [20 ms]** (provisional) | <= 10 ms | [ALGO] | +| `ITU_P340_HangoverRecovery` | 10.3.2.10 | After a double-talk event (far-end continuous): echo attenuation at Sout | **>= [20 dB] within [1] s** (provisional) | >= 26 dB within 0.5 s | [ALGO] | +| `ITU_P340_VoiceSwitchBuildUp` | 4.6 | Voice-switch build-up time TR | **< 15 ms** (pref. < 10) | < 7.5 ms | [ALGO] | +| `ITU_P340_NoiseFluctuation` | Table 3 (7.11) | Transmitted background-noise level fluctuation | **<= +-3 dB** | <= +-1.5 dB | [ALGO] | +| `ITU_P340_Type1Transfer` | Table 5 (clause 9) | Behaviour-1 (full duplex) transfer function constant over time | **+-3 dB** in 1/12 octave | +-1.5 dB | [ALGO] | + +P.340 notes: it contains **no absolute single-talk TCLw number** (delegated +to P.341/P.342; the automotive 46 dB row governs here) and **no numeric +convergence limit** (the automotive 40-dB-by-1.2-s row governs). + +## Tier B matrix — G.168-adapted battery (04/2015) + +G.168 states its own scope plainly: it "does not cover acoustic echo +cancellation as per ITU-T P.340." This battery is therefore run as an +**adapted suite** — the tests' structure and pass criteria transplanted +onto acoustic paths — and reported as `G.168-adapted`, never as G.168 +compliance. Two adaptations are fixed up front: (1) G.168's echo-path +models m1-m8 are hybrid-derived, sparse, and short (dispersion <= 12 ms) +— they serve only as a regression floor; the primary paths are our room +and cabin RIRs. (2) G.168's ERL >= 6 dB convention maps to the acoustic +coupling loss of the simulated path. Levels use LRin,act (active-part +RMS, +1.49 dB over whole-CSS level for single-talk CSS, +1.66 dB for +double-talk CSS); measurement uses G.168's 35 ms level filter. + +| Row ID | G.168 test | Requirement (adapted) | Required | Margin target | Tag | +|---|---|---|---|---|---| +| `G168_Convergence` | 2A/2B (6.4.2.3) | Combined loss >= 6 dB at t0 and **>= 20 dB by 50 ms + td**; steady-state residual per Figure 9/11 (NLP on: LRET -70..-55 dBm0 over LRin -30..0; NLP off: LRES -55..-35 dBm0 by 10 s); re-convergence after an abrupt path change meets the same masks with no grace period | as stated | 20 dB by **25 ms + td**; steady-state 6 dB below the figure lines | [ALGO] | +| `G168_ConvergenceNoise` | 2C (6.4.2.3.3) | Convergence with Hoth noise at LRin-15 dB: converge within 1 s (NLP on, LRET <= LSgen); NLP-off mask relaxed to 5 dB at t0, max(LRin-LSgen-6, 17) dB by 1 s | as stated | converge by 0.5 s | [ALGO] | +| `G168_DtLowNearEnd` | 3A (6.4.2.4.1) | LOW near-end (LRin-15 dB) must NOT block adaptation: convergence within 5 s, LRES <= LSgen,act | as stated | within 2.5 s | [ALGO] | +| `G168_DtDivergence` | 3B (6.4.2.4.2) | Divergence during double talk bounded: residual <= Figure 11 + **10 dB** (near-end >= far-end) / + **3 dB** (near-end 6-30 dB below) | as stated | +5 dB / +1.5 dB | [ALGO] | +| `G168_DtConversation` | 3C (6.4.2.4.3) | Conversational alternation: no post-double-talk echo burst (peaks bounded by LSgen during the single-talk tail; LSgen+6 dB when double talk resumes); Figure 9 met 5 s after DT ends | as stated | peaks 6 dB inside the bounds | [ALGO] | +| `G168_LeakRate` | 4 (6.4.2.5) | After 2 minutes of silence, residual echo on signal return degraded <= **10 dB** vs steady state | as stated | <= 5 dB | [ALGO] | +| `G168_InfiniteERL` | 5A (6.4.2.6.1) | Echo path opened mid-call (ERL -> infinity): the filter must not regenerate phantom echo; combined loss keeps meeting the convergence mask | as stated | mask + 6 dB | [ALGO] | +| `G168_PathSwing` | 5B (6.4.2.6.2) | Coupling-loss swings (6-30 dB <-> >= 46 dB) re-converge to the masks each time | as stated | half-time re-convergence | [ALGO] | +| `G168_NarrowbandTones` | 6 (6.4.2.7) | 5 s DTMF-frequency tones (adaptation live) corrupt the filter by <= **10 dB** vs Figure 11 afterward | as stated | <= 5 dB | [ALGO] | +| `G168_ToneStability` | 7 (6.4.2.8) | 2-minute continuous single tone from reset: residual <= **0.83 x LRin - 30 dB** after 10 s, no divergence | as stated | 6 dB below the line | [ALGO] | +| `G168_ComfortNoise` | 9A/9B (6.4.2.10) | Comfort noise tracks the true background: **+-2 dB** on level steps (5/10 dB), **+-6 dB** through 170 s level ramps (-86 -> -20 dBm0) | as stated | +-1 dB / +-3 dB | [ALGO] | +| `G168_AcousticResidual` | 12 (6.4.2.13) | The standard's own acoustic scenario: three-phase path/ERL switch (A -> B = A-10 dB w/ different model -> A), no reset between phases; 2A masks apply per phase | as stated | 2A margin targets | [ALGO] | + +**Excluded as [LINE-ONLY]** (listed so "not covered" is explicit): +Test 8 (SS5/6/7 signalling-tone transparency), Test 10 (Group-3 fax / +V.21 handshake), Test 11 (tandem network ECs — no normative values), +Test 13 (low-bit-rate coder in the path), Test 14 (V-series modem BER), +Test 15 (PCM A/u-law DC offset), Tests 16A/16B (DTMF transparency). + +**Caveat carried into the proof notebook:** G.168 itself warns that CSS +is "a statistical approximation of real speech" and that Tests 3A/3B +results vary considerably with real speech across languages — one more +reason the Tier A double-talk rows (real-speech sequences where +obtainable) rank above this battery. + +## Tier C — G.167 historical rows (informative; withdrawn, values provisional) + +Run and reported, not claimed as compliance (the rec is withdrawn): +TCLwst >= [40] dB teleconference / [45] dB hands-free; TCLwdt >= [25]/[30] dB; +Ardt/Asdt <= 6 dB (unbracketed); Tic: >= [20 dB] within [1] s from reset; +Trdt: [20 dB] within [1] s after DT; TCLwpv >= [10 dB] during a [5] s path +variation; Trpv: [20 dB] within [1] s after it; NEC protection (6.3): +Sout >= [40 dB] below Rin after convergence unless double talk; processing +delay <= [2]-[16] ms per direction by application; attenuation distortion +<= +-1 dB (4.5). Owning test: `ITU_G167_Historical` (one test, several +assertions, margins per the global policy). Echo-path RTs for its +simulated rooms: 400 ms (teleconference), 500 ms (hands-free), 60 ms +(car) — these also parameterize the new cabin fixture family. + +## G.131 context (no rows) + +Echo control is required when one-way delay exceeds 25 ms (or per the +TELR/delay curves: acceptable TELR 33 dB at 25 ms, 47 dB at 100 ms; +f(x,y) >= 14 criterion). Returned echo from an echo-control device: +**< -65 dBm0** — adopted as the *stretch* target behind `ITU_EchoLevel`'s +margin. One informative row: `ITU_AlgorithmicDelay` reports the chain's +block latency against G.167's per-direction budgets and P.1110's 70 ms +implementation budget. + +--- + +## Simulation assets required (feeds Stage 1) + +**Signals (all generatable from P.501's algorithmic descriptions):** +- CSS single-talk, fullband: voiced 48.62 ms (literal sample table 7-1, + transcribed from the PDF we hold) + 200 ms PN (8192-point FFT variant — + P.501 mandates the long-PN variant for adaptive systems) + 101.38 ms + pause = 350 ms period, alternating polarity; crest 11 +- 1 dB. +- CSS double-talk: voiced 72.69 ms (table 7-2, different pitch) + 200 ms + Gaussian noise (crest 12 +- 1 dB) + 127.31 ms pause = 400 ms period + (the 350/400 ms slide generates all double-talk overlap states). +- Narrowband CSS + the two shaping filters (Figures 7-10/7-11 corner + tables); band-limiting filters per P.501 Table 7-7 (NB/WB/SWB). +- AM-FM orthogonal double-talk pair (7.2.4): f_fm = 1 Hz, mu_am = 2/3, + f_am = 3 Hz, Table 7-6 frequency plan; comb-filter analysis >= 8k FFT. +- Activation sequence: 500 ms token / 500 ms pause, +1 dB steps over + 21 dB (synthetic voiced token stands in for the word "five"). +- Level toolchain: P.56-style active-speech-level meter, dBm0/dBPa/dBov + calibration header, A-weighting filter, 35 ms / 5 ms level integrators. + +**Real-speech gap (flagged):** the BE single-talk sequence (7.3.2), the +DT speech sequence (7.3.5) and the compressed speech signal (7.3.3) are +ITU attachment WAV files — recordings, not formulas. Stage 1 attempts +download from the ITU test-signal database (itu.int is now allowlisted) +for LOCAL TEST USE with files git-ignored (no redistribution); where +unavailable, tests run on documented synthetic stand-ins (CSS/SSG per +P.501 7.2.5) and are marked `method-equivalent` rather than +`signal-exact` in the proof notebook. + +**Echo paths:** existing room fixtures; new car-cabin family (~2.5 m^3, +RT ~60 ms); time-varying IR (rotating-reflector analogue: a moving +early-reflection cluster); pure attenuation+delay paths for the +stability sweep; optional measured cabin IRs via `make_rir_fixtures.py`. + +**Noise:** driving-noise generator (low-frequency-heavy colored noise +with specified A-weighted level at the virtual mic; Annex C/D scenarios +are vehicle-specific recordings, so ours are labeled synthetic +analogues), Hoth-spectrum noise for the P.340 rows. + +## What Stage 2 (post-filter) must deliver, per this matrix + +- Residual echo below **-58 dBm0(A)** (margin: -64) on speech at + -16 dBm0 through a realistic path — linear cancellation alone measures + ~20-25 dB of suppression, so the suppressor supplies the rest without + violating `ITU_DtSendAtten`'s <= 1.5 dB near-end transparency target + (this pair of constraints IS the design problem). +- Comfort noise matched +1/-2.5 dB in level and half-mask in spectrum. +- Switching dynamics inside 25 ms build-up at the margin targets. +- No noise pumping beyond 5 dB around speech bursts. +- The chain's ERL trajectory above the convergence masks at 2x speed.