Skip to content

ITU compliance Stage 1: the calibrated signal layer#6

Merged
tap merged 2 commits into
mainfrom
claude/itu-stage1-signals
Jul 16, 2026
Merged

ITU compliance Stage 1: the calibrated signal layer#6
tap merged 2 commits into
mainfrom
claude/itu-stage1-signals

Conversation

@tap

@tap tap commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Was stacked on #5 (the Rev 5 plan + Stage 0 matrix); now rebased onto main after #5's merge, so this PR shows Stage 1 only: two commits — the signal layer, then the multi-rate amendment.

The instruments and stimuli the compliance suite will run on, everything validated measured-first (tests/test_itu_signals.cpp, 15 tests; the file header carries every measured number). Full suite green, clang-format/tidy clean.

tests/support/itu_levels.h — the calibration plane

One documented mapping between the recs' units (dBm0 / dBPa / dBov) and the simulation's linear float domain; prewarped-bilinear A-weighting (spot gains −19.18 / 0.00 / −1.76 dB at 100 Hz / 1 kHz / 10 kHz, inside the IEC class-1 envelope); the 35 ms and 5 ms level integrators plus G.168's sliding-window peak; a P.56-style active-speech-level meter (definitionally consistent on sparse speech: activity 0.312 with level delta exactly 10·log10(1/activity)).

tests/support/itu_signals.h — the stimuli

  • CSS single/double-talk generated from P.501's algorithmic descriptions, with the Table 7-1/7-2 voiced segments transcribed from the rec text (134/229 samples, column-major) — sample-exact framing (350/400 ms periods), 8192-point adaptive-systems PN (crest 10.97 dB, spec 11 ± 1; bin-flat spectrum), polarity alternation, exact level calibration. No ITU signal files are redistributed.
  • P.501 Figure 7-10/7-11 shaping filters and Table 7-7 band limiters (NB: −85 dB at 4 kHz).
  • The AM-FM orthogonal double-talk pair + comb analysis: 94.3 dB separation at the spec's exact band edges — the measurement floor for the double-talk echo-loss rows sits far beyond the ≥ 33 dB margin targets. (The test records the trap: adding any guard band collapses the floor to 19 dB via the send-250/receive-270 adjacency.)
  • Activation sequence, Hoth noise, synthetic driving-noise analogue (labeled as such), and the moving-reflector time-variant path helper (plus echo_sim::set_echo_path to drive it).

tests/fixtures/rir_cabin.h — the automotive echo path

Image-source cabin (~2.6 m³), RT60 66.6 ms (G.167's car figure: ~60 ms typical). The existing fixture rooms were verified bit-reproducible with the installed pyroomacoustics before generating, and the generator gained an --only flag so committed baselines are never regenerated incidentally.

Sample-rate policy (revised in this PR per Tim's directive)

48 kHz and 16 kHz are REQUIRED operating rates; 44.1 kHz stays the P.501-native reference (CSS framing is sample-exact there without conversion). The bridge is the P.501 NOTE 2 resampler, built and measured in the second commit: passband ripple ≤ 0.014 dB (spec < 0.2), alias rejection 101 dB (spec > 60); the formula generators take fs directly and make_css_at() emits sample-exact periods at every required rate (15435 / 16800 / 5600 samples per 350 ms at 44.1 / 48 / 16 kHz).

Carry-forwards recorded in the matrix

The ITU real-speech attachment WAVs (P.501 7.3.2/7.3.3/7.3.5) remain to be procured into git-ignored tests/data/itu/; affected rows run method-equivalent on CSS/AM-FM until then.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TLE2rvptWxV8catE8vTvgx

claude added 2 commits July 16, 2026 14:11
The instruments and stimuli the compliance suite will run on, validated
measured-first (test_itu_signals.cpp, 12 tests; every number in the
file header):

- tests/support/itu_levels.h: the dBov/dBm0/dBPa calibration plane,
  prewarped-bilinear A-weighting (spot gains -19.18/0.00/-1.76 dB at
  100/1k/10k), 35/5 ms integrators, sliding-window peak, P.56-style
  active-speech-level meter (definitionally consistent on sparse
  speech).
- tests/support/itu_signals.h: CSS single/double-talk generated from
  P.501's algorithmic descriptions with the Table 7-1/7-2 voiced
  segments transcribed from the rec text (sample-exact framing at the
  native 44.1 kHz rate — a Stage 1 decision, matrix updated), 8192-pt
  adaptive-systems PN (crest 10.97 dB, bin-flat), shaping and Table 7-7
  band-limit filters (NB -85 dB at 4 kHz), the AM-FM orthogonal
  double-talk pair with comb analysis (94.3 dB separation at the
  spec's exact band edges), activation sequence, Hoth + synthetic
  driving noise, moving-reflector time-variant path helper (plus
  echo_sim::set_echo_path to drive it).
- tests/fixtures/rir_cabin.h: the automotive echo path (image-source,
  ~2.6 m^3, RT60 66.6 ms per G.167's car figure). Existing fixtures
  verified bit-reproducible before generating; --only flag added to
  the generator so committed baselines are never touched.

No ITU signal files are redistributed; the real-speech attachment WAVs
remain to be procured into git-ignored tests/data/itu/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLE2rvptWxV8catE8vTvgx
Per Tim's directive the compliance matrix now REQUIRES 48 kHz (MuTap's
rate, the automotive recs' specified analysis rate, and where the RIR
fixtures are exact) and 16 kHz (the wideband telephony rate) alongside
the 44.1 kHz P.501-native reference. The bridge is the P.501 NOTE 2
resampler, built and measured: passband ripple <= 0.014 dB (spec
< 0.2), alias rejection 101 dB at 16 kHz output (spec > 60). The CSS
period stays sample-exact at every required rate (15435 / 16800 / 5600
samples per 350 ms); make_css_at() emits per-rate CSS, and the
formula-based generators (AM-FM, noise, activation, band limits,
moving reflector) take fs directly. Measured at the new rates: PN
crest 11.86 / 11.44 dB (spec 11 +- 1), AM-FM comb separation
94.0 / 92.6 dB. Three new ItuRates tests; matrix + HANDOFF updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLE2rvptWxV8catE8vTvgx
@tap tap force-pushed the claude/itu-stage1-signals branch from dcb2254 to a223fb4 Compare July 16, 2026 14:11
@tap tap merged commit ade4b4e into main Jul 16, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants