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 MIMO_ENCODER_H
00029 #define MIMO_ENCODER_H
00030
00031 #include <iostream>
00032 #include <complex>
00033
00034
00035 #include <simthetic/basicdevice.h>
00036 #include <simthetic/signals.h>
00037 #include <simthetic/misc.h>
00038
00039
00040 #include "matrixseq.h"
00041
00042 namespace mimo
00043 {
00044
00045
00046 class Encoder;
00047 std::ostream& operator<<(std::ostream &os, const Encoder &enc);
00048
00049
00056 class Encoder : public simth::Device
00057 {
00058
00059 protected:
00060 unsigned nr_rx;
00061 unsigned nr_tx;
00062
00063 public:
00064
00067 Encoder(int deviceID, simth::DeviceSystemIntf* system,
00068 const simth::PropertyList& pl);
00069
00071 virtual ~Encoder();
00072
00074 virtual void updateInputLengths();
00076 virtual void updateOutputLengths();
00078 virtual void process();
00079
00096 virtual int getDataLength(int codedLength) const =0;
00097
00111 virtual int getCodeLength(int rawLength) const =0;
00112
00120 virtual void Encode(const simth::ModSeq& modulation_symbols,
00121 CVectorSeq& output_vectors) = 0;
00122
00123
00125 virtual void print(std::ostream &os) const;
00126
00127
00128
00129
00130 };
00131
00132
00133 class SpatialMuxEnc : public Encoder
00134 {
00135 public:
00136
00139 SpatialMuxEnc(int deviceID, simth::DeviceSystemIntf* system,
00140 const simth::PropertyList& pl);
00145 int getDataLength(int codedLength) const;
00146
00151 int getCodeLength(int rawLength) const;
00152
00160 void Encode(const simth::ModSeq& modulation_symbols,
00161 CVectorSeq& output_vectors);
00162 };
00163
00164 class STBCAlamoutiEnc : public Encoder
00165 {
00166 private:
00167 unsigned num_carrier;
00168 public:
00169
00170 STBCAlamoutiEnc(int deviceID, simth::DeviceSystemIntf* system,
00171 const simth::PropertyList& pl);
00172 int getDataLength(int codedLength) const;
00173 int getCodeLength(int rawLength) const;
00174 void Encode(const simth::ModSeq& modulation_symbols,
00175 CVectorSeq& output_vectors);
00176 void startOfSimulation();
00177 void updateOutputLengths();
00178 void updateInputLengths();
00179 };
00180
00181 class SVDEnc : public Encoder
00182 {
00183 private:
00184 unsigned nr_dim;
00185 public:
00186
00189 SVDEnc(int deviceID, simth::DeviceSystemIntf* system,
00190 const simth::PropertyList& pl);
00192 virtual void updateInputLengths();
00194 virtual void updateOutputLengths();
00196 void process();
00197
00200 void Encode(const simth::ModSeq& modulation_symbols,
00201 CVectorSeq& output_vectors) {};
00202 int getDataLength(int codedLength) const { return 0; };
00203 int getCodeLength(int rawLength) const { return 0; };
00204 };
00205
00206 class AntennaSelEnc : public Encoder
00207 {
00208 private:
00209 unsigned nr_dim;
00210 public:
00211
00214 AntennaSelEnc(int deviceID, simth::DeviceSystemIntf* system,
00215 const simth::PropertyList& pl);
00217 virtual void updateInputLengths();
00219 virtual void updateOutputLengths();
00221 void process();
00222
00225 void Encode(const simth::ModSeq& modulation_symbols,
00226 CVectorSeq& output_vectors) {};
00227 int getDataLength(int codedLength) const { return 0; };
00228 int getCodeLength(int rawLength) const { return 0; };
00229
00230 static unsigned findMaxColIndex(const mimo::CMatrix& H);
00231 };
00232
00236 class RotAlamoutiEnc : public Encoder
00237 {
00238 private:
00239 unsigned num_carrier;
00240
00241 public:
00242 RotAlamoutiEnc(int deviceID, simth::DeviceSystemIntf* system,
00243 const simth::PropertyList& pl);
00244
00245 int getDataLength(int codedLength) const;
00246
00247 int getCodeLength(int rawLength) const;
00248
00249 void Encode(const simth::ModSeq& modulation_symbols,
00250 CVectorSeq& output_vectors);
00251
00252 void startOfSimulation();
00253
00254 void updateOutputLengths();
00255
00256 void updateInputLengths();
00257 };
00258
00259 }
00260
00261 #endif // MIMO_ENCODER_H