Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/marsystems/ERB.h
Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 1998-2006 George Tzanetakis <gtzan@cs.uvic.ca>
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 */
00018 
00019 #ifndef MARSYAS_ERB_H
00020 #define MARSYAS_ERB_H
00021 
00022 #include <marsyas/system/MarSystem.h>
00023 #include "Fanout.h"
00024 
00025 namespace Marsyas
00026 {
00037 class ERB: public MarSystem
00038 {
00039 private:
00040   void addControls();
00041   void myUpdate(MarControlPtr sender);
00042 
00043   mrs_real lowFreq;
00044   mrs_real highFreq;
00045   mrs_real fs;
00046   mrs_real EarQ;
00047   mrs_real minBW;
00048 
00049   mrs_real A0, A2, B0;
00050 
00051   mrs_natural numChannels;
00052   mrs_natural order;
00053 
00054   realvec fcoefs;
00055   realvec centerFreqs;
00056 
00057   mrs_real E(mrs_real);
00058   mrs_real B(mrs_real);
00059   mrs_real B1(mrs_real, mrs_real);
00060   mrs_real B2(mrs_real);
00061   mrs_real A11(mrs_real, mrs_real);
00062   mrs_real A12(mrs_real, mrs_real);
00063   mrs_real A13(mrs_real, mrs_real);
00064   mrs_real A14(mrs_real, mrs_real);
00065   mrs_real gain(mrs_real, mrs_real);
00066   mrs_real abs(mrs_real, mrs_real);
00067 
00068   Fanout *filterBank;
00069 
00070 public:
00071   ERB(std::string name);
00072   ~ERB();
00073 
00074   MarSystem* clone() const;
00075 
00076   void myProcess(realvec& in, realvec& out);
00077 };
00078 
00079 }//namespace Marsyas
00080 
00081 #endif
00082