00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _SPECTRUM_InterpolateER2_
00023 #define _SPECTRUM_InterpolateER2_
00024
00025 #include "Processing.hxx"
00026 #include "DynamicType.hxx"
00027 #include "InPort.hxx"
00028 #include "OutPort.hxx"
00029 #include "Spectrum.hxx"
00030 #include "InControl.hxx"
00031
00032 namespace CLAM {
00033
00034
00035 class SpecInterpConfig: public ProcessingConfig
00036 {
00037 public:
00038 DYNAMIC_TYPE_USING_INTERFACE (SpecInterpConfig, 1,ProcessingConfig);
00039 DYN_ATTRIBUTE(0, public, TData, InterpolationFactor);
00040 protected:
00041 void DefaultInit();
00042
00043 };
00044
00078 class SpectrumInterpolator: public Processing
00079 {
00080 typedef SpecInterpConfig Config;
00081 Config mConfig;
00082
00084 int mSize;
00085
00086 InPort<Spectrum> mIn1;
00087 InPort<Spectrum> mIn2;
00088 OutPort<Spectrum> mOut;
00089
00091 typedef enum {
00092
00093
00094
00095
00096 SMagPhase, SComplex, SPolar,
00097
00098
00099 SBPF,
00100
00101
00102
00103
00104
00105
00106
00107 SBPFMagPhase, SBPFComplex, SBPFPolar, SMagPhaseBPF,
00108 SComplexBPF, SPolarBPF,
00109
00110
00111 SOther
00112 } PrototypeState;
00113
00115 typedef enum { Slinlin, Sloglog, Slinlog, Sloglin} ScaleState;
00116
00118 PrototypeState mProtoState;
00120 ScaleState mScaleState;
00121
00122
00123 const char *GetClassName() const {return "SpectrumInterpolator";}
00124
00125
00129 bool ConcreteConfigure(const ProcessingConfig&);
00130 public:
00131 SpectrumInterpolator(const SpecInterpConfig &c=Config());
00132 ~SpectrumInterpolator() {};
00133 const ProcessingConfig &GetConfig() const { return mConfig;}
00134 bool Do(void);
00135
00136
00137 bool Do(Spectrum& in1, Spectrum& in2, Spectrum& out);
00138
00139
00140
00147 bool SetPrototypes(const Spectrum& in1,const Spectrum& in2,const Spectrum& out);
00148
00149 bool SetPrototypes();
00150
00151 bool UnsetPrototypes();
00152
00153 bool MayDisableExecution() const {return true;}
00154
00156 FloatInControl mInterpolationFactorCtl;
00157
00158 private:
00159
00163 inline void Interpolate(Spectrum& in1, Spectrum& in2, Spectrum& out);
00164
00165
00166
00167
00168 inline void InterpolateMagPhase(Spectrum& in1, Spectrum& in2, Spectrum& out);
00169 inline void InterpolateMagPhaseLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00170 inline void InterpolateMagPhaseLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00171 inline void InterpolateMagPhaseLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00172 inline void InterpolateComplex(Spectrum& in1, Spectrum& in2, Spectrum& out);
00173 inline void InterpolateComplexLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00174 inline void InterpolateComplexLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00175 inline void InterpolateComplexLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00176 inline void InterpolatePolar(Spectrum& in1, Spectrum& in2, Spectrum& out);
00177 inline void InterpolatePolarLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00178 inline void InterpolatePolarLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00179 inline void InterpolatePolarLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00180
00181 inline void InterpolateBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00182
00183 inline void InterpolateBPFLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00184 inline void InterpolateBPFLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00185 inline void InterpolateBPFLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00186 inline void InterpolateBPFMagPhase(Spectrum& in1, Spectrum& in2, Spectrum& out);
00187 inline void InterpolateMagPhaseBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00188 inline void InterpolateBPFMagPhaseLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00189 inline void InterpolateBPFMagPhaseLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00190 inline void InterpolateBPFMagPhaseLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00191 inline void InterpolateBPFMagPhaseLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00192 inline void InterpolateBPFComplex(Spectrum& in1, Spectrum& in2, Spectrum& out);
00193 inline void InterpolateComplexBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00194 inline void InterpolateBPFComplexLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00195 inline void InterpolateBPFComplexLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00196 inline void InterpolateBPFComplexLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00197 inline void InterpolateBPFComplexLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00198 inline void InterpolateBPFPolar(Spectrum& in1, Spectrum& in2, Spectrum& out);
00199 inline void InterpolatePolarBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00200 inline void InterpolateBPFPolarLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00201 inline void InterpolateBPFPolarLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00202 inline void InterpolateBPFPolarLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00203 inline void InterpolateBPFPolarLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00204
00205 };
00206
00207 }
00208
00209 #endif // _SPECTRUM_InterpolateER_
00210