Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

mimo-decoder.h

Go to the documentation of this file.
00001 /*-*-c++-*-*****************************************************************
00002                           mimo-decoder.h  -  description
00003                              -------------------
00004     begin                : Mon Feb 23, 2004
00005     copyright            : (C) 2004 by Christian Stimming
00006     email                : stimming@tuhh.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 _MIMO_DECODER_H
00029 #define _MIMO_DECODER_H
00030 
00031 // libstdc++ includes
00032 #include <iostream>
00033 #include <complex>
00034 
00035 // Simthetic includes
00036 #include <simthetic/basicdevice.h>
00037 #include <simthetic/signals.h>
00038 #include <simthetic/misc.h>
00039 
00040 // Mimolib includes
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     // The factory method init() has been removed because now the
00154     // object generation is done by the direct factory functions
00155     // inside DeviceFactory.
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 } // namespace
00316 
00317 #endif // _MIMO_DECODER_H

Generated on Fri Jul 23 16:27:47 2004 for mimolib by doxygen 1.3.2