code wiki / _hdl_build / nx_audio_lossless_gate.nx
nx_audio_lossless_gate.nx
buildroot/runtime/_hdl_build/nx_audio_lossless_gate.nx
about
nx_audio_lossless_gate.nx -- MEASURES the two audio-SOTA claims the operator named ("audio where its
FLAC but with the dog hearing"): (1) LOSSLESS = bit-exact PCM round-trip through the sovereign LPC codec
(the FLAC guarantee: integer linear prediction + exactly-coded residuals, no quantization); (2) WIDE
SPECTRUM = a 30kHz "dog whistle" tone (human-inaudible >20kHz, dogs hear to ~45kHz) sampled at 96kHz
(Nyquist 48kHz) survives encode->decode UNFILTERED. Three signals stress all codec paths: a voice+
ultrasonic tone mix (the headline), a predictable ramp (the LPC-compresses path), and pseudo-random
noise (the raw-fallback path). GREEN iff EVERY signal round-trips bit-exact (max-err = 0) -- proven,
not asserted. Reports the compression ratio vs raw PCM (the FLAC comparison). If any max-err != 0 the
codec is NOT lossless and this goes RED (measure, don't assume). expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_video_client_wasm.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 13 | func aw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 14 | func an(v: i64) -> i64 |
| 21 | func sinei(k: i64) -> i64 |
| 28 | func wr_s16(pcm: *u8, i: i64, v: i64) -> i64 called by 1: main |
| 33 | func rd_s16(pcm: *u8, i: i64) -> i64 called by 1: roundtrip |
| 40 | func roundtrip(pcm: *u8, N: i64, out: *u8, back: *u8, scr: *i64, bytes_out: *i64) -> i64 |
| 59 | func main() -> i64 |