nx_voiceprint.nx
buildroot/runtime/nx_voiceprint.nx
about
nx_voiceprint.nx -- VOICE-CLONE-001 rung 1: a sovereign SPEAKER-IDENTITY
descriptor ("voiceprint") extracted from a voice sample, plus a distance
metric that tells two voices apart.
A voice is a SOURCE (glottal pulses -> pitch, F0) driving a FILTER (the
vocal tract -> formants). A speaker's IDENTITY lives mostly in the FILTER:
the same person at a different pitch is still that person. LPC captures the
vocal-tract filter exactly; its REFLECTION coefficients (PARCOR) are a
compact, bounded (|k|<1), distance-friendly description of that filter.
The voiceprint = the average PARCOR vector over the VOICED frames of a
sample (voicing gated by nx_pitch) + the mean F0. Because we average only
voiced frames and identity rides in the PARCOR (not the pitch), the print is
pitch-invariant: the SAME speaker reading at 120 Hz vs 125 Hz prints nearly
identical, while a DIFFERENT vocal tract prints far away. That property is
the floor under voice DUPLICATION: capture who a speaker IS, separably from
what they happen to be saying or how high they happen to be speaking.
Composes (no reinvention): nx_lpc_autocorr (R[0..p]) -> nx_lpc_levinson
(PARCOR k in Q30) ; nx_pitch (voiced-frame gate + F0). Integer-only,
patent-clean.
Voiceprint buffer layout (caller-owned *i64, VP_WORDS words):
vp[0] = number of voiced frames averaged
vp[1] = mean F0 (Hz)
vp[2 .. 2+ORDER) = average reflection coeffs k[1..ORDER] in Q30
license_tier: ORIGINAL
module: nishi-core.audio.voiceprint
depends: nishi-core.audio.pitch, nishi-core.voice.lpc
capability: AUDIO_SPEAKER_IDENTITY
dependencies 4 imports · 6 importers
imports: nx_syscalls_x86_64.nxnx_lpc_autocorr.nxnx_lpc_levinson.nxnx_pitch.nx
imported by: nx_g2p_gate.nxnx_phoneme_synth_gate.nxnx_voice_clone_synth.nxnx_voice_clone_synth_gate.nxnx_voice_read_gate.nxnx_voiceprint_gate.nx
structs
| none |
consts
| 37 | const VP_ORDER: i64 = 10 |
| 38 | const VP_FRAME: i64 = 256 |
| 39 | const VP_HOP: i64 = 128 |
| 40 | const VP_FS: i64 = 8000 |
| 41 | const VP_MINLAG: i64 = 25 |
| 42 | const VP_MAXLAG: i64 = 114 |
| 43 | const VP_WORDS: i64 = 12 // 2 + VP_ORDER |
functions
| 46 | func _vp_i64(b: *u8, i: i64) -> i64 called by 1: nx_voiceprint_extract |
| 58 | func nx_voiceprint_extract(pcm: *u8, n_samples: i64, vp: *i64) -> i64 |
| 116 | func nx_voiceprint_distance(a: *i64, b: *i64) -> i64 |