nx_lpc_autocorr.nx
buildroot/runtime/nx_lpc_autocorr.nx
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
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
| 20 | const K_MAGIC_1024: i64 = 1024 |
functions
| 22 | func nx_lpc_autocorr(s_pcm: *u8, n_samples: i64, |
| 67 | func nx_lpc_autocorr_test(scratch: *u8) -> i64 calls 1: nx_lpc_autocorr |