text: /*
  ** Copyright (C) 1998-2010 George Tzanetakis <gtzan@cs.uvic.ca>
  **
  ** This program 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 2 of the License, or
  ** (at your option) any later version.
  **
  ** This program 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, write to the Free Software
  ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
  
  #ifndef MARSYAS_PEAKRATIO_H
  #define MARSYAS_PEAKRATIO_H
  
  #include <marsyas/system/MarSystem.h>
  
  namespace Marsyas
  {
  /**
  	\ingroup Processing Analysis
  	\brief Incorporates the ratio of the higest peak to minimal/average peak of each observation samplewise to the output vector.
  
  	Take the values of the input realvec
  	and put them in the output vector. Then take the maximum value and divide either by the average or minimum value.
  	Both results are appended to the output as Observations.
  
  	Normally this Marsystem expects as input a vector of chromas (i.e. the output of a chroma generator like Spectrum2Chroma).
  	In case of multiple samples per Observation, the Ratios are computed sample per sample over all observations.
  
  	Controls:
  	none
  */
  
  class PeakRatio: public MarSystem
  {
  private:
    //Add specific controls needed by this MarSystem.
    void addControls();
    void myUpdate(MarControlPtr sender);
    realvec maxima_;
    realvec minima_;
  
  
  public:
    PeakRatio(std::string name);
    PeakRatio(const PeakRatio& a);
    ~PeakRatio();
    MarSystem* clone() const;
  
    void myProcess(realvec& in, realvec& out);
  };
  
  }//namespace Marsyas
  
  #endif
  