MFCC class
Class to extract MFCC features from a signal.
There are 2 ways to use this class:
- Use the static method mfccFeats() to extract features from a signal.
- Intantiate MFCC to process frames on the go with processFrame() or processFrames().
MFCC are generated on each windows by:
- (Optional) Aplying pre-Emphasis
- Computing Spectrum
- Applying triangular filter in the MEL domain.
- Computing log for each band
- Applying Discrete Cosinus Transform
- (Optional) Replace first value by the window log-Energy.
Constructors
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
cancelStream(
) → void - Cancel streamSubscription and closes egress feature stream.
-
noSuchMethod(
Invocation invocation ) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
process_frame(
List< double> frame) → List< double> - Returns the MFCC values for the given frame
-
process_frames(
List< List< framesnum> >) → List< List< double> > - Returns the MFCC values of a list of frames
-
setStream(
Stream< List< audioInputnum> >) → StreamController< List< double> > -
Set input as Stream<List
>. Returns a StreamController<List > on which features will be pushed. audioInput
must provide frame of desired length. -
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
Object other ) → bool -
The equality operator. [...]
inherited
Static Methods
-
dct(
List< double> x,bool norm ) → List< double> - Returns the discrete cosinus transform. [...]
-
filterbanks(
int samplerate, int num_filt, int n_fft ) → List< List< double> > - Returns the mel filters [...]
-
mel_coefs(
List< double> power_spec,List< List< filtersdouble> >) → List< double> -
Maps the power spectrum over the mel
filters
to obtains a condensed spectrogram on the mel scale. -
mfccFeats(
List< num> signal,int sampleRate, int windowLength, int windowStride, int fftSize, int numFilters, int numCoefs, {bool energy: true, double preEmphasis: 0.97} ) → List< List< double> > -
Generates MFCC features from a
signal
. [...] -
power_spectrum(
List< double> frame,dynamic fft_size ) → List< double> -
Returns the power spectrum of a given
frame
. -
preEmphasis(
List< num> signal,double emphasisFactor, {num lastValue: 0.0} ) → List< double> - Apply preEmphasis filter on given signal.
-
splitSignal(
List< num> signal,int windowLength, int windowStride ) → List< List< num> >