Skip to main content

Module hrir

Module hrir 

Source
Expand description

Q05 Mode 0x0103: HRIR / RIR FIR taps (taps * 4 B) & legacy Q4AU v3 SOFA preservation.

Strictly separates impulse sample rate (Schema 204 keys 17/18) from measurement acquisition cadence (Schema 3 keys 13/14), applies explicit per-receiver delays once relative to excitation origin, and performs lossless Q4AU v3 -> QAC v1 migration retaining unparsed original bytes (Schema 209).

Structs§

HrirChunkView
Zero-heap borrowed view over verified 0x0103 FIR tap records ([measurement][receiver][tap]).
HrirDocumentView
HrirWriteSpec
Static or temporally indexed HRIR/RIR payload specification.
ValidatedLegacyQ4auV3
Strictly validated Q4AU v3 legacy container parsed without assuming pointer alignment.

Functions§

convolve_hrir
Exact discrete FIR convolution for one receiver response (applying optional delay_samples once).
migrate_legacy_q4au_v3_hrir
Losslessly migrates a Q4AU v3 64-tap SOFA HRIR table to QAC v1 (mode 0x0103), preserving bit-exact original taps, per-ear ITD offsets, spherical directions, and exact unparsed original bytes (mode 0x0104 + Schema 209).
parse_legacy_q4au_v3
Parses and validates a legacy Q4AU v3 file, rejecting truncation, overlap, tap count mismatch, non-finite floats, and WASM32 multiplication overflow.
read_hrir_qac
Opens and fully validates mode 0x0103 HRIR/RIR entry + optional delays & legacy origin.
sample_delayed_impulse
Exact fractional-delay impulse interpolation oracle (y(t) at fractional sample idx_f).
tap_time_seconds
Exact tap arrival time in seconds relative to excitation origin: (delay_samples + tap_index) * (impulse_rate_den / impulse_rate_num). Applied ONCE.
write_hrir_qac
Writes canonical QAC v1 mode 0x0103 HRIR/RIR container (plus optional delays & positions 0x0107).