code wiki / (root) / nx_lpc_autocorr.nx

nx_lpc_autocorr.nx

buildroot/runtime/nx_lpc_autocorr.nx

3273 B82 linesdepth 3pulls 3 transitivereach 13 importersview sourcekind librarytopic lpc
docsdependenciesstructsconstsfunctions

about

nx_lpc_autocorr.nx -- integer-only autocorrelation R[0..p] of a speech frame. Foundation primitive for the Arc 1 voice codec ladder (see docs/NISHI_BITS_UP_EXCEED_INDUSTRY.md Arc 1 Phase A). Per [[feedback-bits-up-exceed-never-match]]: this is the math layer LPC uses; re-derived from the Wiener-Hopf / Yule-Walker formulation, patent-clean. Not MLow, not Lyra, not Opus. Spec: Input s[0..N-1] is i16 PCM samples (mono, 8 kHz or 16 kHz). Output R[0..p] is i64 sums of products (no scaling). R[k] = Σ_{n=k..N-1} s[n] * s[n-k] for k in 0..p Per-call cost: O((p+1) * N) multiplications + adds. For typical p=10 + N=320 (20 ms @ 16 kHz): ~3500 ops / frame = trivial CPU. Returns 0 on success, -1 if p > N (degenerate).

dependencies 1 imports · 6 importers

nx_syscalls_x86_64.nx nx_lpc_autocorr.nx nx_rvq_gate.nx nx_voice_codec_v2.nx nx_voice_v2_gate.nx nx_voiceprint.nx nx_vq_dred_gate.nx nx_vq_train_gate.nx

imports: nx_syscalls_x86_64.nx

imported by: nx_rvq_gate.nxnx_voice_codec_v2.nxnx_voice_v2_gate.nxnx_voiceprint.nxnx_vq_dred_gate.nxnx_vq_train_gate.nx

structs

none

consts

20const K_MAGIC_1024: i64 = 1024

functions

22func nx_lpc_autocorr(s_pcm: *u8, n_samples: i64,
67func nx_lpc_autocorr_test(scratch: *u8) -> i64
calls 1: nx_lpc_autocorr