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

demodulator.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           demodulator.h  -  description
00003                              -------------------
00004     begin                : Mit Mai 22 2002
00005     copyright            : (C) 2002 by Peter Haase
00006     email                : mail@p-haase.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 #ifndef DEMODULATION_HEADER
00029 #define DEMODULATION_HEADER
00030 
00031 #include <iostream>
00032 #include <fstream>
00033 #include <complex>
00034 #include <vector>
00035 #include <cmath>
00036 
00037 #include "signals.h"
00038 #include "misc.h"
00039 #include "phbib.h"
00040 #include "basicdevice.h"
00041 #include "interfaces.h"
00042 
00043 #include "modulationschemes.h"
00044 #include "bitmapping.h"
00045 
00046 namespace simthlib
00047 {
00048 
00049 using simth::Complex;
00050 
00051 class Demodulator;
00052 
00053 
00054 std::ostream& operator<<(std::ostream &os, const Demodulator& demod);
00055 
00056 
00057 
00077 class Demodulator : public simth::Device
00078 {
00079 
00080     simth::SequenceType outputType_;
00081 
00082     //the current snr:
00083     double snr;
00084 
00085     virtual int getInputLength(int outputLength) const = 0;
00086 
00087   protected:
00088 
00089     simth::SequenceType outputType() const {return outputType_;}
00090 
00091     virtual Complex getComplSymbol(int symbolIndex) const = 0;
00092 
00093 
00094     virtual double SNR() const {return snr;}
00095     virtual void setSNR(double newSNR){snr = newSNR;}
00096 
00097   public:
00100     Demodulator(int deviceID, simth::DeviceSystemIntf* system, 
00101         const simth::PropertyList& pl,
00102         simth::SequenceType outType);
00103 
00104     virtual void updateInputLengths();
00105     virtual void updateOutputLengths();
00106 
00107 
00116     virtual void demodulate(const simth::ModSeq &receivedSym, simth::LlrSeq *correspondingLlrValues,
00117                             double noise = 0, const simth::ModSeq* trans = NULL) = 0;
00118 
00122     virtual void demodulate(const simth::ModSeq &receivedSym, simth::LlvSeq *correspondingLlvValues,
00123                             double noise = 0, const simth::ModSeq* trans = NULL ) = 0;
00124 
00125     virtual int getBitsPerSymbol() const = 0;
00126 
00127     virtual int getNumStates() const = 0;
00128 
00129     virtual void process();
00130 
00131     virtual void print(std::ostream &os) const;
00132 
00133     virtual void startOfSimulation();
00134 
00137     static void init(const std::string fileName, simth::Device** dev, simth::DeviceSystemIntf* sysPtr, int ID,
00138                      const std::string& regionQualifier = "");
00139 };
00140 
00141 
00142 } // namespace simthlib
00143 
00144 #endif

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