00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef ABSDEMODULATOR_H
00029 #define ABSDEMODULATOR_H
00030
00031 #include "demodulator.h"
00032
00033 namespace simthlib
00034 {
00035
00046 class AbsDemodulator : public Demodulator
00047 {
00048
00049 public:
00050
00053 AbsDemodulator(int deviceID, simth::DeviceSystemIntf* system,
00054 const simth::PropertyList& pl,
00055 simth::SequenceType outType);
00056
00057 virtual int getInputLength(int outputLength) const;
00058
00059 };
00060
00061
00072 class AbsDemodulatorMapping : public AbsDemodulator
00073 {
00074 MappingScheme* usedMapping;
00075
00076 public:
00077
00080 AbsDemodulatorMapping(int deviceID, simth::DeviceSystemIntf* system,
00081 const simth::PropertyList& pl,
00082 std::auto_ptr<MappingScheme> mapp, simth::SequenceType outTyp);
00083
00084 ~AbsDemodulatorMapping();
00085
00086 int getSymbolIndex(int dataValue) const
00087 {return usedMapping->getSymbolIndex(dataValue);}
00088
00089 int getDataValue(int symbolIndex) const
00090 {return usedMapping->getDataValue(symbolIndex);}
00091
00092 virtual void print(std::ostream &os) const;
00093 };
00094
00110 class AbsDemodulatorMetric : public AbsDemodulatorMapping
00111 {
00112 private:
00113
00114
00115 protected:
00119 bool csi_only_for_reliabilities;
00124 bool onlyPhaseEqualisation_;
00125
00131 virtual void MakeMetric(Complex sym, simth::Llv* const llv,
00132 Complex h, double noise) const = 0;
00133
00144 virtual void MakeMetric(Complex sym, simth::Llv* const llv) const = 0;
00145
00146 public:
00147
00150 AbsDemodulatorMetric(int deviceID, simth::DeviceSystemIntf* system,
00151 const simth::PropertyList& pl,
00152 std::auto_ptr<MappingScheme> mapp, simth::SequenceType outTyp);
00153
00157 virtual ~AbsDemodulatorMetric() = 0;
00158
00159
00160 virtual void demodulate(const simth::ModSeq &receivedSym, simth::LlrSeq *correspondingLlrValues,
00161 double noise = 0, const simth::ModSeq* trans = NULL);
00162 virtual void demodulate(const simth::ModSeq &receivedSym, simth::LlvSeq *correspondingLlvValues,
00163 double noise = 0, const simth::ModSeq* trans = NULL);
00164
00170 inline bool onlyPhaseEqualisation() const
00171 { return onlyPhaseEqualisation_; }
00172
00178 void setOnlyPhaseEqualisationOn() {onlyPhaseEqualisation_=true;}
00179
00180 };
00181
00182
00195 class QamDemodulator : public AbsDemodulatorMetric
00196 {
00197 QamConstellationDiagram* usedConstellationDiagram;
00198
00199 protected:
00200
00201
00202 Complex getComplSymbol(int symbolIndex) const
00203 {return usedConstellationDiagram->getComplSymbol(symbolIndex);}
00204
00205 virtual void MakeMetric(Complex sym, simth::Llv* const llv,
00206 Complex h, double noise) const;
00207 virtual void MakeMetric(Complex sym, simth::Llv* const llv) const;
00208
00209 void scaleConstellation(Complex scale){usedConstellationDiagram->scaleConstellation(scale);};
00210
00211 public:
00212
00213 QamDemodulator(int deviceID, simth::DeviceSystemIntf* system,
00214 const simth::PropertyList& pl);
00215
00216 ~QamDemodulator();
00217
00218
00219 virtual int getBitsPerSymbol() const
00220 {return usedConstellationDiagram->getBitsPerSymbol();}
00221
00222 virtual int getNumStates() const
00223 {return usedConstellationDiagram->getNumStates();}
00224
00225
00226 virtual void print(std::ostream &os) const;
00227 };
00228
00229
00230
00231
00242 class PskDemodulator : public AbsDemodulatorMetric
00243 {
00244 PskConstellationDiagram* usedConstellationDiagram;
00245
00246 protected:
00247
00248
00249 Complex getComplSymbol(int symbolIndex) const
00250 {return usedConstellationDiagram->getComplSymbol(symbolIndex);}
00251
00252 double getPhase(int symbIndex) const
00253 {return usedConstellationDiagram->getPhase(symbIndex);}
00254
00255 double getAmplitude(int symbIndex) const
00256 {return usedConstellationDiagram->getAmplitude(symbIndex);}
00257
00258 virtual void MakeMetric(Complex sym, simth::Llv* const llv,
00259 Complex h, double noise) const;
00260 virtual void MakeMetric(Complex sym, simth::Llv* const llv) const;
00261
00262 void scaleConstellation(Complex scale){usedConstellationDiagram->scaleConstellation(scale);};
00263
00264 public:
00265
00266 PskDemodulator(int deviceID, simth::DeviceSystemIntf* system,
00267 const simth::PropertyList& pl);
00268
00269 ~PskDemodulator();
00270
00271 virtual int getBitsPerSymbol() const
00272 {return usedConstellationDiagram->getBitsPerSymbol();}
00273
00274 virtual int getNumStates() const
00275 {return usedConstellationDiagram->getNumStates();}
00276
00277
00278 virtual void print(std::ostream &os) const;
00279 };
00280
00281
00282
00283
00293 class ApskDemodulator : public AbsDemodulatorMetric
00294 {
00295 ApskConstellationDiagram* usedConstellationDiagram;
00296
00297 protected:
00298
00299
00300 Complex getComplSymbol(int symbolIndex) const
00301 {return usedConstellationDiagram->getComplSymbol(symbolIndex);}
00302
00303 double getPhase(int symbIndex) const
00304 {return usedConstellationDiagram->getPhase(symbIndex);}
00305
00306 double getAmplitude(int symbIndex) const
00307 {return usedConstellationDiagram->getAmplitude(symbIndex);}
00308
00309 virtual void MakeMetric(Complex sym, simth::Llv* const llv, Complex h, double noise) const;
00310 virtual void MakeMetric(Complex sym, simth::Llv* const llv) const;
00311
00312 public:
00313
00322 ApskDemodulator(int deviceID, simth::DeviceSystemIntf* system,
00323 const simth::PropertyList& pl);
00324
00333 ApskDemodulator(int deviceID, simth::DeviceSystemIntf* system,
00334 const simth::PropertyList& pl,
00335 int bitsPerAmpl, int bitsPerPhase, double amplFactor, double amplAddend);
00336
00337 ~ApskDemodulator();
00338
00339 virtual int getBitsPerSymbol() const
00340 {return usedConstellationDiagram->getBitsPerSymbol();}
00341
00342 virtual int getNumStates() const
00343 {return usedConstellationDiagram->getNumStates();}
00344
00345
00346 virtual void print(std::ostream &os) const;
00347 };
00348
00349
00352 class DummyDemodulator : public AbsDemodulatorMetric
00353 {
00354 protected:
00355
00356
00357 Complex getComplSymbol(int symbolIndex) const
00358 {return Complex(0,0);};
00359
00360 virtual void MakeMetric(Complex sym, simth::Llv* const llv, Complex h, double noise) const;
00361 virtual void MakeMetric(Complex sym, simth::Llv* const llv) const;
00362
00363 public:
00364
00365 DummyDemodulator(int deviceID, simth::DeviceSystemIntf* system,
00366 const simth::PropertyList& pl);
00367
00368 ~DummyDemodulator();
00369
00370 virtual int getBitsPerSymbol() const
00371 {return(0);};
00372
00373 virtual int getNumStates() const
00374 {return(1);};
00375
00376
00377 virtual void print(std::ostream &os) const;
00378 };
00379
00380
00390 class RotPskDemodulator : public AbsDemodulatorMetric
00391 {
00392 PskConstellationDiagram* usedConstellationDiagram;
00393
00394 protected:
00395 Complex getComplSymbol(int symbolIndex) const
00396 {return usedConstellationDiagram->getComplSymbol(symbolIndex);}
00397
00398 double getPhase(int symbIndex) const
00399 {return usedConstellationDiagram->getPhase(symbIndex);}
00400
00401 double getAmplitude(int symbIndex) const
00402 {return usedConstellationDiagram->getAmplitude(symbIndex);}
00403
00404 virtual void demodulate(const simth::ModSeq &receivedSym, simth::LlrSeq *correspondingLlrValues,
00405 double noise = 0, const simth::ModSeq* trans = NULL);
00406
00407 virtual void demodulate(const simth::ModSeq &receivedSym, simth::LlvSeq *correspondingLlvValues,
00408 double noise = 0, const simth::ModSeq* trans = NULL);
00413 virtual void MakeMetric(Complex sym, simth::Llv* const llv,
00414 Complex h, double noise) const;
00417 virtual void MakeMetric(Complex sym, simth::Llv* const llv) const;
00418
00419 void scaleConstellation(Complex scale){usedConstellationDiagram->scaleConstellation(scale);};
00420
00421 public:
00422 RotPskDemodulator(int deviceID, simth::DeviceSystemIntf* system,
00423 const simth::PropertyList& pl);
00424
00425 ~RotPskDemodulator();
00426
00427 virtual int getBitsPerSymbol() const
00428 {return usedConstellationDiagram->getBitsPerSymbol();}
00429
00430 virtual int getNumStates() const
00431 {return usedConstellationDiagram->getNumStates();}
00432
00433 virtual void print(std::ostream &os) const;
00434 };
00435
00445 class PwRotPskDemodulator : public AbsDemodulatorMetric
00446 {
00447 private:
00448 PskConstellationDiagram* usedConstellationDiagram;
00449
00450 protected:
00451 Complex getComplSymbol(int symbolIndex) const
00452 {return usedConstellationDiagram->getComplSymbol(symbolIndex);}
00453
00454 double getPhase(int symbIndex) const
00455 {return usedConstellationDiagram->getPhase(symbIndex);}
00456
00457 double getAmplitude(int symbIndex) const
00458 {return usedConstellationDiagram->getAmplitude(symbIndex);}
00459
00460 virtual void demodulate(const simth::ModSeq &receivedSym, simth::LlrSeq *correspondingLlrValues,
00461 double noise = 0, const simth::ModSeq* trans = NULL);
00462 virtual void demodulate(const simth::ModSeq &receivedSym, simth::LlvSeq *correspondingLlvValues,
00463 double noise = 0, const simth::ModSeq* trans = NULL);
00466 virtual void MakeMetric(Complex sym, simth::Llv* const llv,
00467 Complex h, double noise) const;
00470 virtual void MakeMetric(Complex sym, simth::Llv* const llv) const;
00471
00472 void scaleConstellation(Complex scale){usedConstellationDiagram->scaleConstellation(scale);};
00473
00474 public:
00475
00476 PwRotPskDemodulator(int deviceID, simth::DeviceSystemIntf* system,
00477 const simth::PropertyList& pl);
00478
00479 ~PwRotPskDemodulator();
00480
00481 virtual int getBitsPerSymbol() const
00482 {return usedConstellationDiagram->getBitsPerSymbol();}
00483
00484 virtual int getNumStates() const
00485 {return usedConstellationDiagram->getNumStates();}
00486
00487 virtual void print(std::ostream &os) const;
00488 };
00489
00490 }
00491
00492 #endif // ABSDEMODULATOR_H