annotate plugins/SimilarityPlugin.h @ 41:b9fb6dee85f7

* Add similarity plugin
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 11 Jan 2008 18:18:45 +0000
parents
children 0f85778f1b53
rev   line source
c@41 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
c@41 2
c@41 3 /*
c@41 4 * SimilarityPlugin.h
c@41 5 *
c@41 6 * Copyright 2008 Centre for Digital Music, Queen Mary, University of London.
c@41 7 * All rights reserved.
c@41 8 */
c@41 9
c@41 10 #ifndef _SIMILARITY_PLUGIN_H_
c@41 11 #define _SIMILARITY_PLUGIN_H_
c@41 12
c@41 13 #include <vamp-sdk/Plugin.h>
c@41 14 #include <vamp-sdk/RealTime.h>
c@41 15
c@41 16 class MFCC;
c@41 17 class Decimator;
c@41 18
c@41 19 class SimilarityPlugin : public Vamp::Plugin
c@41 20 {
c@41 21 public:
c@41 22 SimilarityPlugin(float inputSampleRate);
c@41 23 virtual ~SimilarityPlugin();
c@41 24
c@41 25 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
c@41 26 void reset();
c@41 27
c@41 28 std::string getIdentifier() const;
c@41 29 std::string getName() const;
c@41 30 std::string getDescription() const;
c@41 31 std::string getMaker() const;
c@41 32 int getPluginVersion() const;
c@41 33 std::string getCopyright() const;
c@41 34
c@41 35 size_t getPreferredStepSize() const;
c@41 36 size_t getPreferredBlockSize() const;
c@41 37 InputDomain getInputDomain() const { return TimeDomain; }
c@41 38
c@41 39 size_t getMinChannelCount() const;
c@41 40 size_t getMaxChannelCount() const;
c@41 41
c@41 42 SimilarityPlugin::ParameterList getParameterDescriptors() const;
c@41 43 float getParameter(std::string param) const;
c@41 44 void setParameter(std::string param, float value);
c@41 45
c@41 46 OutputList getOutputDescriptors() const;
c@41 47
c@41 48 FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp);
c@41 49
c@41 50 FeatureSet getRemainingFeatures();
c@41 51
c@41 52 protected:
c@41 53 int getDecimationFactor() const;
c@41 54
c@41 55 MFCC *m_mfcc;
c@41 56 Decimator *m_decimator;
c@41 57 int m_K; // number of mfcc ceps inc DC
c@41 58 size_t m_blockSize;
c@41 59 int m_channels;
c@41 60
c@41 61 typedef std::vector<double> MFCCFeature;
c@41 62 typedef std::vector<MFCCFeature> MFCCFeatureVector;
c@41 63 typedef std::vector<MFCCFeatureVector> MFCCFeatureSet;
c@41 64
c@41 65 MFCCFeatureSet m_mfeatures;
c@41 66 };
c@41 67
c@41 68 #endif
c@41 69