00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _SPECTRUM_PRODUCT_
00023 #define _SPECTRUM_PRODUCT_
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
00069 class SpectrumProduct: public Processing
00070 {
00072 int mSize;
00073
00075 typedef enum {
00076
00077
00078
00079
00080 SMagPhase, SComplex, SPolar,
00081
00082
00083 SBPF,
00084
00085
00086
00087
00088
00089
00090
00091 SBPFMagPhase, SBPFComplex, SBPFPolar, SMagPhaseBPF,
00092 SComplexBPF, SPolarBPF,
00093
00094
00095 SOther
00096 } PrototypeState;
00097
00099 typedef enum { Slinlin, Sloglog, Slinlog, Sloglin} ScaleState;
00100
00102 PrototypeState mProtoState;
00104 ScaleState mScaleState;
00105
00106 const char *GetClassName() const {return "SpectrumProduct";}
00107
00108 public:
00109
00110 InPort<Spectrum> mInput1;
00111 InPort<Spectrum> mInput2;
00112 OutPort<Spectrum> mOutput;
00113
00114 SpectrumProduct(const Config &c=Config());
00115 virtual ~SpectrumProduct();
00116
00117
00118 bool Do();
00119
00120 bool Do(Spectrum& in1, Spectrum& in2, Spectrum& out);
00121
00122
00123
00130 bool SetPrototypes(const Spectrum& in1,const Spectrum& in2,const Spectrum& out);
00131
00132 bool SetPrototypes();
00133
00134 bool UnsetPrototypes();
00135
00136 bool MayDisableExecution() const {return true;}
00137
00138 private:
00139
00143 inline void Multiply(Spectrum& in1, Spectrum& in2, Spectrum& out);
00144
00145
00146
00147
00148 inline void MultiplyMagPhase(Spectrum& in1, Spectrum& in2, Spectrum& out);
00149 inline void MultiplyMagPhaseLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00150 inline void MultiplyMagPhaseLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00151 inline void MultiplyMagPhaseLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00152 inline void MultiplyComplex(Spectrum& in1, Spectrum& in2, Spectrum& out);
00153 inline void MultiplyComplexLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00154 inline void MultiplyComplexLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00155 inline void MultiplyComplexLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00156 inline void MultiplyPolar(Spectrum& in1, Spectrum& in2, Spectrum& out);
00157 inline void MultiplyPolarLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00158 inline void MultiplyPolarLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00159 inline void MultiplyPolarLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00160
00161 inline void MultiplyBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00162
00163 inline void MultiplyBPFLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00164 inline void MultiplyBPFLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00165 inline void MultiplyBPFLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00166 inline void MultiplyBPFMagPhase(Spectrum& in1, Spectrum& in2, Spectrum& out);
00167 inline void MultiplyMagPhaseBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00168 inline void MultiplyBPFMagPhaseLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00169 inline void MultiplyBPFMagPhaseLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00170 inline void MultiplyBPFMagPhaseLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00171 inline void MultiplyBPFMagPhaseLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00172 inline void MultiplyBPFComplex(Spectrum& in1, Spectrum& in2, Spectrum& out);
00173 inline void MultiplyComplexBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00174 inline void MultiplyBPFComplexLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00175 inline void MultiplyBPFComplexLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00176 inline void MultiplyBPFComplexLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00177 inline void MultiplyBPFComplexLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00178 inline void MultiplyBPFPolar(Spectrum& in1, Spectrum& in2, Spectrum& out);
00179 inline void MultiplyPolarBPF(Spectrum& in1, Spectrum& in2, Spectrum& out);
00180 inline void MultiplyBPFPolarLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00181 inline void MultiplyBPFPolarLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00182 inline void MultiplyBPFPolarLinLog(Spectrum& in1, Spectrum& in2, Spectrum& out);
00183 inline void MultiplyBPFPolarLogLin(Spectrum& in1, Spectrum& in2, Spectrum& out);
00184
00185 };
00186
00187 }
00188
00189 #endif // _SPECTRUM_PRODUCT_
00190