code wiki / (root) / nx_signal_compensator.nx

nx_signal_compensator.nx

buildroot/runtime/nx_signal_compensator.nx

10318 B182 linesdepth 4pulls 4 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_signal_compensator.nx -- meta-level inverse-response DSP correction. module: nishi-core.perception.signal_compensator depends: nishi-core.perception.profile + nishi-core.perception.transducer_characterizer + nishi-core.io.syscalls disk_kb: 5 capability: PERCEPTION wired_status: PARTIAL_WIRED MISSING_CAPABILITIES: - RESPONSE_CURVE_LOAD (deserialize stored response from provenance store; queued, depends on nx_provenance_curve_store) - INVERSE_RESPONSE_COMPUTE (regularized inverse, handles unstable nulls in driver response per Kirkeby & Nelson 1999; queued, depends on nx_fft + Tikhonov regularization) - TEMPORAL_FILTER_DESIGN (FIR or minimum-phase IIR from inverse curve) - SPATIAL_FILTER_DESIGN (gamma LUT / color matrix for visual transducers) - REAL_TIME_APPLY_TEMPORAL (convolution at render time for audio + vibration) - REAL_TIME_APPLY_SPATIAL (LUT lookup at render time for visual) license_tier: PUBLIC_NISHI_SUBSTRATE genealogy_id: feedback-substrate-primitives-meta-not-one-off_2026 + feedback-substrate-does-heavy-lifting-user-is-partner-not-gate_2026 + feedback-multi-species-perceptual-substrate-not-anthropocentric_2026 + kirkeby_nelson_1999_inverse_filter_regularization + mourjopoulos_1994_digital_equalization_room_response + poynton_2003_gamma_correction + feedback-build-intelligence-never-strip-features Per cardinal [[feedback-substrate-primitives-meta-not-one-off]]: THIS primitive applies inverse-response compensation to ANY signal chain — not just audio rigs. Originally scoped as "rig_compensator" during dog perceptual test bring-up, promoted to meta-level when reuse across products surfaced. Reuse set served by this single primitive: - Audio pre-correction (dog perceptual test, dog toy, vet stethoscope, working-dog trainer, conservation recorder, beekeeping sensor) - Display gamma + gamut correction (Nishi /video output to species-aware displays)

dependencies 3 imports · 3 importers

nx_syscalls.nx nx_perceptual_profile.nx nx_transducer_characterizer.nx nx_signal_compensator.nx nx_codec_perceptual_grader.nx nx_haptic_render.nx nx_realism_score.nx

imports: nx_syscalls.nxnx_perceptual_profile.nxnx_transducer_characterizer.nx

imported by: nx_codec_perceptual_grader.nxnx_haptic_render.nxnx_realism_score.nx

structs

none

consts

62const NX_SIG_DOMAIN_TEMPORAL_AUDIO: i64 = 1 // time-domain audio
63const NX_SIG_DOMAIN_TEMPORAL_VIBRATION: i64 = 2 // haptic, accel
64const NX_SIG_DOMAIN_TEMPORAL_SCALAR: i64 = 3 // single-channel scalar (thermal, pressure)
65const NX_SIG_DOMAIN_TEMPORAL_MULTICHANNEL: i64 = 4 // N-channel sensor array
66const NX_SIG_DOMAIN_SPATIAL_VISUAL: i64 = 5 // image, display pixels
67const NX_SIG_DOMAIN_SPATIO_TEMPORAL_VIDEO: i64 = 6 // frame sequence
84const NX_SIG_COMP_NONE: i64 = 0 // disabled; pass-through
85const NX_SIG_COMP_MINIMUM_PHASE_IIR: i64 = 1 // audio default, low-latency
86const NX_SIG_COMP_LINEAR_PHASE_FIR: i64 = 2 // audio phase-preserving
87const NX_SIG_COMP_REGULARIZED_INVERSE: i64 = 3 // Kirkeby-Nelson 1999 for
89const NX_SIG_COMP_PARAMETRIC_EQ: i64 = 4 // biquad chain, lowest CPU
90const NX_SIG_COMP_GAMMA_LUT_1D: i64 = 5 // visual: per-channel gamma
91const NX_SIG_COMP_COLOR_MATRIX_3X3: i64 = 6 // visual: cross-channel gamut
92const NX_SIG_COMP_3D_LUT: i64 = 7 // visual: full color transform
93const NX_SIG_COMP_TIME_DELAY: i64 = 8 // scalar: response-time
95const NX_SIG_COMP_POLYNOMIAL_LINEARIZE: i64 = 9 // scalar: nonlinear sensor
114const NX_SIG_COMP_APPLIED: i64 = 0
115const NX_SIG_COMP_NOT_APPLIED_NO_CURVE: i64 = 1 // no response curve loaded
116const NX_SIG_COMP_NOT_APPLIED_STALE_CURVE: i64 = 2 // curve > 90 days old
117const NX_SIG_COMP_NOT_APPLIED_INSTABILITY: i64 = 3 // inverse would exceed headroom
118const NX_SIG_COMP_NOT_APPLIED_DOMAIN_MISMATCH: i64 = 4 // wrong strategy for domain
119const NX_SIG_COMP_NOT_APPLIED_DEPENDENCY_MISSING: i64 = 5 // PARTIAL_WIRED default

functions

69func nx_sig_domain_name(d: i64) -> *u8
98func nx_sig_comp_strategy_name(s: i64) -> *u8
121func nx_sig_comp_verdict_name(v: i64) -> *u8
137func nx_signal_compensator_apply(samples_ptr: *u8, samples_len: i64,
154func nx_signal_compensator_default_strategy_for_domain(domain: i64) -> i64
167func nx_signal_compensator_disable(txr_name_ptr: *u8, txr_name_len: i64) -> i64
177func nx_signal_compensator_get_post_correction_flatness_dB10(txr_name_ptr: *u8,