00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _UWBIRIEEE802154APATHLOSSMODEL_H
00022 #define _UWBIRIEEE802154APATHLOSSMODEL_H
00023
00024 #include "AnalogueModel.h"
00025 #include "MappingUtils.h"
00026 #include "Signal_.h"
00027 #include "BaseWorldUtility.h"
00028 #include "IEEE802154A.h"
00029
00030 #include "Move.h"
00031 #include "SimpleTimeConstMapping.h"
00032 #include <math.h>
00033 #include <limits>
00034
00064 class UWBIRIEEE802154APathlossModel : public AnalogueModel {
00065
00066 public:
00067
00068
00069
00070
00071 UWBIRIEEE802154APathlossModel(int _channelModel, double _threshold, const Move* _move, bool shadowing=true):
00072 channelModel(_channelModel), tapThreshold(_threshold), doShadowing(shadowing),
00073 doSmallScaleShadowing(false), move(_move), nbCalls(0) {
00074
00075 assert(implemented_CMs[channelModel]);
00076
00077 cfg = CMconfigs[channelModel];
00078 averagePowers.setName("averagePower");
00079 pathlosses.setName("pathloss");
00080 }
00081
00082
00083
00084
00085 void filterSignal(Signal& s);
00086
00087
00088
00089
00090 double Rayleigh(double param);
00091
00092
00093
00094 static const bool implemented_CMs[];
00095
00096 struct CMconfig {
00097 double PL0;
00098 double n;
00099 double sigma_s;
00100 double Aant;
00101 double kappa;
00102 double Lmean;
00103 double Lambda;
00104
00105 double lambda_1, lambda_2, Beta;
00106 double Gamma;
00107 double k_gamma, gamma_0;
00108 double sigma_cluster;
00109 double m_0, k_m;
00110 double var_m_0, var_k_m;
00111 double strong_m_0;
00112
00113 double gamma_rise; double gamma_1; double xi;
00114 };
00115
00116
00117
00118 static const CMconfig CMconfigs[];
00119
00120
00121 protected:
00122
00125 int channelModel;
00126
00127
00128
00129 CMconfig cfg;
00130
00131
00132 double tapThreshold;
00133
00134 double doShadowing;
00135 double doSmallScaleShadowing;
00136
00137
00138
00139
00140 static const double PL0 = 0.000040738;
00141 static const double pathloss_exponent = 1.79;
00142 static const double meanL = 3;
00143 static const double Lambda = 0.047E9;
00144 static const double lambda1 = 1.54E9;
00145 static const double lambda2 = 0.15E9;
00146 static const double Beta = 0.095;
00147 static const double Gamma = 22.61E-9;
00148 static const double k_gamma = 0;
00149 static const double gamma_0 = 12.53 * 0.001 * 0.001 * 0.01;
00150 static const double sigma_cluster = 1.883649089;
00151
00152 static const double fc = 4.492E9;
00153 static const double BW = 500E6;
00154 static const double fcMHz = 4492;
00155
00156 static const double d0 = 1;
00157
00158
00159 static const double ntx = 1;
00160 static const double nrx = 1;
00161
00162
00163 const Move* move;
00164 TimeMapping<Linear>* newTxPower;
00165 ConstMapping* txPower;
00166 Argument arg;
00167 MappingIterator* pulsesIter;
00168
00169 double L;
00170
00171 double S;
00172
00173 simtime_t clusterStart;
00174 simtime_t gamma_l;
00175 double Mcluster;
00176
00177 double Omega_l;
00178
00179 double distance;
00180
00181 double averagePower;
00182 long nbCalls;
00183 cOutVector averagePowers;
00184 cOutVector pathlosses;
00185
00186
00187
00188
00189 void addEchoes(simtime_t pulseStart);
00190
00191
00192
00193
00194 double getPathloss(double fc, double BW);
00195
00196 };
00197
00198 #endif
00199