[Tinyos-help] Question about Noise and linkLayerModel.java in TOSSIM
EunKyung Lee
ssinji79 at gmail.com
Fri Feb 29 13:24:33 PST 2008
Hello.
We want to know how Tossim is generating LinkGain btw the nodes.
and calculation. and trying to verify that this model is correct.
Actually they are using Covariance Matrix to define Link status but we can't
understand following functions:
S11 : variance of noise floor
S12 : covariance between noise floor and output power (captures correlation)
S21 : equal to S12
S22 : variance of output power
t11 = Math.sqrt(inVar.s11);
t12 = inVar.s12/Math.sqrt(inVar.s11);
t21 = 0;
t22 = Math.sqrt( (inVar.s11*inVar.s22 - Math.pow( inVar.s12, 2)) /
inVar.s11 );
This calculation when the link is asymmetric.
Can anybody explain about this?
Any help or short comment will be appreciated..
--------------------------------------The whole function is
following--------------
/**
* Obtains output power and noise floor for all nodes in the network
*
* @param inVar class that contains radio parameters
* @param outVar class that stores output powers and noise floors
* @return true if all output powers and noise floors were obtained
correctly
*/
protected static boolean obtainRadioPtPn ( InputVariables inVar,
OutputVariables outVar )
{
Random rand = new Random();
int i, j;
double t11, t12, t21, t22;
double rn1, rn2;
t11 = 0;
t12 = 0;
t21 = 0;
t22 = 0;
if ( (inVar.s11 == 0) && (inVar.s22 == 0) ) { // symmetric links do
nothing
}
else if ( (inVar.s11 == 0) && (inVar.s22 != 0) ) { // both S11 and S22
must be 0 for symmetric links
System.out.println("\nError: symmetric links require both, S11 and S22
to be 0, not only S11.");
System.exit(1);
}
else {
if ( (inVar.s12 != inVar.s21) ) { // check that S is symmetric
System.out.println("\nError: S12 and S21 must have the same
value.");
System.exit(1);
}
if ( Math.abs(inVar.s12) > Math.sqrt(inVar.s11*inVar.s22) ) { // check
that correlation is within [-1,1]
System.out.println("\nError: S12 (and S21) must be less than
sqrt(S11xS22).");
System.exit(1);
}
t11 = Math.sqrt(inVar.s11);
t12 = inVar.s12/Math.sqrt(inVar.s11);
t21 = 0;
t22 = Math.sqrt( (inVar.s11*inVar.s22 - Math.pow( inVar.s12, 2)) /
inVar.s11 );
}
for (i = 0; i < inVar.numNodes; i = i+1) {
rn1 = rand.nextGaussian();
rn2 = rand.nextGaussian();
outVar.noisefloor[i] = inVar.pn + t11 * rn1;
outVar.outputpowervar[i] = t12 * rn1 + t22 * rn2;
}
return true;
}
--
Eun Kyung Lee
Rutgers, The State University of New Jersey
Department of Electrical and Computer Eng.(ECE)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080229/99895a6e/attachment.html
More information about the Tinyos-help
mailing list