[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tossim CpmModelC.nc, 1.11, 1.12
SunHee Yoon
sunheeyoon at users.sourceforge.net
Mon May 25 23:11:53 PDT 2009
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154 PibP.nc, 1.9, 1.10 ScanP.nc, 1.10, 1.11
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154 BeaconRequestRxP.nc, 1.2, 1.3 BeaconTransmitP.nc, 1.9, 1.10 TKN154_MAC.h, 1.8, 1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22141
Modified Files:
CpmModelC.nc
Log Message:
fixed prr_estimate_from_snr function
Index: CpmModelC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/CpmModelC.nc,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** CpmModelC.nc 5 Feb 2009 22:45:41 -0000 1.11
--- CpmModelC.nc 26 May 2009 06:11:51 -0000 1.12
***************
*** 220,234 ****
double prr_estimate_from_snr(double SNR) {
! double beta1 = 1.3687;
! double beta2 = 0.9187;
! double SNR_lin = pow(10.0, SNR/10.0);
! double X = fabs(SNR_lin-beta2);
! double PSE = 0.5*erfc(beta1*sqrt(X/2));
double prr_hat = pow(1-PSE, 23*2);
dbg("CpmModelC,SNR", "SNR is %lf, PRR is %lf\n", SNR, prr_hat);
if (prr_hat > 1)
! prr_hat = 1;
else if (prr_hat < 0)
! prr_hat = 0;
return prr_hat;
--- 220,236 ----
double prr_estimate_from_snr(double SNR) {
! // Based on CC2420 measurement by Kannan.
! // The updated function below fixes the problem of non-zero PRR
! // at very low SNR. With this function PRR is 0 for SNR <= 3.
! double beta1 = 0.9794;
! double beta2 = 2.3851;
! double X = SNR-beta2;
! double PSE = 0.5*erfc(beta1*X/sqrt(2));
double prr_hat = pow(1-PSE, 23*2);
dbg("CpmModelC,SNR", "SNR is %lf, PRR is %lf\n", SNR, prr_hat);
if (prr_hat > 1)
! prr_hat = 1.1;
else if (prr_hat < 0)
! prr_hat = -0.1;
return prr_hat;
***************
*** 238,242 ****
double prr = prr_estimate_from_snr(SNR);
double coin = RandomUniform();
! if ( (prr != 0) && (prr != 1) ) {
if (coin < prr)
prr = 1.0;
--- 240,244 ----
double prr = prr_estimate_from_snr(SNR);
double coin = RandomUniform();
! if ( (prr >= 0) && (prr <= 1) ) {
if (coin < prr)
prr = 1.0;
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154 PibP.nc, 1.9, 1.10 ScanP.nc, 1.10, 1.11
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154 BeaconRequestRxP.nc, 1.2, 1.3 BeaconTransmitP.nc, 1.9, 1.10 TKN154_MAC.h, 1.8, 1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list