bbc-vamp-plugins  1.0
Intensity.h
1 
18 #ifndef _INTENSITY_H_
19 #define _INTENSITY_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::abs;
29 using std::complex;
30 
63 class Intensity : public Vamp::Plugin
64 {
65 public:
67  Intensity(float inputSampleRate);
68  virtual ~Intensity();
69  string getIdentifier() const;
70  string getName() const;
71  string getDescription() const;
72  string getMaker() const;
73  int getPluginVersion() const;
74  string getCopyright() const;
75  InputDomain getInputDomain() const;
76  size_t getPreferredBlockSize() const;
77  size_t getPreferredStepSize() const;
78  size_t getMinChannelCount() const;
79  size_t getMaxChannelCount() const;
80  ParameterList getParameterDescriptors() const;
81  float getParameter(string identifier) const;
82  void setParameter(string identifier,
83  float value);
84  ProgramList getPrograms() const;
85  string getCurrentProgram() const;
86  void selectProgram(string name);
87  OutputList getOutputDescriptors() const;
88  bool initialise(size_t channels,
89  size_t stepSize,
90  size_t blockSize);
91  void reset();
92  FeatureSet process(const float *const *inputBuffers,
93  Vamp::RealTime timestamp);
94  FeatureSet getRemainingFeatures();
96 
97 protected:
98  void calculateBandFreqs();
99 
101  int m_blockSize, m_stepSize;
102  float m_sampleRate;
104 
105  int numBands;
106  float *bandHighFreq;
107 };
108 
109 #endif
void calculateBandFreqs()
Calculates the upper frequency for each of a given number of sub-bands.
Definition: Intensity.cpp:281
float * bandHighFreq
Definition: Intensity.h:106
int numBands
Definition: Intensity.h:105
Calculates the intensity of a signal and the intensity ratio for a number of sub-bands.
Definition: Intensity.h:63