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 00082 class FadingMIMOChannel : public MIMOChannel 00083 { 00084 protected: 00085 00087 double sigma; 00088 00090 RayleighRng ray; 00091 00093 double normFactor; 00094 00095 // Needed for broadband Rayleigh fading channel 00096 simthlib::OfdmReceiver *ofdm_recv; 00097 simthlib::OfdmTransmitter *ofdm_trans; 00098 00099 // Needed for broadband Rayleigh fading channel 00100 unsigned num_carrier; 00101 double carrier_dist; 00102 unsigned maxantenna; 00103 00104 // Needed for broadband Rayleigh fading channel 00105 std::vector<TimeSignal::storage_type*> time_samples; 00106 std::vector<ModSeq*> freq_samples; 00107 CVectorSeq::storage_type freq_vectors_in; 00108 CVectorSeq::storage_type freq_vectors_out; 00109 00110 public: 00112 FadingMIMOChannel(int deviceID, 00113 DeviceSystemIntf* system, 00114 const simth::PropertyList& pl); 00115 00117 virtual ~FadingMIMOChannel(); 00118 00120 virtual void refresh(); 00121 00122 00123 void getTransfer(int relative_time, MatrixFreqSignal& trans) const; 00124 00126 void transmit(const VectorTimeSignal &sym, VectorTimeSignal& outsym); 00127 00128 virtual void print(std::ostream &os) const; 00129 00130 }; 00131 00140 class CmplFadingMIMOChannel : public FadingMIMOChannel 00141 { 00142 private: 00143 GaussRng real; 00144 GaussRng imag; 00145 00146 public: 00148 CmplFadingMIMOChannel(int deviceID, 00149 DeviceSystemIntf* system, 00150 const simth::PropertyList& pl); 00151 00153 virtual ~CmplFadingMIMOChannel(); 00154 00156 void refresh(); 00157 virtual void print(std::ostream &os) const; 00158 }; 00159 00160 } //namespace 00161 00162 #endif // FADINGMIMOCHANNEL
1.3.2