00001 /*-*-c++-*-***************************************************************** 00002 fadingmimochannel.h - MIMO channel classes 00003 ------------------- 00004 begin : Feb 2003 00005 copyright : (C) 2003 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 00030 #ifndef FADINGMIMOCHANNEL_H 00031 #define FADINGMIMOCHANNEL_H 00032 00033 #include <simthetic/phbib.h> 00034 #include <simthetic/phrand.h> 00035 #include <simthetic/signals.h> 00036 #include <simthetic/basicdevice.h> 00037 00038 #include "mimo-channel.h" 00039 00040 // MIMO channels are only available if the matrix data types are 00041 // available 00042 00043 namespace simthlib { 00044 class OfdmReceiver; 00045 class OfdmTransmitter; 00046 } 00047 00048 namespace mimo { 00049 00050 //-------------------------------------------------------------------- 00051 00083 class FadingMIMOChannel : public MIMOChannel 00084 { 00085 protected: 00086 00088 double sigma; 00089 00091 RayleighRng ray; 00092 00094 double normFactor; 00095 00096 // Needed for broadband Rayleigh fading channel 00097 simthlib::OfdmReceiver *ofdm_recv; 00098 simthlib::OfdmTransmitter *ofdm_trans; 00099 00100 // Needed for broadband Rayleigh fading channel 00101 unsigned num_carrier; 00102 double carrier_dist; 00103 unsigned maxantenna; 00104 00105 // Needed for broadband Rayleigh fading channel 00106 std::vector<TimeSignal::storage_type*> time_samples; 00107 std::vector<ModSeq*> freq_samples; 00108 CVectorSeq::storage_type freq_vectors_in; 00109 CVectorSeq::storage_type freq_vectors_out; 00110 00111 public: 00113 FadingMIMOChannel(int deviceID, 00114 DeviceSystemIntf* system, 00115 const simth::PropertyList& pl); 00116 00118 virtual ~FadingMIMOChannel(); 00119 00121 virtual void refresh(); 00122 00123 00124 void getTransfer(int relative_time, MatrixFreqSignal& trans) const; 00125 00127 void transmit(const VectorTimeSignal &sym, VectorTimeSignal& outsym); 00128 00129 virtual void print(std::ostream &os) const; 00130 00131 }; 00132 00163 class CmplFadingMIMOChannel : public FadingMIMOChannel 00164 { 00165 private: 00166 GaussRng real; 00167 GaussRng imag; 00168 00169 public: 00171 CmplFadingMIMOChannel(int deviceID, 00172 DeviceSystemIntf* system, 00173 const simth::PropertyList& pl); 00174 00176 virtual ~CmplFadingMIMOChannel(); 00177 00179 void refresh(); 00180 virtual void print(std::ostream &os) const; 00181 }; 00182 00186 class FileFadingChannel : public FadingMIMOChannel 00187 { 00188 private: 00189 std::string filename; 00190 00191 public: 00193 FileFadingChannel(int deviceID, 00194 DeviceSystemIntf* system, 00195 const simth::PropertyList& pl); 00196 00198 virtual ~FileFadingChannel(); 00199 00201 void refresh(); 00202 }; 00203 00204 00205 } //namespace 00206 00207 #endif // FADINGMIMOCHANNEL