code wiki / (root) / nx_sound.nx

nx_sound.nx

buildroot/runtime/nx_sound.nx

5146 B155 linesdepth 4pulls 5 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_sound.nx -- audio primitives (windowing + spectrogram). Building on V7 FFT. Ships the foundation for short-time spectral analysis -- the math that powers speech, music, and any temporal signal-frequency analysis. What this unlocks: + spectrogram (time x frequency intensity map) + voice activity detection (energy in voice band) + pitch detection (harmonic structure) + beat detection (periodic energy spikes) + room-tone characterization + noise vs signal discrimination All Q14 windows. Cosine table reused at 5-degree resolution; window precision +-2% (sufficient for most analysis tasks). genealogy_id: harris_1978_windowing + allen_rabiner_1977_stft lineage_id: windowed_short_time_fft

dependencies 2 imports · 1 importers

syscalls.nx nx_fft.nx nx_sound.nx nx_sound_test.nx

imports: syscalls.nxnx_fft.nx

imported by: nx_sound_test.nx

structs

none

consts

30const NX_SOUND_Q: i64 = 16384 // Q14

functions

34func nx_sound_cos_q10(deg_x5: i64) -> i64
57func nx_sound_hann_window(N: i64, win: *i64) -> i64
called by 2: nx_sound_stftmain calls 1: nx_sound_cos_q10
76func nx_sound_hamming_window(N: i64, win: *i64) -> i64
called by 1: main calls 1: nx_sound_cos_q10
95func nx_sound_apply_window(signal: *i64, win: *i64, N: i64) -> i64
called by 2: nx_sound_stftmain
108func nx_sound_frame_energy(signal: *i64, N: i64) -> i64
called by 1: main
126func nx_sound_stft(signal: *i64, sig_len: i64, N: i64, hop: i64,