comparison plugins/MFCCPlugin.h @ 45:5d7ce1d87301

* Add MFCC plugin * Add means output to Chromagram plugin * Update similarity plugin for MFCC changes
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 18 Jan 2008 13:30:56 +0000
parents
children dcf5800f0f00
comparison
equal deleted inserted replaced
44:1dc00e4dbae6 45:5d7ce1d87301
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 QM Vamp Plugin Set
5
6 Centre for Digital Music, Queen Mary, University of London.
7 All rights reserved.
8 */
9
10 #ifndef _MFCC_PLUGIN_H_
11 #define _MFCC_PLUGIN_H_
12
13 #include <vamp-sdk/Plugin.h>
14 #include <dsp/mfcc/MFCC.h>
15
16 #include <vector>
17
18 class MFCCPlugin : public Vamp::Plugin
19 {
20 public:
21 MFCCPlugin(float inputSampleRate);
22 virtual ~MFCCPlugin();
23
24 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
25 void reset();
26
27 InputDomain getInputDomain() const { return FrequencyDomain; }
28
29 std::string getIdentifier() const;
30 std::string getName() const;
31 std::string getDescription() const;
32 std::string getMaker() const;
33 int getPluginVersion() const;
34 std::string getCopyright() const;
35
36 ParameterList getParameterDescriptors() const;
37 float getParameter(std::string) const;
38 void setParameter(std::string, float);
39
40 size_t getPreferredStepSize() const;
41 size_t getPreferredBlockSize() const;
42
43 OutputList getOutputDescriptors() const;
44
45 FeatureSet process(const float *const *inputBuffers,
46 Vamp::RealTime timestamp);
47
48 FeatureSet getRemainingFeatures();
49
50 protected:
51 int m_bins; // == nceps is m_wantC0 false or nceps+1 if m_wantC0 true
52 bool m_wantC0;
53 float m_logpower;
54
55 void setupConfig();
56
57 MFCCConfig m_config;
58 MFCC *m_mfcc;
59 mutable size_t m_step;
60 mutable size_t m_block;
61
62 std::vector<double> m_binsums;
63 size_t m_count;
64
65 Feature normalize(const Feature &);
66 };
67
68
69 #endif