Hi,
I am using lr-wpan module and LogDistance model for propagation loss. In my experiment I am giving Tx power to my node and want to calculate the Rx power at a certain distance with given input parameters (frequency, modulation, exponent, receiver sensitivity etc.)
My understanding is that the loss in signal power should be difference between Tx power and Rx power.
In the file src/propagation/model/propagation-loss-model.cc, (NS 3.25), Line no. 504
Function: LogDistancePropagationLossModel::DoCalcRxPower
{
double distance = a->GetDistanceFrom (b);
if (distance <= m_referenceDistance)
{
return txPowerDbm;
}
double pathLossDb = 10 * m_exponent * std::log10 (distance / m_referenceDistance);
double rxc = -m_referenceLoss - pathLossDb;
return txPowerDbm + rxc
}
Output expected from the function is: return Rx power of the signal
I have following three queries:
1. The function always assumes tx power as 0 dBm i.e. the value of variable txPowerDbm is always 0. This means it is ignoring any transmit power I give to my node. It seems confusing to me.
2. In this condition above (distance <= m_referenceDistance), I think function should return (txPowerDbm- m_referenceLoss) instead of just txPowerDbm.
3. The variable “txPowerDbm” conveys that tx power is being used in dBm. But is it actually using “dB” in the calculation because losses are being used in dB. So looks to me a unit mismatch here or variable naming issue.
Please provide your guidance. If my question is very basic, please still provide your guidance as I want to correct my understanding too.