bbc-vamp-plugins  1.0
SpectralContrast.h
1 
18 #ifndef _CONTRAST_H_
19 #define _CONTRAST_H_
20 
21 #include <cmath>
22 #include <complex>
23 #include <algorithm>
24 #include <vector>
25 #include <vamp-sdk/Plugin.h>
26 
27 using std::string;
28 using std::vector;
29 using std::complex;
30 using std::abs;
31 
65 class SpectralContrast : public Vamp::Plugin
66 {
67 public:
69  SpectralContrast(float inputSampleRate);
70  virtual ~SpectralContrast();
71  string getIdentifier() const;
72  string getName() const;
73  string getDescription() const;
74  string getMaker() const;
75  int getPluginVersion() const;
76  string getCopyright() const;
77  InputDomain getInputDomain() const;
78  size_t getPreferredBlockSize() const;
79  size_t getPreferredStepSize() const;
80  size_t getMinChannelCount() const;
81  size_t getMaxChannelCount() const;
82  ParameterList getParameterDescriptors() const;
83  float getParameter(string identifier) const;
84  void setParameter(string identifier,
85  float value);
86  ProgramList getPrograms() const;
87  string getCurrentProgram() const;
88  void selectProgram(string name);
89  OutputList getOutputDescriptors() const;
90  bool initialise(size_t channels,
91  size_t stepSize,
92  size_t blockSize);
93  void reset();
94  FeatureSet process(const float *const *inputBuffers,
95  Vamp::RealTime timestamp);
96  FeatureSet getRemainingFeatures();
97  void calculateBandFreqs();
99 
100 protected:
102  int m_blockSize, m_stepSize;
103  float m_sampleRate;
105 
106  float alpha;
107  int numBands;
108  float *bandHighFreq;
109 };
110 
111 #endif
Calculates the peak and valleys of the spectral contrast feature.
Definition: SpectralContrast.h:65
int numBands
Definition: SpectralContrast.h:107
float * bandHighFreq
Definition: SpectralContrast.h:108
float alpha
Definition: SpectralContrast.h:106