pub struct Spectrogram {
pub mags_sqr: Vec<f32>,
pub n_time: usize,
pub n_freq: usize,
pub t_step: usize,
pub nsps: usize,
pub df: f32,
pub noise_per_bin: f32,
}Expand description
FFT-bin spectrogram covering the audio buffer at half-symbol
time steps. mags_sqr[t * n_freq + f] is |FFT[f]|² at time t.
Fields§
§mags_sqr: Vec<f32>§n_time: usize§n_freq: usize§t_step: usize§nsps: usize§df: f32§noise_per_bin: f32Implementations§
Source§impl Spectrogram
impl Spectrogram
Sourcepub fn build_for<P: ModulationParams>(audio: &[f32], sample_rate: u32) -> Self
pub fn build_for<P: ModulationParams>(audio: &[f32], sample_rate: u32) -> Self
Build the spectrogram from audio for Q65 sub-mode P. Time
step = nsps / 2 (match NSTEP_PER_SYMBOL = 2); frequency
resolution = sample_rate / nsps ≈ tone spacing.
Sourcepub fn build(audio: &[f32], sample_rate: u32) -> Self
pub fn build(audio: &[f32], sample_rate: u32) -> Self
Q65-30A convenience wrapper for Self::build_for.
pub fn get(&self, t: usize, f: usize) -> f32
Auto Trait Implementations§
impl Freeze for Spectrogram
impl RefUnwindSafe for Spectrogram
impl Send for Spectrogram
impl Sync for Spectrogram
impl Unpin for Spectrogram
impl UnsafeUnpin for Spectrogram
impl UnwindSafe for Spectrogram
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
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