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

mimo-encoder.h

Go to the documentation of this file.
00001 /*-*-c++-*-*****************************************************************
00002                           encoder.h  -  description
00003                              -------------------
00004     begin                : Don Mai 16 2002
00005     copyright            : (C) 2002 by Peter Haase
00006     email                : mail@p-haase.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_ENCODER_H
00029 #define MIMO_ENCODER_H
00030 
00031 #include <iostream>
00032 #include <complex>
00033 
00034 // Simthetic includes
00035 #include <simthetic/basicdevice.h>
00036 #include <simthetic/signals.h>
00037 #include <simthetic/misc.h>
00038 
00039 // Mimolib includes
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     // The factory method init() has been removed because now the
00128     // object generation is done by the direct factory functions
00129     // inside DeviceFactory.
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 } // namespace
00260 
00261 #endif // MIMO_ENCODER_H

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