math-rir
Room Impulse Response analysis using the SSIR (Spatial Segmentation of Impulse Response) method.
Based on: Pawlak & Lee, "Spatial segmentation of impulse response for room reflection analysis and auralization", Applied Acoustics 249 (2026).
What it does
Segments a measured Room Impulse Response (RIR) into consecutive, variable-length sound events (direct sound + early reflections), each with a constant direction of arrival (DOA). This preserves the full temporal energy profile while enabling per-reflection analysis and manipulation.
Key algorithms
- Direct sound onset detection (Algorithm 1 from paper): log-magnitude peak detection with 11 dB threshold
- Local Energy Ratio reflection detection: 1ms analysis windows, median energy threshold, DOA/TOA validation
- Onset refinement: per-segment onset detection within pre-onset windows
- Mixing time estimation: Abel & Huang echo density method
API
use ;
// Mono RIR (energy-based detection only)
let result = analyze_rir;
// B-format SRIR (full DOA estimation + validation)
let result = analyze_srir;
println!;
Used by
sotf-plugin-binaural: SSIR-analyzed measured room reflections with per-reflection HRTFautoeq/roomeq: SSIR-informed correction weights for room EQ optimization