bbc-vamp-plugins  1.0
Energy.h
1 
18 #ifndef _ENERGY_H_
19 #define _ENERGY_H_
20 
21 #include <cmath>
22 #include <vector>
23 #include <algorithm>
24 #include <vamp-sdk/Plugin.h>
25 
26 using std::string;
27 using std::vector;
28 
75 class Energy : public Vamp::Plugin
76 {
77 public:
79  Energy(float inputSampleRate);
80  virtual ~Energy();
81  string getIdentifier() const;
82  string getName() const;
83  string getDescription() const;
84  string getMaker() const;
85  int getPluginVersion() const;
86  string getCopyright() const;
87  InputDomain getInputDomain() const;
88  size_t getPreferredBlockSize() const;
89  size_t getPreferredStepSize() const;
90  size_t getMinChannelCount() const;
91  size_t getMaxChannelCount() const;
92  ParameterList getParameterDescriptors() const;
93  float getParameter(string identifier) const;
94  void setParameter(string identifier,
95  float value);
96  ProgramList getPrograms() const;
97  string getCurrentProgram() const;
98  void selectProgram(string name);
99  OutputList getOutputDescriptors() const;
100  bool initialise(size_t channels,
101  size_t stepSize,
102  size_t blockSize);
103  void reset();
104  FeatureSet process(const float *const *inputBuffers,
105  Vamp::RealTime timestamp);
106  FeatureSet getRemainingFeatures();
108 
109 protected:
111  int m_blockSize, m_stepSize;
113 
114  float sampleRate;
115  bool useRoot;
116  float threshRatio;
117  vector<float> rmsEnergy;
118  float prevRMS;
121  float dipThresh;
122 };
123 
124 
125 
126 #endif
float sampleRate
Definition: Energy.h:114
float prevRMS
Definition: Energy.h:118
float dipThresh
Definition: Energy.h:121
vector< float > rmsEnergy
Definition: Energy.h:117
float avgWindowLength
Definition: Energy.h:119
Calculates the RMS energy and related features.
Definition: Energy.h:75
float avgPercentile
Definition: Energy.h:120
float threshRatio
Definition: Energy.h:116
bool useRoot
Definition: Energy.h:115