wifi: Move log2 to wifi utils

This commit is contained in:
Sébastien Deronne
2017-06-26 22:38:46 +02:00
parent 11f470b1ff
commit 349007d583
4 changed files with 16 additions and 14 deletions

View File

@@ -23,6 +23,13 @@
namespace ns3 {
double
Log2 (double val)
{
return std::log (val) / std::log (2.0);
}
double
DbToRatio (double dB)
{

View File

@@ -27,6 +27,14 @@
namespace ns3 {
/**
* Return the logarithm of the given value to base 2.
*
* \param val
*
* \return the logarithm of val to base 2.
*/
double Log2 (double val);
/**
* Convert from dBm to Watts.
*

View File

@@ -20,6 +20,7 @@
*/
#include "yans-error-rate-model.h"
#include "wifi-utils.h"
#include "wifi-phy.h"
#include "ns3/log.h"
@@ -44,12 +45,6 @@ YansErrorRateModel::YansErrorRateModel ()
{
}
double
YansErrorRateModel::Log2 (double val) const
{
return std::log (val) / std::log (2.0);
}
double
YansErrorRateModel::GetBpskBer (double snr, uint32_t signalSpread, uint64_t phyRate) const
{

View File

@@ -66,14 +66,6 @@ public:
private:
/**
* Return the logarithm of the given value to base 2.
*
* \param val
*
* \return the logarithm of val to base 2.
*/
double Log2 (double val) const;
/**
* Return BER of BPSK with the given parameters.
*