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 _SpectralEnvelope_Extract_ 00023 #define _SpectralEnvelope_Extract_ 00024 00025 #include "Processing.hxx" 00026 #include "SpectralEnvelopeExtractConfig.hxx" 00027 #include "BPF.hxx" 00028 00029 namespace CLAM { 00030 00031 class Spectrum; 00032 class SpectralPeakArray; 00033 class Storage; 00034 class ProcessingConfig; 00035 00039 /* SpectralEnvelopeExtractConfig moved to SpectralEnvelopeExtractConfig.hxx */ 00040 00041 00045 class SpectralEnvelopeExtract: public Processing { 00046 SpectralEnvelopeExtractConfig mConfig; 00047 00051 const char *GetClassName() const {return "SpectralEnvelopeExtract";} 00052 00058 bool ConcreteConfigure(const ProcessingConfig&); 00059 00060 public: 00062 SpectralEnvelopeExtract(); 00066 SpectralEnvelopeExtract(const SpectralEnvelopeExtractConfig &c); 00067 00069 ~SpectralEnvelopeExtract(); 00070 00074 const ProcessingConfig &GetConfig() const { return mConfig;} 00075 00077 bool Do(void); 00078 00084 bool Do(const SpectralPeakArray& input,Spectrum& output); 00085 00086 00090 bool SetPrototypes(const SpectralPeakArray& input,Spectrum& output); 00091 00092 bool SetPrototypes(); 00093 00094 bool UnsetPrototypes(); 00095 00096 bool MayDisableExecution() const {return true;} 00097 00098 private: 00099 00105 bool CheckOutputType(Spectrum& out); 00106 00107 //member BPF's used for initialization 00108 BPF mMagBPF; 00109 BPF mPhaseBPF; 00110 00111 }; 00112 00113 };//namespace CLAM 00114 00115 #endif // _SpectralEnvelope_Extract_ 00116