CLAM-Development  1.4.0
SpectralSynthesis.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
3  * UNIVERSITAT POMPEU FABRA
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 #ifndef _SpectralSynthesis_
23 #define _SpectralSynthesis_
24 
25 //uncomment this if you want to use Ooura fft instead of fftw
26 //#define CLAM_OOURA
27 
28 #include "ProcessingComposite.hxx"
29 
30 #include "Array.hxx"
31 #include "Audio.hxx"
32 #include "DataTypes.hxx"
33 #include "DynamicType.hxx"
34 #include "Err.hxx"
35 #include "IFFT.hxx"
36 
37 #include "Frame.hxx"
38 #include "Segment.hxx"
39 #include "InControl.hxx"
40 #include "Spectrum.hxx"
41 #include "ProcessingData.hxx"
42 #include "ProcessingDataConfig.hxx"
43 #include "Processing.hxx"
44 #include "AudioMultiplier.hxx"
45 #include "WindowGenerator.hxx"
46 #include "OverlapAdd.hxx"
47 #include "AudioCircularBuffer.hxx"
48 #include "CircularShift.hxx"
49 
50 
51 
52 #include "SpectralAnalysis.hxx"
53 
54 #include <stdlib.h>
55 
57 
58 #include "AudioOutPort.hxx"
59 #include "InPort.hxx"
60 
61 namespace CLAM {
62 
63 
64 
65 
66  /* SpectralSynthesisConfig moved to SpectralSynthesisConfig.hxx */
67 
68 
73 
74 private:
75  // Configuration data
77 
78 
79  //internal Processing Data
80  Audio mAudio0,mAudio1, mAudio2,mAudio3;
81  //Spectrum Spec;
82  Audio mSynthWindow;
83 
84 
85  //internal Processing Objects
86  WindowGenerator mPO_AnalWindowGen;
87  WindowGenerator mPO_SynthWindowGen;
88  IFFT mPO_IFFT;
89  AudioMultiplier mPO_AudioProduct;
90  CircularShift mPO_CircularShift;
91 
92  // And the interfaces with the outside world.
93 
94 
95  // Internal convenience methods.
96 
97  void AttachChildren();
98  bool ConfigureChildren();
99  void ConfigureData();
100 
101 
103  bool ConcreteConfigure(const ProcessingConfig&);
104 
105  TInt32 CalculatePowerOfTwo(TInt32 size);
106 
107  public:
111 
112  // Processing Object compliance methods.
113  const char *GetClassName() const {return "SpectralSynthesis";}
114 
115 
116  const ProcessingConfig &GetConfig() const {return mConfig;}
117 
119  bool Do(void);
120 
122  bool Do(Spectrum& in, Audio &out);
123 
124  bool Do(Frame& in);
125  bool Do(Segment& in);
126 
127 
131 
132 
133  };
134 
135 } //end of namespace
136 
137 #endif //_SpectralSynthesis_
138