pub struct ModalRecord {
pub frequency_hz: f32,
pub amplitude_pa: f32,
pub decay_rate_s1: f32,
pub phase_rad: f32,
pub mode_shape_index: u32,
pub material_ref: u32,
pub excitation_index: u32,
}Expand description
Exact 32-byte wire record for mode 0x0104 (modal_resonance).
Fields§
§frequency_hz: f32§amplitude_pa: f32§decay_rate_s1: f32§phase_rad: f32§mode_shape_index: u32§material_ref: u32§excitation_index: u32Implementations§
Source§impl ModalRecord
impl ModalRecord
pub fn validate(&self, externally_valid: bool) -> Result<(), ProfileError>
pub fn decode( bytes: &[u8], externally_valid: bool, ) -> Result<Self, ProfileError>
pub fn encode_into( &self, out: &mut [u8], externally_valid: bool, ) -> Result<(), ProfileError>
Sourcepub fn damping_ratio(&self) -> Result<f64, ProfileError>
pub fn damping_ratio(&self) -> Result<f64, ProfileError>
Critical damping ratio zeta = d / (2 * pi * f).
Sourcepub fn t60_seconds(&self) -> Result<Option<f64>, ProfileError>
pub fn t60_seconds(&self) -> Result<Option<f64>, ProfileError>
Exact amplitude decay T60 = ln(1000) / d = 3*ln(10)/d (-60 dB amplitude and energy).
Returns Ok(None) when decay_rate_s1 == 0.0 (never +inf).
Sourcepub fn evaluate_at(&self, t_s: f64) -> Result<f64, ProfileError>
pub fn evaluate_at(&self, t_s: f64) -> Result<f64, ProfileError>
Evaluates damped sinusoidal response A * exp(-d * t) * sin(2 * pi * f * t + phi).
Trait Implementations§
Source§impl Clone for ModalRecord
impl Clone for ModalRecord
impl Copy for ModalRecord
Source§impl Debug for ModalRecord
impl Debug for ModalRecord
Source§impl PartialEq for ModalRecord
impl PartialEq for ModalRecord
impl StructuralPartialEq for ModalRecord
Auto Trait Implementations§
impl Freeze for ModalRecord
impl RefUnwindSafe for ModalRecord
impl Send for ModalRecord
impl Sync for ModalRecord
impl Unpin for ModalRecord
impl UnsafeUnpin for ModalRecord
impl UnwindSafe for ModalRecord
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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 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> ⓘ
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