wifi: Move log2 to wifi utils
This commit is contained in:
@@ -23,6 +23,13 @@
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
double
|
||||
Log2 (double val)
|
||||
{
|
||||
return std::log (val) / std::log (2.0);
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
DbToRatio (double dB)
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user