00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _SPECTRUM_Substracter2_
00023 #define _SPECTRUM_Substracter2_
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 SpecSubstracter2Config: public ProcessingConfig
00035 {
00036 public:
00037 DYNAMIC_TYPE_USING_INTERFACE (SpecSubstracter2Config, 0,ProcessingConfig);
00038 };
00039
00060 class SpectrumSubstracter2: public Processing {
00061 SpecSubstracter2Config mConfig;
00062
00064 int mSize;
00065
00066 InPort<Spectrum> mIn1;
00067 InPort<Spectrum> mIn2;
00068 OutPort<Spectrum> mOut;
00069
00071 typedef enum {
00072
00073
00074
00075
00076 SMagPhase, SComplex, SPolar,
00077
00078
00079 SBPF,
00080
00081
00082
00083
00084
00085
00086
00087 SBPFMagPhase, SBPFComplex, SBPFPolar, SMagPhaseBPF,
00088 SComplexBPF, SPolarBPF,
00089
00090
00091 SOther
00092 } PrototypeState;
00093
00095 typedef enum { Slinlin, Sloglog, Slinlog, Sloglin} ScaleState;
00096
00098 PrototypeState mProtoState;
00100 ScaleState mScaleState;
00101
00102
00104 std::string NewUniqueName();
00105
00106 const char *GetClassName() const {return "SpectrumSubstracter2";}
00107
00108
00112 bool ConcreteConfigure(const ProcessingConfig&);
00113
00114 public:
00115 SpectrumSubstracter2();
00116
00117 SpectrumSubstracter2(const SpecSubstracter2Config &c);
00118
00119 ~SpectrumSubstracter2() {};
00120
00121 const ProcessingConfig &GetConfig() const { return mConfig;}
00122
00123 bool Do(void);
00124
00125 bool Do(Spectrum& in1, Spectrum& in2, Spectrum& out);
00126
00127
00128
00135 bool SetPrototypes(const Spectrum& in1,const Spectrum& in2,const Spectrum& out);
00136
00137 bool SetPrototypes();
00138
00139 bool UnsetPrototypes();
00140
00141 bool MayDisableExecution() const {return true;}
00142
00143 private:
00144
00148 inline void Substract(Spectrum& in1, Spectrum& in2, Spectrum& out);
00149
00150
00151
00152
00153 inline void SubstractMagPhase(Spectrum& in1, Spectrum& in2, Spectrum& out);
00154 inline void SubstractMagPhaseLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00155 inline void SubstractMagPhaseLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00156 inline void SubstractMagPhaseLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00157 inline void SubstractComplex(Spectrum& in1, Spectrum& in2, Spectrum& out);
00158 inline void SubstractComplexLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00159 inline void SubstractComplexLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00160 inline void SubstractComplexLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00161 inline void SubstractPolar(Spectrum& in1, Spectrum& in2, Spectrum& out);
00162 inline void SubstractPolarLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00163 inline void SubstractPolarLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00164 inline void SubstractPolarLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00165
00166 inline void SubstractBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00167
00168 inline void SubstractBPFLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00169 inline void SubstractBPFLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00170 inline void SubstractBPFLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00171 inline void SubstractBPFMagPhase(Spectrum& in1, Spectrum& in2, Spectrum& out);
00172 inline void SubstractMagPhaseBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00173 inline void SubstractBPFMagPhaseLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00174 inline void SubstractBPFMagPhaseLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00175 inline void SubstractBPFMagPhaseLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00176 inline void SubstractBPFMagPhaseLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00177 inline void SubstractBPFComplex(Spectrum& in1, Spectrum& in2, Spectrum& out);
00178 inline void SubstractComplexBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00179 inline void SubstractBPFComplexLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00180 inline void SubstractBPFComplexLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00181 inline void SubstractBPFComplexLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00182 inline void SubstractBPFComplexLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00183 inline void SubstractBPFPolar(Spectrum& in1, Spectrum& in2, Spectrum& out);
00184 inline void SubstractPolarBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00185 inline void SubstractBPFPolarLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00186 inline void SubstractBPFPolarLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00187 inline void SubstractBPFPolarLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00188 inline void SubstractBPFPolarLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00189
00190 };
00191
00192 }
00193
00194 #endif // _SPECTRUM_Substracter_
00195