annotate plugins/SimilarityPlugin.h @ 43:1389f05cb688

* Various fixes
author Chris Cannam <c.cannam@qmul.ac.uk>
date Wed, 16 Jan 2008 18:03:25 +0000
parents 0f85778f1b53
children 1dc00e4dbae6
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@42 17 class Chromagram;
c@41 18 class Decimator;
c@41 19
c@41 20 class SimilarityPlugin : public Vamp::Plugin
c@41 21 {
c@41 22 public:
c@41 23 SimilarityPlugin(float inputSampleRate);
c@41 24 virtual ~SimilarityPlugin();
c@41 25
c@41 26 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
c@41 27 void reset();
c@41 28
c@41 29 std::string getIdentifier() const;
c@41 30 std::string getName() const;
c@41 31 std::string getDescription() const;
c@41 32 std::string getMaker() const;
c@41 33 int getPluginVersion() const;
c@41 34 std::string getCopyright() const;
c@41 35
c@41 36 size_t getPreferredStepSize() const;
c@41 37 size_t getPreferredBlockSize() const;
c@41 38 InputDomain getInputDomain() const { return TimeDomain; }
c@41 39
c@41 40 size_t getMinChannelCount() const;
c@41 41 size_t getMaxChannelCount() const;
c@41 42
c@41 43 SimilarityPlugin::ParameterList getParameterDescriptors() const;
c@41 44 float getParameter(std::string param) const;
c@41 45 void setParameter(std::string param, float value);
c@41 46
c@41 47 OutputList getOutputDescriptors() const;
c@41 48
c@41 49 FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp);
c@41 50
c@41 51 FeatureSet getRemainingFeatures();
c@41 52
c@41 53 protected:
c@41 54 int getDecimationFactor() const;
c@41 55
c@42 56 enum Type {
c@42 57 TypeMFCC,
c@42 58 TypeChroma
c@42 59 };
c@42 60
c@42 61 void calculateBlockSize() const;
c@42 62
c@42 63 Type m_type;
c@41 64 MFCC *m_mfcc;
c@42 65 Chromagram *m_chromagram;
c@41 66 Decimator *m_decimator;
c@42 67 int m_featureColumnSize;
c@42 68 mutable size_t m_blockSize;
c@42 69 size_t m_fftSize;
c@41 70 int m_channels;
c@41 71
c@43 72 mutable int m_distanceMatrixOutput;
c@43 73 mutable int m_distanceVectorOutput;
c@43 74 mutable int m_meansOutput;
c@43 75 mutable int m_variancesOutput;
c@43 76
c@42 77 typedef std::vector<double> FeatureColumn;
c@42 78 typedef std::vector<FeatureColumn> FeatureMatrix;
c@42 79 typedef std::vector<FeatureMatrix> FeatureMatrixSet;
c@41 80
c@42 81 FeatureMatrixSet m_values;
c@41 82 };
c@41 83
c@41 84 #endif
c@41 85