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