Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class 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 
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     // The factory method init() has been removed because now the
00162     // object generation is done by the direct factory functions
00163     // inside DeviceFactory.
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 } // namespace
00393 
00394 #endif // _MIMO_DECODER_H

Generated on Tue Aug 9 14:43:10 2005 for mimolib by  doxygen 1.4.1