code wiki / _hdl_build / nx_room_plc.nx

nx_room_plc.nx

buildroot/runtime/_hdl_build/nx_room_plc.nx

5277 B108 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic room
docsdependenciesstructsconstsfunctions

about

nx_room_plc.nx -- X-ROOM (overseas-grade): sovereign DETERMINISTIC audio PACKET-LOSS CONCEALMENT. The last line of defense: when a frame is lost BEYOND what FEC recovers (bursty overseas loss), synthesize a replacement instead of going silent. Pitch-repeat the last good period with a gentle energy decay -> a smooth, click-free fill; the naive alternative (zero-fill) drops a hole = an audible CLICK + silence gap. EXCEED axis (honest) vs zero/silence concealment: deterministic, audit-replayable waveform extrapolation that (1) reconstructs far closer to the true signal, (2) keeps energy up (not silent), (3) resumes more smoothly (smaller boundary jump). Sovereign, integer-exact. HONEST SCOPE: periodic-extrapolation PLC on a known pitch period; true pitch detection + LPC residual extrapolation (compose nx_nv1_lpc) = a deeper rung. main() is the SELF-VALIDATING GATE. Evidence -> knowledge/status/room_plc.log. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_room_plc.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap plc_fill plc_err pabs plc_energy pabs ↻ pabs ↻ pw sys_write pwn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close sys_exit

structs

none

consts

17const PLC_LOG: *u8 = "knowledge/status/room_plc.log"

functions

19func pw(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
20func pwn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
22func pabs(x: i64) -> i64 { if x < 0 { return 0 - x } return x }
26func plc_fill(sig: *i64, start: i64, L: i64, P: i64, atten: i64, mode: i64, out: *i64) -> i64
called by 1: main
41func plc_err(out: *i64, sig: *i64, start: i64, L: i64) -> i64
called by 1: main calls 1: pabs
47func plc_energy(out: *i64, L: i64) -> i64
called by 1: main calls 1: pabs
54func main() -> i64