pub struct RirSegment {
pub onset_sample: usize,
pub end_sample: usize,
pub toa_sample: usize,
pub doa: Option<[f32; 3]>,
pub peak_energy: f64,
pub is_direct_sound: bool,
}Expand description
A single segment of the RIR identified by SSIR analysis.
Each segment represents a discrete acoustic event (direct sound or early reflection) with a constant direction of arrival (DOA). Segments are consecutive — the end of one segment is the onset of the next, preserving the full temporal energy profile.
Fields§
§onset_sample: usizeStart sample of this segment (onset)
end_sample: usizeEnd sample (exclusive) — equals the next segment’s onset, or mixing time for the last segment
toa_sample: usizeSample index of the peak arrival (TOA) within this segment
doa: Option<[f32; 3]>Direction of arrival as a unit vector [x, y, z], if available from multi-channel input
peak_energy: f64Peak energy (squared amplitude) at the TOA sample
is_direct_sound: boolWhether this segment contains the direct sound
Implementations§
Source§impl RirSegment
impl RirSegment
Sourcepub fn duration_secs(&self, sample_rate: f64) -> f64
pub fn duration_secs(&self, sample_rate: f64) -> f64
Duration of this segment in seconds
Sourcepub fn duration_ms(&self, sample_rate: f64) -> f64
pub fn duration_ms(&self, sample_rate: f64) -> f64
Duration of this segment in milliseconds
Sourcepub fn toa_ms(&self, sample_rate: f64) -> f64
pub fn toa_ms(&self, sample_rate: f64) -> f64
Time of arrival relative to the RIR start, in milliseconds
Sourcepub fn azimuth_deg(&self) -> Option<f32>
pub fn azimuth_deg(&self) -> Option<f32>
DOA azimuth in degrees (0 = front, positive = left), if DOA is available. Computed from the x,y components of the DOA unit vector.
Sourcepub fn elevation_deg(&self) -> Option<f32>
pub fn elevation_deg(&self) -> Option<f32>
DOA elevation in degrees, if DOA is available. Computed from the z component of the DOA unit vector.
Trait Implementations§
Source§impl Clone for RirSegment
impl Clone for RirSegment
Source§fn clone(&self) -> RirSegment
fn clone(&self) -> RirSegment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RirSegment
impl RefUnwindSafe for RirSegment
impl Send for RirSegment
impl Sync for RirSegment
impl Unpin for RirSegment
impl UnsafeUnpin for RirSegment
impl UnwindSafe for RirSegment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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