c@45: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@45: c@45: /* c@45: QM Vamp Plugin Set c@45: c@45: Centre for Digital Music, Queen Mary, University of London. c@135: c@135: This program is free software; you can redistribute it and/or c@135: modify it under the terms of the GNU General Public License as c@135: published by the Free Software Foundation; either version 2 of the c@135: License, or (at your option) any later version. See the file c@135: COPYING included with this distribution for more information. c@45: */ c@45: c@45: #ifndef _MFCC_PLUGIN_H_ c@45: #define _MFCC_PLUGIN_H_ c@45: c@45: #include c@45: #include c@45: c@45: #include c@45: c@45: class MFCCPlugin : public Vamp::Plugin c@45: { c@45: public: c@45: MFCCPlugin(float inputSampleRate); c@45: virtual ~MFCCPlugin(); c@45: c@45: bool initialise(size_t channels, size_t stepSize, size_t blockSize); c@45: void reset(); c@45: c@45: InputDomain getInputDomain() const { return FrequencyDomain; } c@45: c@45: std::string getIdentifier() const; c@45: std::string getName() const; c@45: std::string getDescription() const; c@45: std::string getMaker() const; c@45: int getPluginVersion() const; c@45: std::string getCopyright() const; c@45: c@45: ParameterList getParameterDescriptors() const; c@45: float getParameter(std::string) const; c@45: void setParameter(std::string, float); c@45: c@45: size_t getPreferredStepSize() const; c@45: size_t getPreferredBlockSize() const; c@45: c@45: OutputList getOutputDescriptors() const; c@45: c@45: FeatureSet process(const float *const *inputBuffers, c@45: Vamp::RealTime timestamp); c@45: c@45: FeatureSet getRemainingFeatures(); c@45: c@45: protected: c@45: int m_bins; // == nceps is m_wantC0 false or nceps+1 if m_wantC0 true c@45: bool m_wantC0; c@45: float m_logpower; c@45: c@45: void setupConfig(); c@45: c@45: MFCCConfig m_config; c@45: MFCC *m_mfcc; c@45: mutable size_t m_step; c@45: mutable size_t m_block; c@45: c@45: std::vector m_binsums; c@45: size_t m_count; c@45: c@45: Feature normalize(const Feature &); c@45: }; c@45: c@45: c@45: #endif