00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _SPECTRUM_ADDER2_
00023 #define _SPECTRUM_ADDER2_
00024
00025 #include "Processing.hxx"
00026 #include "DynamicType.hxx"
00027 #include "InPort.hxx"
00028 #include "OutPort.hxx"
00029 #include "Spectrum.hxx"
00030
00031 namespace CLAM {
00032
00033
00034 class SpecAdder2Config: public ProcessingConfig
00035 {
00036 public:
00037 DYNAMIC_TYPE_USING_INTERFACE (SpecAdder2Config, 0,ProcessingConfig);
00038 };
00039
00073 class SpectrumAdder2: public Processing {
00074 SpecAdder2Config mConfig;
00075
00077 int mSize;
00078
00079 InPort<Spectrum> mIn1;
00080 InPort<Spectrum> mIn2;
00081 OutPort<Spectrum> mOut;
00082
00084 typedef enum {
00085
00086
00087
00088
00089 SMagPhase, SComplex, SPolar,
00090
00091
00092 SBPF,
00093
00094
00095
00096
00097
00098
00099
00100 SBPFMagPhase, SBPFComplex, SBPFPolar, SMagPhaseBPF,
00101 SComplexBPF, SPolarBPF,
00102
00103
00104 SOther
00105 } PrototypeState;
00106
00108 typedef enum { Slinlin, Sloglog, Slinlog, Sloglin} ScaleState;
00109
00111 PrototypeState mProtoState;
00113 ScaleState mScaleState;
00114
00115
00117 std::string NewUniqueName();
00118
00119 const char *GetClassName() const {return "SpectrumAdder2";}
00120
00121
00125 bool ConcreteConfigure(const ProcessingConfig&);
00126
00127 public:
00128 SpectrumAdder2();
00129
00130 SpectrumAdder2(const SpecAdder2Config &c);
00131
00132 ~SpectrumAdder2() {};
00133
00134 const ProcessingConfig &GetConfig() const { return mConfig;}
00135
00136 bool Do(void);
00137
00138 bool Do(Spectrum& in1, Spectrum& in2, Spectrum& out);
00139
00140
00141
00148 bool SetPrototypes(const Spectrum& in1,const Spectrum& in2,const Spectrum& out);
00149
00150 bool SetPrototypes();
00151
00152 bool UnsetPrototypes();
00153
00154 bool MayDisableExecution() const {return true;}
00155
00156 private:
00157
00161 inline void Add(Spectrum& in1, Spectrum& in2, Spectrum& out);
00162
00163
00164
00165
00166 inline void AddMagPhase(Spectrum& in1, Spectrum& in2, Spectrum& out);
00167 inline void AddMagPhaseLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00168 inline void AddMagPhaseLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00169 inline void AddMagPhaseLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00170 inline void AddComplex(Spectrum& in1, Spectrum& in2, Spectrum& out);
00171 inline void AddComplexLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00172 inline void AddComplexLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00173 inline void AddComplexLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00174 inline void AddPolar(Spectrum& in1, Spectrum& in2, Spectrum& out);
00175 inline void AddPolarLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00176 inline void AddPolarLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00177 inline void AddPolarLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00178
00179 inline void AddBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00180
00181 inline void AddBPFLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00182 inline void AddBPFLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00183 inline void AddBPFLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00184 inline void AddBPFMagPhase(Spectrum& in1, Spectrum& in2, Spectrum& out);
00185 inline void AddMagPhaseBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00186 inline void AddBPFMagPhaseLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00187 inline void AddBPFMagPhaseLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00188 inline void AddBPFMagPhaseLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00189 inline void AddBPFMagPhaseLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00190 inline void AddBPFComplex(Spectrum& in1, Spectrum& in2, Spectrum& out);
00191 inline void AddComplexBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00192 inline void AddBPFComplexLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00193 inline void AddBPFComplexLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00194 inline void AddBPFComplexLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00195 inline void AddBPFComplexLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00196 inline void AddBPFPolar(Spectrum& in1, Spectrum& in2, Spectrum& out);
00197 inline void AddPolarBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00198 inline void AddBPFPolarLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00199 inline void AddBPFPolarLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00200 inline void AddBPFPolarLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00201 inline void AddBPFPolarLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00202
00203 };
00204
00205 }
00206
00207 #endif // _SPECTRUM_ADDER_
00208