bbc-vamp-plugins  1.0
SpectralFlux.h
1 
18 #ifndef _FLUX_H_
19 #define _FLUX_H_
20 
21 #include <cmath>
22 #include <complex>
23 #include <vector>
24 #include <vamp-sdk/Plugin.h>
25 
26 using std::string;
27 using std::vector;
28 using std::complex;
29 using std::abs;
30 
59 class SpectralFlux : public Vamp::Plugin
60 {
61 public:
63  SpectralFlux(float inputSampleRate);
64  virtual ~SpectralFlux();
65  string getIdentifier() const;
66  string getName() const;
67  string getDescription() const;
68  string getMaker() const;
69  int getPluginVersion() const;
70  string getCopyright() const;
71  InputDomain getInputDomain() const;
72  size_t getPreferredBlockSize() const;
73  size_t getPreferredStepSize() const;
74  size_t getMinChannelCount() const;
75  size_t getMaxChannelCount() const;
76  ParameterList getParameterDescriptors() const;
77  float getParameter(string identifier) const;
78  void setParameter(string identifier,
79  float value);
80  ProgramList getPrograms() const;
81  string getCurrentProgram() const;
82  void selectProgram(string name);
83  OutputList getOutputDescriptors() const;
84  bool initialise(size_t channels,
85  size_t stepSize,
86  size_t blockSize);
87  void reset();
88  FeatureSet process(const float *const *inputBuffers,
89  Vamp::RealTime timestamp);
90  FeatureSet getRemainingFeatures();
92 
93 protected:
95  int m_blockSize, m_stepSize;
96  vector<float> prevBin;
98 
99  bool l2norm;
100 };
101 
102 #endif
Calculates the spectral flux.
Definition: SpectralFlux.h:59
bool l2norm
Definition: SpectralFlux.h:99