annotate plugins/MelEnergy.h @ 84:e6815bf4a826

plugins/MelEnergy.{cpp,h}: add first draft for Mel Energy plugin
author Paul Brossier <piem@piem.org>
date Fri, 30 Jan 2015 16:49:13 +0100
parents
children b147d06397bc
rev   line source
piem@84 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
piem@84 2
piem@84 3 /*
piem@84 4 Vamp feature extraction plugins using Paul Brossier's Aubio library.
piem@84 5
piem@84 6 Copyright (C) 2006-2015 Paul Brossier <piem@aubio.org>
piem@84 7
piem@84 8 This file is part of vamp-aubio.
piem@84 9
piem@84 10 vamp-aubio is free software: you can redistribute it and/or modify
piem@84 11 it under the terms of the GNU General Public License as published by
piem@84 12 the Free Software Foundation, either version 3 of the License, or
piem@84 13 (at your option) any later version.
piem@84 14
piem@84 15 vamp-aubio is distributed in the hope that it will be useful,
piem@84 16 but WITHOUT ANY WARRANTY; without even the implied warranty of
piem@84 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
piem@84 18 GNU General Public License for more details.
piem@84 19
piem@84 20 You should have received a copy of the GNU General Public License
piem@84 21 along with aubio. If not, see <http://www.gnu.org/licenses/>.
piem@84 22
piem@84 23
piem@84 24 */
piem@84 25
piem@84 26 #ifndef _MELENERGY_PLUGIN_H_
piem@84 27 #define _MELENERGY_PLUGIN_H_
piem@84 28
piem@84 29 #include <vamp-sdk/Plugin.h>
piem@84 30 #include <aubio/aubio.h>
piem@84 31
piem@84 32 #include "Types.h"
piem@84 33
piem@84 34 class MelEnergy : public Vamp::Plugin
piem@84 35 {
piem@84 36 public:
piem@84 37 MelEnergy(float inputSampleRate);
piem@84 38 virtual ~MelEnergy();
piem@84 39
piem@84 40 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
piem@84 41 void reset();
piem@84 42
piem@84 43 InputDomain getInputDomain() const { return TimeDomain; }
piem@84 44
piem@84 45 std::string getIdentifier() const;
piem@84 46 std::string getName() const;
piem@84 47 std::string getDescription() const;
piem@84 48 std::string getMaker() const;
piem@84 49 int getPluginVersion() const;
piem@84 50 std::string getCopyright() const;
piem@84 51
piem@84 52 ParameterList getParameterDescriptors() const;
piem@84 53 float getParameter(std::string) const;
piem@84 54 void setParameter(std::string, float);
piem@84 55
piem@84 56 size_t getPreferredStepSize() const;
piem@84 57 size_t getPreferredBlockSize() const;
piem@84 58
piem@84 59 OutputList getOutputDescriptors() const;
piem@84 60
piem@84 61 FeatureSet process(const float *const *inputBuffers,
piem@84 62 Vamp::RealTime timestamp);
piem@84 63
piem@84 64 FeatureSet getRemainingFeatures();
piem@84 65
piem@84 66 protected:
piem@84 67 fvec_t *m_ibuf;
piem@84 68 aubio_pvoc_t *m_pvoc;
piem@84 69 cvec_t *m_ispec;
piem@84 70 aubio_filterbank_t *m_melbank;
piem@84 71 fvec_t *m_ovec;
piem@84 72
piem@84 73 size_t m_nfilters;
piem@84 74
piem@84 75 size_t m_stepSize;
piem@84 76 size_t m_blockSize;
piem@84 77 };
piem@84 78
piem@84 79
piem@84 80 #endif /* _MELENERGY_PLUGIN_H_ */