code wiki / (root) / nx_audio_enhance.nx

nx_audio_enhance.nx

buildroot/runtime/nx_audio_enhance.nx

3489 B80 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind librarytopic audio
docsdependenciesstructsconstsfunctions

about

nx_audio_enhance.nx -- sovereign AUDIO ENHANCEMENT for the call mic path: AGC (auto gain control -> boosts a quiet/bad mic to a healthy level, with a hard limiter so it never clips) + an adaptive VAD NOISE GATE (estimates the noise floor, attenuates frames that are just background hiss between speech). This is the "top-of-the-line audio even with a bad mic" path, pure Nishi -- the browser only ferries raw PCM; ALL DSP is here. Operates on signed PCM samples in an i64 array (-32767..32767). Spectral subtraction via nx_fft = the next rung (in-speech denoise); this rung delivers the two biggest bad-mic wins (level + background gating). license_tier: ORIGINAL

dependencies 0 imports · 1 importers

nx_audio_enhance.nx nx_audio_enhance_gate.nx

imports: none

imported by: nx_audio_enhance_gate.nx

structs

none

consts

8const AE_FULL: i64 = 32767

functions

11func ae_isqrt(v: i64) -> i64
called by 1: ae_rms
20func ae_rms(s: *i64, n: i64) -> i64
called by 2: ae_agcmain calls 1: ae_isqrt
28func ae_frame_energy(s: *i64, base: i64, FL: i64) -> i64
called by 1: ae_noise_gate
36func ae_agc(s: *i64, n: i64, target_rms: i64, max_gain100: i64) -> i64
called by 2: ae_enhancemain calls 1: ae_rms
55func ae_noise_gate(s: *i64, n: i64, FL: i64, div: i64, att100: i64) -> i64
called by 2: ae_enhancemain calls 1: ae_frame_energy
77func ae_enhance(s: *i64, n: i64, FL: i64, target_rms: i64, max_gain100: i64) -> i64