22 #include "ns3/double.h"
44 .AddConstructor<UanNoiseModelDefault> ()
45 .AddAttribute (
"Wind",
"Wind speed in m/s.",
48 MakeDoubleChecker<double> (0))
49 .AddAttribute (
"Shipping",
"Shipping contribution to noise between 0 and 1.",
52 MakeDoubleChecker<double> (0,1))
62 double turb, wind, ship, thermal;
63 double turbDb, windDb, shipDb, thermalDb, noiseDb;
65 turbDb = 17.0 - 30.0 * std::log10 (fKhz);
66 turb = std::pow (10.0, turbDb * 0.1);
68 shipDb = 40.0 + 20.0 * (
m_shipping - 0.5) + 26.0 * std::log10 (fKhz) - 60.0 * std::log10 (fKhz + 0.03);
69 ship = std::pow (10.0, (shipDb * 0.1));
71 windDb = 50.0 + 7.5 * std::pow (
m_wind, 0.5) + 20.0 * std::log10 (fKhz) - 40.0 * std::log10 (fKhz + 0.4);
72 wind = std::pow (10.0, windDb * 0.1);
74 thermalDb = -15 + 20 * std::log10 (fKhz);
75 thermal = std::pow (10, thermalDb * 0.1);
77 noiseDb = 10 * std::log10 (turb + ship + wind + thermal);
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
double m_shipping
Shipping contribution to noise between 0 and 1.
double m_wind
Wind speed in m/s.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Register this type.
virtual double GetNoiseDbHz(double fKhz) const
Compute the noise power at a given frequency.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual ~UanNoiseModelDefault()
Dummy destructor, DoDispose.
A base class which provides memory management and object aggregation.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
UanNoiseModelDefault()
Default constructor.