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_DECODER_H
00029 #define _MIMO_DECODER_H
00030
00031
00032 #include <iostream>
00033 #include <complex>
00034
00035
00036 #include <simthetic/basicdevice.h>
00037 #include <simthetic/signals.h>
00038 #include <simthetic/misc.h>
00039
00040
00041 #include "matrixseq.h"
00042
00043 namespace mimo
00044 {
00045
00046
00047 class Decoder;
00048 std::ostream& operator<<(std::ostream &os, const Decoder &enc);
00049
00050
00065 class Decoder : public simth::Device
00066 {
00067 protected:
00069 unsigned nr_rx;
00071 unsigned nr_tx;
00072
00073 public:
00074
00077 Decoder(int deviceID, simth::DeviceSystemIntf* system,
00078 const simth::PropertyList& pl);
00079
00081 virtual ~Decoder();
00082
00084 virtual void updateInputLengths();
00086 virtual void updateOutputLengths();
00088 virtual void process();
00089
00106 virtual int getDataLength(int codedLength) const =0;
00107
00121 virtual int getCodeLength(int rawLength) const =0;
00122
00152 virtual void Decode(const CVectorSeq& input_vectors,
00153 const MatrixFreqSignal& channel_estimation,
00154 simth::ModSeq& output_symbols,
00155 simth::ModSeq* output_softout) = 0;
00156
00157
00159 virtual void print(std::ostream &os) const;
00160
00161
00162
00163
00164 };
00165
00166
00171 class SpatialMuxDecZF : public Decoder
00172 {
00173 public:
00176 SpatialMuxDecZF(int deviceID, simth::DeviceSystemIntf* system,
00177 const simth::PropertyList& pl);
00182 int getDataLength(int codedLength) const
00183 { return codedLength*nr_tx; }
00184
00189 int getCodeLength(int rawLength) const
00190 { return rawLength/nr_tx; }
00191
00196 void Decode(const CVectorSeq& input_vectors,
00197 const MatrixFreqSignal& channel_estimation,
00198 simth::ModSeq& output_symbols,
00199 simth::ModSeq* output_softout);
00200
00203 static void vectors_to_values(const CVectorSeq& vseq,
00204 simth::ModSeq& oseq);
00215 static void vectors_to_llrvalues(const CVectorSeq& vseq,
00216 simth::ModSeq& oseq);
00217 };
00218
00224 class SpatialMuxDecMMSE : public SpatialMuxDecZF
00225 {
00226 private:
00227 double noise;
00228
00229 public:
00232 SpatialMuxDecMMSE(int deviceID, simth::DeviceSystemIntf* system,
00233 const simth::PropertyList& pl);
00234
00239 void Decode(const CVectorSeq& input_vectors,
00240 const MatrixFreqSignal& channel_estimation,
00241 simth::ModSeq& output_symbols,
00242 simth::ModSeq* output_softout);
00243
00247 void setSNR(double snr);
00248 };
00249
00250
00251
00257 class STBCAlamoutiDec : public Decoder
00258 {
00259 private:
00260 unsigned num_carrier;
00261
00262 public:
00265 STBCAlamoutiDec(int deviceID, simth::DeviceSystemIntf* system,
00266 const simth::PropertyList& pl);
00269 int getDataLength(int codedLength) const;
00272 int getCodeLength(int rawLength) const;
00273
00275 void Decode(const CVectorSeq& input_vectors,
00276 const MatrixFreqSignal& channel_estimation,
00277 simth::ModSeq& output_symbols,
00278 simth::ModSeq* output_softout);
00279
00282 void startOfSimulation();
00285 void updateOutputLengths();
00288 void updateInputLengths();
00289 };
00290
00291
00292
00293 class SVDDec : public Decoder
00294 {
00295 private:
00296 unsigned nr_dim;
00297 public:
00298
00301 SVDDec(int deviceID, simth::DeviceSystemIntf* system,
00302 const simth::PropertyList& pl);
00307 int getDataLength(int codedLength) const;
00308
00313 int getCodeLength(int rawLength) const;
00314
00317 void Decode(const CVectorSeq& input_vectors,
00318 const MatrixFreqSignal& channel_estimation,
00319 simth::ModSeq& output_symbols,
00320 simth::ModSeq* output_softout);
00321 };
00322
00323
00326 class AntennaSelDec : public Decoder
00327 {
00328 private:
00329 unsigned nr_dim;
00330 public:
00331
00334 AntennaSelDec(int deviceID, simth::DeviceSystemIntf* system,
00335 const simth::PropertyList& pl);
00340 int getDataLength(int codedLength) const;
00341 void updateInputLengths();
00342
00347 int getCodeLength(int rawLength) const;
00348
00351 void Decode(const CVectorSeq& input_vectors,
00352 const MatrixFreqSignal& channel_estimation,
00353 simth::ModSeq& output_symbols,
00354 simth::ModSeq* output_softout) {};
00355
00358 void process();
00359 };
00360
00361
00363
00367 class RotAlamoutiDec : public Decoder
00368 {
00369 private:
00370 unsigned num_carrier;
00371
00372 public:
00373 RotAlamoutiDec(int deviceID, simth::DeviceSystemIntf* system,
00374 const simth::PropertyList& pl);
00375
00376 int getDataLength(int codedLength) const;
00377
00378 int getCodeLength(int rawLength) const;
00379
00380 void Decode(const CVectorSeq& input_vectors,
00381 const MatrixFreqSignal& channel_estimation,
00382 simth::ModSeq& output_symbols,
00383 simth::ModSeq* output_softout);
00384
00385 void startOfSimulation();
00386
00387 void updateOutputLengths();
00388
00389 void updateInputLengths();
00390 };
00391
00392 }
00393
00394 #endif // _MIMO_DECODER_H