text: /**
   * @file RMS.h
   * @author  Justin Salamon <justin.salamon@nyu.edu>
   * @version 1.0
   *
   * @section LICENSE
   *
   * MIR.EDU
   * 
   * A vamp plug-in library for teaching MIR.
   * Copyright (C) 2013-2014 Justin Salamon.
   *
   * MIR.EDU is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
   * MIR.EDU is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   *
   * @section DESCRIPTION
   *
   * Feature name: RMS <br/>
   * Description: Compute the root mean square of each frame of the signal <br/>
   * Unit: none <br/>
   * Formula: rms_x = sqrt( 1/N * (x1^2 + x2^2 + x3^2 + ... + xn^2) ) where
   * x is a descrete signal containing N samples x1, x2, ..., xn <br/>
   * Reference: http://en.wikipedia.org/wiki/Root_mean_square <br/>
   */
  
  // Remember to use a different guard symbol in each header!
  #ifndef _RMS_H_
  #define _RMS_H_
  
  #include <cmath>
  #include <vamp-sdk/Plugin.h>
  
  using std::string;
  
  
  class RMS : public Vamp::Plugin
  {
  public:
      RMS(float inputSampleRate);
      virtual ~RMS();
  
      string getIdentifier() const;
      string getName() const;
      string getDescription() const;
      string getMaker() const;
      int getPluginVersion() const;
      string getCopyright() const;
  
      InputDomain getInputDomain() const;
      size_t getPreferredBlockSize() const;
      size_t getPreferredStepSize() const;
      size_t getMinChannelCount() const;
      size_t getMaxChannelCount() const;
  
      ParameterList getParameterDescriptors() const;
      float getParameter(string identifier) const;
      void setParameter(string identifier, float value);
  
      ProgramList getPrograms() const;
      string getCurrentProgram() const;
      void selectProgram(string name);
  
      OutputList getOutputDescriptors() const;
  
      bool initialise(size_t channels, size_t stepSize, size_t blockSize);
      void reset();
  
      FeatureSet process(const float *const *inputBuffers,
                         Vamp::RealTime timestamp);
  
      FeatureSet getRemainingFeatures();
  
  protected:
      // plugin-specific data and methods go here
      size_t m_blockSize;
      size_t m_stepSize;
  };
  
  
  
  #endif
  