bbc-vamp-plugins
1.0
|
00001 00018 #ifndef _CONTRAST_H_ 00019 #define _CONTRAST_H_ 00020 00021 #include <cmath> 00022 #include <complex> 00023 #include <algorithm> 00024 #include <vector> 00025 #include <vamp-sdk/Plugin.h> 00026 00027 using std::string; 00028 using std::vector; 00029 using std::complex; 00030 using std::abs; 00031 00065 class SpectralContrast : public Vamp::Plugin 00066 { 00067 public: 00069 SpectralContrast(float inputSampleRate); 00070 virtual ~SpectralContrast(); 00071 string getIdentifier() const; 00072 string getName() const; 00073 string getDescription() const; 00074 string getMaker() const; 00075 int getPluginVersion() const; 00076 string getCopyright() const; 00077 InputDomain getInputDomain() const; 00078 size_t getPreferredBlockSize() const; 00079 size_t getPreferredStepSize() const; 00080 size_t getMinChannelCount() const; 00081 size_t getMaxChannelCount() const; 00082 ParameterList getParameterDescriptors() const; 00083 float getParameter(string identifier) const; 00084 void setParameter(string identifier, 00085 float value); 00086 ProgramList getPrograms() const; 00087 string getCurrentProgram() const; 00088 void selectProgram(string name); 00089 OutputList getOutputDescriptors() const; 00090 bool initialise(size_t channels, 00091 size_t stepSize, 00092 size_t blockSize); 00093 void reset(); 00094 FeatureSet process(const float *const *inputBuffers, 00095 Vamp::RealTime timestamp); 00096 FeatureSet getRemainingFeatures(); 00097 void calculateBandFreqs(); 00099 00100 protected: 00102 int m_blockSize, m_stepSize; 00103 float m_sampleRate; 00105 00106 float alpha; 00107 int numBands; 00108 float *bandHighFreq; 00109 }; 00110 00111 #endif