Skip to main content

SsirConfig

Struct SsirConfig 

Source
pub struct SsirConfig {
Show 13 fields pub sample_rate: f64, pub direct_sound_window_ms: (f64, f64), pub ler_window_ms: f64, pub energy_threshold: f64, pub doa_threshold_deg: f64, pub toa_threshold_ms: f64, pub min_segment_ms: f64, pub mixing_time_ms: Option<f64>, pub onset_window_ms: f64, pub final_segment_ms: f64, pub min_peak_distance_ms: f64, pub doa_bandpass_hz: (f64, f64), pub doa_bandpass_order: u32,
}
Expand description

Configuration for SSIR (Spatial Segmentation of Impulse Response) analysis.

Default values correspond to the SSIR-Mk2 configuration from Pawlak & Lee (Applied Acoustics 249, 2026), Table 1.

Fields§

§sample_rate: f64

Sample rate in Hz

§direct_sound_window_ms: (f64, f64)

Direct sound window: (pre, post) in ms relative to detected onset. Reflections within this window are excluded from detection. Default: (0.5, 3.5) — the direct sound typically occupies ~4ms.

§ler_window_ms: f64

Local Energy Ratio analysis window length in ms. The RIR is divided into consecutive windows of this length. Default: 1.0 ms (48 samples @ 48kHz).

§energy_threshold: f64

Energy threshold as a multiple of the per-window median energy. A sample is considered a reflection candidate if its energy exceeds this multiple of the window’s median energy. Default: 3.0

§doa_threshold_deg: f64

Minimum angular distance (degrees) between consecutive reflections for them to be considered distinct events. Pairs below this threshold are merged. Default: 9.0 degrees. Only used with multi-channel (SRIR) input.

§toa_threshold_ms: f64

Minimum time-of-arrival difference (ms) between consecutive reflections. Pairs closer than this are merged regardless of DOA. Default: 0.5 ms.

§min_segment_ms: f64

Minimum segment duration (ms) for early reflections. Segments shorter than this are merged with the preceding segment. Default: 0.5 ms.

§mixing_time_ms: Option<f64>

Mixing time in ms (boundary between early reflections and reverberant tail). If None, estimated automatically from the Schroeder decay curve. Default: None (auto-estimate, typical values: 30-50ms for small rooms).

§onset_window_ms: f64

Pre-onset window length (ms) for refining segment boundaries. For each detected reflection, the onset is searched within [TOA - onset_window_ms, TOA]. Default: 0.5 ms.

§final_segment_ms: f64

Duration (ms) of the optional final segment after the last detected event. Default: 2.0 ms.

§min_peak_distance_ms: f64

Minimum peak distance (ms) for direct sound onset detection. Peaks closer than this are suppressed when searching for the direct sound. Default: 0.1 ms (5 samples @ 48kHz).

§doa_bandpass_hz: (f64, f64)

Band-limiting frequency range (Hz) for DOA estimation from B-format channels.

The pseudo-intensity vector method is most reliable within a frequency band where spatial aliasing is low and wavelengths are short enough for directional resolution. Low frequencies have poor spatial resolution; high frequencies may alias depending on the microphone array.

Default: (500.0, 4000.0) — a commonly used range for first-order Ambisonics.

§doa_bandpass_order: u32

Butterworth filter order for DOA band-limiting.

Applied as a zero-phase (filtfilt) bandpass, so the effective order is doubled. Default: 4 (effective 8th-order after forward-reverse filtering).

Implementations§

Source§

impl SsirConfig

Source

pub fn new(sample_rate: f64) -> Self

Create a config with the given sample rate and all other values at defaults.

Trait Implementations§

Source§

impl Clone for SsirConfig

Source§

fn clone(&self) -> SsirConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SsirConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SsirConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.