pub struct BandLayout { /* private fields */ }Expand description
The 64-band log axis resolved against both analysis windows.
Pure: a function of the sample rate alone, built once at construction. Kept
separate from SpectrumAnalyzer so the layout’s properties are testable
without planning an FFT.
Implementations§
Source§impl BandLayout
impl BandLayout
Sourcepub fn new(sample_rate: u32) -> Self
pub fn new(sample_rate: u32) -> Self
Lay the axis out for sample_rate across the two shipped window sizes.
Sourcepub fn source(&self, band: usize) -> BandSource
pub fn source(&self, band: usize) -> BandSource
Where a band’s magnitudes come from.
Sourcepub fn crossover_band(&self) -> usize
pub fn crossover_band(&self) -> usize
First band that reads the short window.
Sourcepub fn crossover_hz(&self) -> f32
pub fn crossover_hz(&self) -> f32
Lower edge of the crossover band, in Hz.
Sourcepub fn starved(&self) -> usize
pub fn starved(&self) -> usize
Low bands the long window still cannot resolve — see Self::starved’s
field docs. Surfaced so the docs can quote a measurement.
Sourcepub fn band_for_freq(&self, hz: f32) -> usize
pub fn band_for_freq(&self, hz: f32) -> usize
The log-frequency band that contains hz: the last band whose lower
edge is at or below it.
Auto Trait Implementations§
impl Freeze for BandLayout
impl RefUnwindSafe for BandLayout
impl Send for BandLayout
impl Sync for BandLayout
impl Unpin for BandLayout
impl UnsafeUnpin for BandLayout
impl UnwindSafe for BandLayout
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
Mutably borrows from an owned value. Read more