2008年7月6日星期日

Propagation Threshold calculation

在ns-2.29/indep-utils/propagation/threshold.cc內可以得知,FreeSpace與TwoRayGround兩種model計算Pr的方式:

double TwoRay(double Pt, double Gt, double Gr, double ht, double hr, double L, double d, double lambda)
{
/*
* if d <>= crossover_dist, use two ray model
*
* Two-ray ground reflection model.
*
* Pt * Gt * Gr * (ht^2 * hr^2)
* Pr = ----------------------------
* d^4 * L
*
* The original equation in Rappaport's book assumes L = 1.
* To be consistant with the free space equation, L is added here.
*/

double Pr; // received power
double crossover_dist = (4 * M_PI * ht * hr) / lambda;

if (d < pr =" Friis(Pt," pr =" Pt">

Pr:在程式中即為RXThresh_也就是要在tcl所設定的數值
Pt = transmit power
Gt = transmit antenna gain
Gr = receive antenna gain
ht = transmit antenna height
hr = receive antenna height
d = distance (例如250m)

根據網路上鎖參考的資料,我們可以透過編譯threshold.cc來產生一個執行檔,再經由輸入相對應的參數至所產生的執行檔,即可得到RXThresh_,以下敘述如何產生出RXThresh_:

Step1.
ns-2.29/indep-utils/propagation/ 執行以下的編譯指令:
$g++ threshold.cc -o calculate

Step2.
若要執行計算某distance其相對應的RXThresh_,則執行以下指令:

$./calculate -m TwoRayGround -fr 3.5e+9 250

(計算model為TwoRayGround,且frequency為3.5MHz,距離250M)
如此即可計算出RXThresh_ .

没有评论: