bbc-vamp-plugins  1.0
SpectralFlux.h
00001 
00018 #ifndef _FLUX_H_
00019 #define _FLUX_H_
00020 
00021 #include <cmath>
00022 #include <complex>
00023 #include <vector>
00024 #include <vamp-sdk/Plugin.h>
00025 
00026 using std::string;
00027 using std::vector;
00028 using std::complex;
00029 using std::abs;
00030 
00059 class SpectralFlux : public Vamp::Plugin
00060 {
00061 public:
00063     SpectralFlux(float inputSampleRate);
00064     virtual ~SpectralFlux();
00065     string getIdentifier() const;
00066     string getName() const;
00067     string getDescription() const;
00068     string getMaker() const;
00069     int getPluginVersion() const;
00070     string getCopyright() const;
00071     InputDomain getInputDomain() const;
00072     size_t getPreferredBlockSize() const;
00073     size_t getPreferredStepSize() const;
00074     size_t getMinChannelCount() const;
00075     size_t getMaxChannelCount() const;
00076     ParameterList getParameterDescriptors() const;
00077     float getParameter(string identifier) const;
00078     void setParameter(string identifier,
00079                             float value);
00080     ProgramList getPrograms() const;
00081     string getCurrentProgram() const;
00082     void selectProgram(string name);
00083     OutputList getOutputDescriptors() const;
00084     bool initialise(size_t channels,
00085                          size_t stepSize,
00086                          size_t blockSize);
00087     void reset();
00088     FeatureSet process(const float *const *inputBuffers,
00089                        Vamp::RealTime timestamp);
00090     FeatureSet getRemainingFeatures();
00092 
00093 protected:
00095     int m_blockSize, m_stepSize;
00096     vector<float> prevBin;
00098 
00099     bool l2norm;        
00100 };
00101 
00102 #endif