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
00144 virtual void Decode(const CVectorSeq& input_vectors,
00145 const MatrixFreqSignal& channel_estimation,
00146 simth::ModSeq& output_symbols,
00147 simth::LlrSeq* output_softout) = 0;
00148
00149
00151 virtual void print(std::ostream &os) const;
00152
00153
00154
00155
00156 };
00157
00158
00163 class SpatialMuxDecZF : public Decoder
00164 {
00165 public:
00168 SpatialMuxDecZF(int deviceID, simth::DeviceSystemIntf* system,
00169 const simth::PropertyList& pl);
00174 int getDataLength(int codedLength) const
00175 { return codedLength*nr_tx; }
00176
00181 int getCodeLength(int rawLength) const
00182 { return rawLength/nr_tx; }
00183
00188 void Decode(const CVectorSeq& input_vectors,
00189 const MatrixFreqSignal& channel_estimation,
00190 simth::ModSeq& output_symbols,
00191 simth::LlrSeq* output_softout);
00192
00195 static void vectors_to_values(const CVectorSeq& vseq,
00196 simth::ModSeq& oseq);
00207 static void vectors_to_llrvalues(const CVectorSeq& vseq,
00208 simth::LlrSeq& oseq);
00209 };
00210
00216 class SpatialMuxDecMMSE : public SpatialMuxDecZF
00217 {
00218 private:
00219 double noise;
00220
00221 public:
00224 SpatialMuxDecMMSE(int deviceID, simth::DeviceSystemIntf* system,
00225 const simth::PropertyList& pl);
00226
00231 void Decode(const CVectorSeq& input_vectors,
00232 const MatrixFreqSignal& channel_estimation,
00233 simth::ModSeq& output_symbols,
00234 simth::LlrSeq* output_softout);
00235
00239 void setSNR(double snr);
00240 };
00241
00242
00243
00249 class STBCAlamoutiDec : public Decoder
00250 {
00251 private:
00252 unsigned num_carrier;
00253
00254 public:
00257 STBCAlamoutiDec(int deviceID, simth::DeviceSystemIntf* system,
00258 const simth::PropertyList& pl);
00261 int getDataLength(int codedLength) const;
00264 int getCodeLength(int rawLength) const;
00265
00267 void Decode(const CVectorSeq& input_vectors,
00268 const MatrixFreqSignal& channel_estimation,
00269 simth::ModSeq& output_symbols,
00270 simth::LlrSeq* output_softout);
00271
00274 void startOfSimulation();
00277 void updateOutputLengths();
00280 void updateInputLengths();
00281 };
00282
00283
00284
00285 class SVDDec : public Decoder
00286 {
00287 private:
00288 unsigned nr_dim;
00289 public:
00290
00293 SVDDec(int deviceID, simth::DeviceSystemIntf* system,
00294 const simth::PropertyList& pl);
00299 int getDataLength(int codedLength) const;
00300
00305 int getCodeLength(int rawLength) const;
00306
00309 void Decode(const CVectorSeq& input_vectors,
00310 const MatrixFreqSignal& channel_estimation,
00311 simth::ModSeq& output_symbols,
00312 simth::LlrSeq* output_softout);
00313 };
00314
00315 }
00316
00317 #endif // _MIMO_DECODER_H