00001 /* 00002 * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG) 00003 * UNIVERSITAT POMPEU FABRA 00004 * 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 * 00020 */ 00021 00022 #ifndef _ERBSpaceGen_ 00023 #define _ERBSpaceGen_ 00024 00025 #include "DataTypes.hxx" 00026 #include "Processing.hxx" 00027 #include "Array.hxx" 00028 #include "ERB_Space_GenConfig.hxx" 00029 00030 namespace CLAM 00031 { 00032 00033 //CLASS ERB_SpaceGen 00034 //This function computes an array of NumFilter frequencies uniformly spaced between 00035 //highFreq and lowFreq on an ERB scale. N is set to 100 if not specified. 00036 // 00037 //For a definition of ERB, see Moore, B. C. J., and Glasberg, B. R. (1983). 00038 //"Suggested formulae for calculating auditory-filter bandwidths and 00039 // excitation patterns," J. Acoust. Soc. Am. 74, 750-753. 00040 00041 00042 class ERB_SpaceGen : public Processing 00043 { 00044 public: 00045 ERB_SpaceGen(); 00046 ERB_SpaceGen(ERB_SpaceGenConfig& c); 00047 ~ERB_SpaceGen(); 00048 00049 const ProcessingConfig &GetConfig() const { return mConfig;} 00050 00052 bool Do(void){return false;} 00053 00055 bool Do(Array<double>& mERBFreqs); 00056 00057 const char * GetClassName() const {return "ERB_SpaceGen";} 00058 00059 private: 00060 bool ConcreteConfigure(const ProcessingConfig& c); 00061 00062 ERB_SpaceGenConfig mConfig; 00063 00064 TSize mNumFilter; 00065 TSize mLowFreq; 00066 TSize mHighFreq; 00067 00068 }; 00069 00070 } // namespace CLAM 00071 00072 #endif // _ERBSpaceGen_ 00073