code wiki / _hdl_build / nx_vq_train_gate.nx
nx_vq_train_gate.nx
buildroot/runtime/_hdl_build/nx_vq_train_gate.nx
about
nx_vq_train_gate.nx -- proves Lloyd's training (nx_vq_train) lowers VQ distortion at the SAME bitrate (better codebook
coverage), the bridge from raw VQ toward the neural codebook. Trains a K-entry codebook on T period-varied LPC
reflection vectors and measures total distortion before vs after training.
dependencies 5 imports · 0 importers
imports: nx_syscalls_x86_64.nxnx_lpc_autocorr.nxnx_lpc_levinson.nxnx_vq.nxnx_vq_train.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
| 10 | func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 11 | func g_pn(v: i64) -> i64 called by 1: main |
| 21 | func g_check(name: *u8, cond: i64) -> i64 |
| 25 | func st16(buf: *u8, idx: i64, v: i64) -> i64 { var x: i64 = v; if x < 0 { x = x + 65536 } buf[idx*2] = x & 0xff; buf[idx*2+1] = (x >> 8) & 0xff; return 0 } called by 1: fill_parabola |
| 26 | func ld64(buf: *u8, byteoff: i64) -> i64 { var v: i64 = 0; var b: i64 = 0; while b < 8 { v = v | (buf[byteoff + b] << (b*8)); b = b + 1 } return v } called by 1: main |
| 27 | func fill_parabola(s: *u8, n: i64, period: i64) -> i64 { var i: i64=0; while i<n { let p: i64 = i % period; st16(s, i, 40 + p*(period-p)*2); i=i+1 } return 0 } |
| 29 | func main() -> i64 |