Skip to main content

SpectralMask

Struct SpectralMask 

Source
pub struct SpectralMask<const N: usize> {
    pub name: &'static str,
    /* private fields */
}
Expand description

A piecewise-linear spectral emission mask.

Fixed-capacity array of mask points, sorted by frequency. Supports MIL-STD-461G RE102 (2 MHz – 18 GHz), CE102 (10 kHz – 10 MHz), 3GPP TS 36.141 §6.3 ACLR, and ITU-R SM.1048-5 masks.

Fields§

§name: &'static str

Mask identifier (e.g., “RE102_ground”, “CE102”, “ACLR_E-UTRA”).

Implementations§

Source§

impl<const N: usize> SpectralMask<N>

Source

pub const fn empty(name: &'static str) -> Self

Create an empty mask.

Source

pub fn add_point(&mut self, freq_hz: f64, limit_db: f32) -> bool

Add a point. Returns false if mask is full.

Source

pub fn limit_at(&self, freq_hz: f64) -> Option<f32>

Interpolate the mask limit at a given frequency.

Returns None if the frequency is outside the mask range. Uses linear interpolation between adjacent points.

Source

pub fn len(&self) -> usize

Number of mask points.

Source

pub fn is_empty(&self) -> bool

Whether the mask is empty.

Source

pub fn deviation(&self, freq_hz: f64, measured_db: f32) -> Option<f32>

Compute the mask deviation residual: measured_db − limit_db.

Positive values indicate the measurement exceeds the mask (violation). Negative values indicate margin remains.

Auto Trait Implementations§

§

impl<const N: usize> Freeze for SpectralMask<N>

§

impl<const N: usize> RefUnwindSafe for SpectralMask<N>

§

impl<const N: usize> Send for SpectralMask<N>

§

impl<const N: usize> Sync for SpectralMask<N>

§

impl<const N: usize> Unpin for SpectralMask<N>

§

impl<const N: usize> UnsafeUnpin for SpectralMask<N>

§

impl<const N: usize> UnwindSafe for SpectralMask<N>

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> 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, 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.