c@251: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@250: c@251: /* c@251: QM DSP Library c@250: c@251: Centre for Digital Music, Queen Mary, University of London. c@251: This file copyright 2005 Nicolas Chetry, copyright 2008 QMUL. c@251: All rights reserved. c@251: */ c@250: c@251: #ifndef MFCC_H c@251: #define MFCC_H c@251: c@251: #include "base/Window.h" c@251: c@251: struct MFCCConfig { c@251: int FS; c@251: int fftsize; c@251: int nceps; c@251: bool want_c0; c@251: }; c@251: c@251: class MFCC c@251: { c@251: public: c@251: MFCC(MFCCConfig config); c@251: virtual ~MFCC(); c@251: c@251: int process(int length, double *inframe, double *outceps); c@251: c@251: int getfftlength() const { return fftSize; } c@251: c@251: private: c@251: /* Filter bank parameters */ c@251: double lowestFrequency; c@251: int linearFilters; c@251: double linearSpacing; c@251: int logFilters; c@251: double logSpacing; c@251: c@251: /* FFT length */ c@251: int fftSize; c@251: c@251: int totalFilters; c@251: c@251: /* Misc. */ c@251: int samplingRate; c@251: int nceps; c@251: c@251: /* MFCC vector */ c@251: double *ceps; c@251: c@251: double **mfccDCTMatrix; c@251: double **mfccFilterWeights; c@251: c@251: /* The analysis window */ c@251: Window *window; c@251: c@251: /* For the FFT */ c@251: double* imagIn; // always zero c@251: double* realOut; c@251: double* imagOut; c@251: c@251: /* Set if user want C0 */ c@251: int WANT_C0; c@251: }; c@251: c@250: c@250: #endif c@250: