SpectralAnalysis.hxx

Go to the documentation of this file.
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 __SpectralAnalysis__
00023 #define __SpectralAnalysis__
00024 
00025 //Uncomment this line if you want to use Ooura fft instead of fftw
00026 //#define CLAM_OOURA
00027 
00028 #include "WindowGenerator.hxx"
00029 #include "CircularShift.hxx"
00030 #include "SpectralAnalysisConfig.hxx"
00031 #include "Audio.hxx"
00032 #include "AudioMultiplier.hxx"
00033 #include "ProcessingComposite.hxx"
00034 
00035 #include "FFT.hxx"
00036 
00037 #include "Spectrum.hxx"
00038 #include "AudioInPort.hxx"
00039 #include "OutPort.hxx"
00040 
00041 namespace CLAM {
00042 
00043 class Frame;
00044 class Segment;
00045 class ProcessingConfig;
00046 
00051 class SpectralAnalysis:public ProcessingComposite
00052 {
00053 
00054 public:
00055         
00056 // Processing Object compliance methods.
00057 
00058         const char *GetClassName() const {return "SpectralAnalysis";}
00059 
00060 
00061         SpectralAnalysis(SpectralAnalysisConfig& config);
00062         SpectralAnalysis();
00063         ~SpectralAnalysis();
00064         
00065                         
00066         const ProcessingConfig &GetConfig() const {return mConfig;}
00067 
00069         bool Do(void);
00070 
00072         bool Do(const Audio& in,Spectrum& outSp);
00073 
00077         bool Do(Frame& in);
00078 
00083         bool Do(Segment& in);
00084 private:
00085 
00087         SpectralAnalysisConfig mConfig;
00088 
00089 // The internal Processing Objects
00090 
00094         WindowGenerator mPO_WinGen;
00095 
00099         AudioMultiplier mPO_AProduct;
00100 
00104         CircularShift   mPO_CShift;
00105 
00109         FFT             mPO_FFT;
00110 
00111 //Internal DataObjects
00112 
00114         Audio mAudioFrame;
00116         Audio mWindow; 
00118         Spectrum mSpec;
00119 
00120         // Internal convenience methods.
00121 
00122         void AttachChildren();
00123         bool ConfigureChildren();
00124         void ConfigureData();
00125 
00126         
00128         bool ConcreteConfigure(const ProcessingConfig&);
00129 
00131         AudioInPort     mInput;
00132         OutPort<Spectrum> mOutput;
00133 
00134 };
00135 
00136 } //namespace
00137 
00138 #endif
00139 
Generated by  doxygen 1.6.3