[][src]Struct aubio_rs::MFCC

pub struct MFCC { /* fields omitted */ }

MFCC object

Mel-Frequency Cepstrum Coefficients object.

This object computes MFCC coefficients on an input CVec.

The implementation follows the specifications established by Malcolm Slaney in its Auditory Toolbox, available online at the following address (see file mfcc.m):

https://engineering.purdue.edu/~malcolm/interval/1998-010/

Methods

impl MFCC[src]

pub fn new(
    buf_size: usize,
    n_filters: usize,
    n_coeffs: usize,
    sample_rate: u32
) -> Result<Self>
[src]

Create MFCC object

  • buf_size Size of analysis buffer (and length the FFT transform)
  • n_filters Number of desired filters
  • n_coeffs Number of desired coefficients
  • samplerate Audio sampling rate

pub fn with_power(self, power: f32) -> Self[src]

Set power parameter

pub fn with_scale(self, scale: f32) -> Self[src]

Set scaling parameter

pub fn with_mel_coeffs(self, fmin: f32, fmax: f32) -> Self[src]

Mel filterbank initialization

  • fmin Start frequency, in Hz
  • fmax End frequency, in Hz

The filterbank will be initialized with bands linearly spaced in the mel scale, from fmin to fmax.

pub fn with_mel_coeffs_htk(self, fmin: f32, fmax: f32) -> Self[src]

Mel filterbank initialization

  • fmin Start frequency, in Hz
  • fmax End frequency, in Hz

The bank of filters will be initalized to to cover linearly spaced bands in the Htk mel scale, from fmin to fmax.

pub fn with_mel_coeffs_slaney(self) -> Self[src]

Mel filterbank initialization (Auditory Toolbox's parameters)

The filter coefficients are built to match exactly Malcolm Slaney's Auditory Toolbox implementation. The number of filters should be 40.

This is the default filterbank when mf was created with n_filters = 40.

pub fn do_<'i, 'o, I, O>(&mut self, input: I, output: O) -> Status where
    I: Into<CVec<'i>>,
    O: Into<FVecMut<'o>>, 
[src]

MFCC object processing

  • in Input spectrum (buf_size long)
  • out Output mel coefficients buffer (n_coeffs long)

pub fn set_power(&mut self, power: f32)[src]

Set power parameter

pub fn get_power(&self) -> f32[src]

Get power parameter

pub fn set_scale(&mut self, scale: f32)[src]

Set scaling parameter

pub fn get_scale(&self) -> f32[src]

Get scaling parameter

pub fn set_mel_coeffs(&mut self, fmin: f32, fmax: f32)[src]

Mel filterbank initialization

  • fmin Start frequency, in Hz
  • fmax End frequency, in Hz

The filterbank will be initialized with bands linearly spaced in the mel scale, from fmin to fmax.

pub fn set_mel_coeffs_htk(&mut self, fmin: f32, fmax: f32)[src]

Mel filterbank initialization

  • fmin Start frequency, in Hz
  • fmax End frequency, in Hz

The bank of filters will be initalized to to cover linearly spaced bands in the Htk mel scale, from fmin to fmax.

pub fn set_mel_coeffs_slaney(&mut self)[src]

Mel filterbank initialization (Auditory Toolbox's parameters)

The filter coefficients are built to match exactly Malcolm Slaney's Auditory Toolbox implementation. The number of filters should be 40.

This is the default filterbank when mf was created with n_filters = 40.

Trait Implementations

impl Drop for MFCC[src]

Auto Trait Implementations

impl RefUnwindSafe for MFCC

impl !Send for MFCC

impl !Sync for MFCC

impl Unpin for MFCC

impl UnwindSafe for MFCC

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.