SpectralSynthesis.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 _SpectralSynthesis_
00023 #define _SpectralSynthesis_
00024 
00025 //uncomment this if you want to use Ooura fft instead of fftw 
00026 //#define CLAM_OOURA
00027 
00028 #include "ProcessingComposite.hxx"
00029 
00030 #include "Array.hxx"
00031 #include "Audio.hxx"
00032 #include "DataTypes.hxx"
00033 #include "DynamicType.hxx"
00034 #include "Err.hxx"
00035 #include "IFFT.hxx"
00036 
00037 #include "Frame.hxx"
00038 #include "Segment.hxx"
00039 #include "InControl.hxx"
00040 #include "Spectrum.hxx"
00041 #include "ProcessingData.hxx"
00042 #include "ProcessingDataConfig.hxx"
00043 #include "Processing.hxx"
00044 #include "AudioMultiplier.hxx"
00045 #include "WindowGenerator.hxx"
00046 #include "OverlapAdd.hxx"
00047 #include "CircularShift.hxx"
00048 
00049 
00050 
00051 #include "SpectralAnalysis.hxx"
00052 
00053 #include <stdlib.h>
00054 
00055 #include "SpectralSynthesisConfig.hxx"
00056 
00057 #include "AudioOutPort.hxx"
00058 #include "InPort.hxx"
00059 
00060 namespace CLAM {
00061 
00062 
00063 
00064 
00065         /* SpectralSynthesisConfig moved to SpectralSynthesisConfig.hxx */
00066 
00067 
00071         class SpectralSynthesis : public ProcessingComposite {
00072 
00073 private:
00074                 // Configuration data
00075                 SpectralSynthesisConfig mConfig;
00076 
00077 
00078                 //internal Processing Data
00079                 Audio                     mAudio0,mAudio1, mAudio2,mAudio3;
00080                 //Spectrum                  Spec;
00081                 Audio                    mSynthWindow;
00082 
00083 
00084                 //internal Processing Objects
00085                 WindowGenerator                 mPO_AnalWindowGen;
00086                 WindowGenerator                 mPO_SynthWindowGen;
00087                 IFFT                            mPO_IFFT;
00088                 AudioMultiplier            mPO_AudioProduct;
00089                 CircularShift                   mPO_CircularShift;
00090                         
00091                 // And the interfaces with the outside world.
00092 
00093                 
00094                 // Internal convenience methods.
00095 
00096                 void AttachChildren();
00097                 bool ConfigureChildren();
00098                 void ConfigureData();
00099 
00100                 
00102                 bool ConcreteConfigure(const ProcessingConfig&);
00103 
00104                 TInt32 CalculatePowerOfTwo(TInt32 size);
00105 
00106         public:
00107                 SpectralSynthesis(const SpectralSynthesisConfig& cfg);
00108                 SpectralSynthesis();
00109                 ~SpectralSynthesis();
00110 
00111                 // Processing Object compliance methods.
00112                 const char *GetClassName() const {return "SpectralSynthesis";}
00113 
00114 
00115                 const ProcessingConfig &GetConfig() const {return mConfig;}
00116 
00118                 bool Do(void);
00119 
00121                 bool Do(Spectrum& in, Audio &out);
00122                 
00123                 bool Do(Frame& in);
00124                 bool Do(Segment& in);
00125 
00126 
00128                 InPort<Spectrum>     mInput;
00129                 AudioOutPort mOutput;
00130 
00131 
00132         };
00133 
00134 } //end of namespace
00135 
00136 #endif //_SpectralSynthesis_
00137 
Generated by  doxygen 1.6.3