Bug 1576 - Frequency units HERTZ & MEGAHERTZ mix up
Frequency units HERTZ & MEGAHERTZ mix up
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: propagation
pre-release
PC Linux
: P5 enhancement
Assigned To: Kirill Andreev
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-01 09:48 UTC by Nicola Baldo
Modified: 2013-04-08 05:57 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicola Baldo 2013-02-01 09:48:13 UTC
Reported by Kevin Macdonald <kmac@loxcel.com>:


This snippet is from the function OkumuraHataPropagationLossModel::GetLoss ()


         if (m_frequency < 200)
            {
              log_bHeight = 8.29 * pow (log10 (1.54 * hm), 2) -  1.1;
            }
          else
            {
              log_bHeight = 3.2 * pow (log10 (11.75 * hm), 2) - 4.97;
            }


The Okumura-Hata model does indeed switch at 200, but the units are
MEGAHERTZ and not HERTZ.

However, the units for m_frequency is HERTZ, and this is where the problem lies.


Instead, the if condition above should reference fmhz, which is
defined below, instead of m_frequency:

double fmhz = m_frequency / 1e6;


And here is how I think the code snippet above should appear:

         if (fmhz < 200)
            {
              log_bHeight = 8.29 * pow (log10 (1.54 * hm), 2) -  1.1;
            }
          else
            {
              log_bHeight = 3.2 * pow (log10 (11.75 * hm), 2) - 4.97;
            }
Comment 1 Brian Swenson 2013-04-05 15:52:38 UTC
Any reason not to commit this for upcoming build?
Comment 2 Nicola Baldo 2013-04-08 05:57:23 UTC
fixed in changeset 01cda0150630