Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

adaptiveDemodulator.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           adaptiveDemodulator.h  -  description
00003                              -------------------
00004     begin                : Sat Oct 19 2002
00005     copyright            : (C) 2002 by Mattias Lampe
00006     email                : lampe@tuhh.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef ADAPTIVEDEMODULATOR_H
00019 #define ADAPTIVEDEMODULATOR_H
00020 
00021 #include <iostream>
00022 #include <fstream>
00023 #include <complex>
00024 #include <vector>
00025 #include <cmath>
00026 #include "signals.h"
00027 #include "misc.h"
00028 #include "phbib.h"
00029 #include "basicdevicefactory.h"
00030 #include "basicdevice.h"
00031 #include "interfaces.h"
00032 #include "modulator.h"
00033 #include "adaptiveModulator.h"
00034 #include "interleaver.h"
00035 
00036 namespace simthlib {
00037 
00038 class AdaptiveDemodulator;
00039 
00040 
00041 std::ostream& operator<<(std::ostream &os, const AdaptiveDemodulator& demod);
00042 
00043 void initAdaptiveDemodulator(const std::string fileName, simth::Device** dev, simth::DeviceSystemIntf* sysPtr, int ID,
00044            const std::string& regionQualifier = "");
00045 
00046 
00047 
00048 
00049 class AdaptiveDemodulatorBase : public simth::CompatibleDevice
00050 {
00051    protected:
00052       simth::SequenceType outputType_;
00053       ExtendedModList* localExtModlist;
00054       map_type mapping;
00055       int avgBitsPerSym;
00056       double snr;
00057       Interleaving *intl;
00058       bool csi_only_for_reliabilities;
00069       virtual void demodulate(const simth::ModSeq &receivedSym, 
00070                   simth::LlrSeq *correspondingLlrValues,
00071                   double noise = 0, 
00072                   const simth::ModSeq* trans = NULL, 
00073                   simth::LoadingInfoSeq* loading=NULL);
00074 
00078       virtual void demodulate(const simth::ModSeq &receivedSym, 
00079                   simth::LlvSeq *correspondingLlvValues,
00080                   double noise = 0, 
00081                   const simth::ModSeq* trans = NULL, 
00082                   simth::LoadingInfoSeq* loading=NULL);
00083 
00086       virtual int MakeMetric(Complex sym, simth::Llv* const llv, 
00087                  ConstellationDiagram* constellation,
00088                  MappingScheme* mapping, 
00089                  int bitsPerSym, Complex h, double noise)=0;
00090 
00091       virtual void llvSeq2llrSeq(const simth::LlvSeq& from, 
00092                  simth::LlrSeq* llrSeq)=0;
00093 
00094       AdaptiveDemodulatorBase(simth::SequenceType outType, 
00095                   map_type _mapping,
00096                   int _avgBitsPerSym, 
00097                   std::auto_ptr<Interleaving> _intl);
00098 
00099    public:
00100       AdaptiveDemodulatorBase(int id, simth::DeviceSystemIntf *s, const simth::PropertyList& pl);
00101 
00102       virtual void updateInputLengths()=0;
00103       virtual void updateOutputLengths()=0;
00104       virtual void print(std::ostream &os) const=0;
00105       virtual void process()=0;
00106       virtual ~AdaptiveDemodulatorBase();
00107 
00108 };
00109 
00110 
00111          
00112 
00113 class AdaptiveDemodulator : public AdaptiveDemodulatorBase
00114 {
00115    private:
00118       int MakeMetric(Complex sym, simth::Llv* const llv, ConstellationDiagram* constellation,
00119              MappingScheme* mapping, int bitsPerSym,Complex h, double noise);
00120       void llvSeq2llrSeq(const simth::LlvSeq& from, simth::LlrSeq* llrSeq);
00121 
00122       void init();
00123 
00124    public:
00125       AdaptiveDemodulator(simth::SequenceType outType, map_type mapping, int avgBitsPerSym, std::auto_ptr<Interleaving> intl);
00126       AdaptiveDemodulator(int id, simth::DeviceSystemIntf *s, const simth::PropertyList& pl);
00127       void updateInputLengths();
00128       void updateOutputLengths();
00129       void print(std::ostream &os) const;
00130       void process();
00131       ~AdaptiveDemodulator(){};
00132       virtual void startOfSimulation();
00133 
00134 };
00135 
00136 
00142 class MultilevelAdaptiveDemodulator : public AdaptiveDemodulatorBase
00143 {
00144    private:
00145       //SequenceType outputType_;
00146       //ExtendedModList* localExtModlist;
00147       //map_type mapping;
00148       int demodLevel;
00149       simth::checkedVector<simth::BitSeq*> decSeqList;
00150       simth::checkedVector<int> decSeqPos;
00151       simth::checkedVector<unsigned> decSeqLength;
00152    
00153       //double snr;
00154       //Interleaving *intl;
00165       //void demodulate(const ModSeq &receivedSym, LlrSeq *correspondingLlrValues,
00166       //      double noise = 0, const ModSeq* trans = NULL, simth::LoadingInfoSeq* loading=NULL);
00167 
00171       //void demodulate(const ModSeq &receivedSym, LlvSeq *correspondingLlvValues,
00172       //      double noise = 0, const ModSeq* trans = NULL, simth::LoadingInfoSeq* loading=NULL);
00173 
00176       int MakeMetric(Complex sym, simth::Llv* const llv, ConstellationDiagram* constellation,
00177              MappingScheme* mapping, int bitsPerSym,Complex h, double noise);
00178       void llvSeq2llrSeq(const simth::LlvSeq& from, simth::LlrSeq* llrSeq);
00179 
00180    public:
00181       MultilevelAdaptiveDemodulator(simth::SequenceType outType, map_type mapping, std::auto_ptr<Interleaving> intl, int operationLevel);
00182       void updateInputLengths();
00183       void updateOutputLengths();
00184       void print(std::ostream &os) const;
00185       void process();
00186       ~MultilevelAdaptiveDemodulator();
00187 
00188 };
00189 
00190 } // namespace
00191 
00192 #endif

Generated on Tue Aug 9 14:35:10 2005 for simtheticlib by  doxygen 1.4.1