pub struct Spectrogram {
pub sample_rate: u32,
pub fft_size: usize,
pub hop: usize,
pub bins: usize,
pub data: Vec<f32>,
}Expand description
A magnitude spectrogram: a column per time frame, each holding bins
frequency rows (row 0 = DC, row bins-1 = Nyquist), in decibels.
Fields§
§sample_rate: u32Source sample rate, Hz.
fft_size: usizeFFT size used (frequency resolution = sample_rate / fft_size).
hop: usizeHop between successive frames, in samples.
bins: usizeFrequency bins per frame (fft_size / 2 + 1).
data: Vec<f32>Row-major dB magnitudes laid out as data[frame * bins + bin].
Implementations§
Source§impl Spectrogram
impl Spectrogram
Sourcepub fn frame_time(&self, frame: usize) -> f32
pub fn frame_time(&self, frame: usize) -> f32
Start time (seconds) of a frame.
Trait Implementations§
Source§impl Clone for Spectrogram
impl Clone for Spectrogram
Source§fn clone(&self) -> Spectrogram
fn clone(&self) -> Spectrogram
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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