code wiki / _hdl_build / nx_room_plc.nx
nx_room_plc.nx
buildroot/runtime/_hdl_build/nx_room_plc.nx
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
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
structs
| none |
consts
| 17 | const PLC_LOG: *u8 = "knowledge/status/room_plc.log" |
functions
| 19 | func 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 } |
| 20 | func 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 } |
| 22 | func pabs(x: i64) -> i64 { if x < 0 { return 0 - x } return x } |
| 26 | func plc_fill(sig: *i64, start: i64, L: i64, P: i64, atten: i64, mode: i64, out: *i64) -> i64 called by 1: main |
| 41 | func plc_err(out: *i64, sig: *i64, start: i64, L: i64) -> i64 |
| 47 | func plc_energy(out: *i64, L: i64) -> i64 |
| 54 | func main() -> i64 |