nx_signal_compensator.nx
buildroot/runtime/nx_signal_compensator.nx
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
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
| 62 | const NX_SIG_DOMAIN_TEMPORAL_AUDIO: i64 = 1 // time-domain audio |
| 63 | const NX_SIG_DOMAIN_TEMPORAL_VIBRATION: i64 = 2 // haptic, accel |
| 64 | const NX_SIG_DOMAIN_TEMPORAL_SCALAR: i64 = 3 // single-channel scalar (thermal, pressure) |
| 65 | const NX_SIG_DOMAIN_TEMPORAL_MULTICHANNEL: i64 = 4 // N-channel sensor array |
| 66 | const NX_SIG_DOMAIN_SPATIAL_VISUAL: i64 = 5 // image, display pixels |
| 67 | const NX_SIG_DOMAIN_SPATIO_TEMPORAL_VIDEO: i64 = 6 // frame sequence |
| 84 | const NX_SIG_COMP_NONE: i64 = 0 // disabled; pass-through |
| 85 | const NX_SIG_COMP_MINIMUM_PHASE_IIR: i64 = 1 // audio default, low-latency |
| 86 | const NX_SIG_COMP_LINEAR_PHASE_FIR: i64 = 2 // audio phase-preserving |
| 87 | const NX_SIG_COMP_REGULARIZED_INVERSE: i64 = 3 // Kirkeby-Nelson 1999 for |
| 89 | const NX_SIG_COMP_PARAMETRIC_EQ: i64 = 4 // biquad chain, lowest CPU |
| 90 | const NX_SIG_COMP_GAMMA_LUT_1D: i64 = 5 // visual: per-channel gamma |
| 91 | const NX_SIG_COMP_COLOR_MATRIX_3X3: i64 = 6 // visual: cross-channel gamut |
| 92 | const NX_SIG_COMP_3D_LUT: i64 = 7 // visual: full color transform |
| 93 | const NX_SIG_COMP_TIME_DELAY: i64 = 8 // scalar: response-time |
| 95 | const NX_SIG_COMP_POLYNOMIAL_LINEARIZE: i64 = 9 // scalar: nonlinear sensor |
| 114 | const NX_SIG_COMP_APPLIED: i64 = 0 |
| 115 | const NX_SIG_COMP_NOT_APPLIED_NO_CURVE: i64 = 1 // no response curve loaded |
| 116 | const NX_SIG_COMP_NOT_APPLIED_STALE_CURVE: i64 = 2 // curve > 90 days old |
| 117 | const NX_SIG_COMP_NOT_APPLIED_INSTABILITY: i64 = 3 // inverse would exceed headroom |
| 118 | const NX_SIG_COMP_NOT_APPLIED_DOMAIN_MISMATCH: i64 = 4 // wrong strategy for domain |
| 119 | const NX_SIG_COMP_NOT_APPLIED_DEPENDENCY_MISSING: i64 = 5 // PARTIAL_WIRED default |
functions
| 69 | func nx_sig_domain_name(d: i64) -> *u8 |
| 98 | func nx_sig_comp_strategy_name(s: i64) -> *u8 |
| 121 | func nx_sig_comp_verdict_name(v: i64) -> *u8 |
| 137 | func nx_signal_compensator_apply(samples_ptr: *u8, samples_len: i64, |
| 154 | func nx_signal_compensator_default_strategy_for_domain(domain: i64) -> i64 |
| 167 | func nx_signal_compensator_disable(txr_name_ptr: *u8, txr_name_len: i64) -> i64 |
| 177 | func nx_signal_compensator_get_post_correction_flatness_dB10(txr_name_ptr: *u8, |