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 RECEIVER_HEADER
00029 #define RECEIVER_HEADER
00030
00031 #include <fstream>
00032 #include <string>
00033 #include <exception>
00034
00035 #include "signals.h"
00036 #include "fft.h"
00037 #include "channel.h"
00038 #include "misc.h"
00039
00040 #include "basicdevice.h"
00041 #include "interfaces.h"
00042 #include "modulator.h"
00043
00044
00045 namespace simthlib
00046 {
00047
00048 typedef simth::SymSeq SignalSamples;
00049
00050 class Receiver;
00051
00052
00053 std::ostream& operator<<(std::ostream &os, const Receiver &rcv);
00054
00055
00070 class Receiver : public simth::Device
00071 {
00072 private:
00073
00074
00075 protected:
00076
00087 virtual int numTimeSamples(int numModSymbols) const = 0;
00088
00092 virtual int numModSymbols(int numTimeSamples) const = 0;
00093
00094
00095 public:
00096
00100 Receiver(int deviceID, simth::DeviceSystemIntf* system,
00101 const simth::PropertyList& pl);
00102
00103 virtual ~Receiver(){};
00104
00105 virtual void process();
00106
00107 virtual void updateInputLengths();
00108 virtual void updateOutputLengths();
00109
00110
00114 virtual void receiveSignal(const simth::TimeSignal& SignalSamples_ptr,
00115 simth::ModSeq* modSeq,
00116 double* noise = NULL,
00117 simth::ModSeq* trans = NULL) = 0;
00118
00119 virtual void print(std::ostream &os) const;
00120
00121 virtual void startOfSimulation();
00122
00125 static void init(const std::string fileName,
00126 simth::Device** dev,
00127 simth::DeviceSystemIntf* sysPtr,
00128 int ID,
00129 const std::string& regionQualifier = "");
00130
00135 static simth::Device *findChannel(simth::DeviceSystemIntf* sys);
00136
00137 };
00138
00139 }
00140
00141 #endif