00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MFCC_H
00020 #define MFCC_H
00021
00022 #include "Typedefs.h"
00023 #include "Debug.h"
00024
00025 #include "MelBands.h"
00026 #include "DCT.h"
00027
00059 class MFCC {
00060 protected:
00061
00062 Real _lowFrequency;
00063 Real _highFrequency;
00064 int _bandCount;
00065 Real _samplerate;
00066 int _fftSize;
00067
00068 int _coefficientCount;
00069
00070 Real _minSpectrum;
00071 Real _power;
00072
00073
00074 MelBands _melbands;
00075 DCT _dct;
00076
00077 MatrixXR _bands;
00078 MatrixXR _coeffs;
00079
00080 public:
00104 MFCC(Real lowFrequency = 300.0, Real highFrequency = 16000.0, int bandCount = 40.0, Real samplerate = 44100.0, int fftSize = 1024, int coefficientCount = 13, Real minSpectrum = 1e-10, Real power = 1.0);
00105
00109 ~MFCC();
00110
00111 void reset();
00112 void setup();
00113
00128 void process(const MatrixXR& spectrums, MatrixXR* mfccCoefficients);
00129
00136 int coefficientCount() const;
00137
00144 void setCoefficientCount( int count, bool callSetup = true );
00145
00152 int bandCount() const;
00153
00159 void setBandCount( int count, bool callSetup = true );
00160
00167 Real lowFrequency() const;
00168
00175 void setLowFrequency( Real frequency, bool callSetup = true );
00176
00183 Real highFrequency() const;
00184
00191 void setHighFrequency( Real frequency, bool callSetup = true );
00192
00199 Real samplerate() const;
00200
00206 void setSamplerate( Real frequency, bool callSetup = true );
00207
00214 int fftSize() const;
00215
00222 void setFftSize( int size, bool callSetup = true );
00223
00230 Real power() const;
00231
00237 void setPower( Real factor, bool callSetup = true );
00238
00239 };
00240
00241 #endif