pub struct MfccSource { /* private fields */ }Expand description
SpectrogramSource backed by the MFCC pipeline (mfcc).
Produces n_mfcc bands. SpectrogramSource::center_frequencies returns
coefficient indices (0.0, 1.0, 2.0, …) since MFCC coefficients do not map
to specific centre frequencies.
Implementations§
Source§impl MfccSource
impl MfccSource
Sourcepub fn new(
sample_rate: f64,
stft_params: StftParams,
n_mels: NonZeroUsize,
params: MfccParams,
) -> Self
pub fn new( sample_rate: f64, stft_params: StftParams, n_mels: NonZeroUsize, params: MfccParams, ) -> Self
Create an MFCC source.
sample_rate– rate (Hz) the input signal is expected at.stft_params– STFT configuration used by the underlying mel spectrogram.n_mels– number of mel filter bands.params– MFCC parameters (coefficient count, C0 inclusion, liftering).
Sourcepub const fn params(&self) -> &MfccParams
pub const fn params(&self) -> &MfccParams
The MFCC parameters this source uses.
Trait Implementations§
Source§impl Clone for MfccSource
impl Clone for MfccSource
Source§fn clone(&self) -> MfccSource
fn clone(&self) -> MfccSource
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 moreSource§impl Debug for MfccSource
impl Debug for MfccSource
Source§impl<T: Sample> SpectrogramSource<T> for MfccSource
impl<T: Sample> SpectrogramSource<T> for MfccSource
Source§fn compute_matrix(&mut self, samples: &[T]) -> SpectrogramResult<Array2<T>>
fn compute_matrix(&mut self, samples: &[T]) -> SpectrogramResult<Array2<T>>
Source§fn center_frequencies(&self) -> Vec<f64>
fn center_frequencies(&self) -> Vec<f64>
Centre frequency (Hz) of each band, low→high. Length equals
Self::n_bands.Source§fn sample_rate(&self) -> f64
fn sample_rate(&self) -> f64
Sample rate (Hz) the source expects its input to be at.
Source§fn hop_seconds(&self) -> f64
fn hop_seconds(&self) -> f64
Seconds between successive frames (
hop_size / sample_rate).Auto Trait Implementations§
impl Freeze for MfccSource
impl RefUnwindSafe for MfccSource
impl Send for MfccSource
impl Sync for MfccSource
impl Unpin for MfccSource
impl UnsafeUnpin for MfccSource
impl UnwindSafe for MfccSource
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