22 #include "wifi-spectrum-value-helper.h"
27 Ptr<SpectrumModel> g_WifiSpectrumModel5Mhz;
29 WifiSpectrumValueHelper::~WifiSpectrumValueHelper ()
33 WifiSpectrumValue5MhzFactory::~WifiSpectrumValue5MhzFactory ()
43 for (
int i = -4; i < 13 + 7; i++)
46 bi.
fl = 2407.0e6 + i * 5.0e6;
47 bi.
fh = 2407.0e6 + (i + 1) * 5.0e6;
48 bi.
fc = (bi.
fl + bi.
fh) / 2;
51 g_WifiSpectrumModel5Mhz = Create<SpectrumModel> (bands);
53 } g_WifiSpectrumModel5MhzInitializerInstance;
58 WifiSpectrumValue5MhzFactory::CreateConstant (
double v)
67 WifiSpectrumValue5MhzFactory::CreateTxPowerSpectralDensity (
double txPower, uint32_t channel)
69 Ptr<SpectrumValue> txPsd = Create <SpectrumValue> (g_WifiSpectrumModel5Mhz);
78 double txPowerDensity = txPower / 20e6;
83 (*txPsd)[channel - 1] = txPowerDensity * 1e-4;
84 (*txPsd)[channel] = txPowerDensity * 1e-4;
85 (*txPsd)[channel + 1] = txPowerDensity * 0.0015849;
86 (*txPsd)[channel + 2] = txPowerDensity * 0.0015849;
87 (*txPsd)[channel + 3] = txPowerDensity;
88 (*txPsd)[channel + 4] = txPowerDensity;
89 (*txPsd)[channel + 5] = txPowerDensity;
90 (*txPsd)[channel + 6] = txPowerDensity;
91 (*txPsd)[channel + 7] = txPowerDensity * 0.0015849;
92 (*txPsd)[channel + 8] = txPowerDensity * 0.0015849;
93 (*txPsd)[channel + 9] = txPowerDensity * 1e-4;
94 (*txPsd)[channel + 10] = txPowerDensity * 1e-4;
101 WifiSpectrumValue5MhzFactory::CreateRfFilter (uint32_t channel)
103 Ptr<SpectrumValue> rf = Create <SpectrumValue> (g_WifiSpectrumModel5Mhz);
108 (*rf)[channel - 1] = 1;
110 (*rf)[channel + 1] = 1;
111 (*rf)[channel + 2] = 1;
smart pointer class similar to boost::intrusive_ptr
#define NS_ASSERT(condition)
double fc
center frequency
double fl
lower limit of subband
double fh
upper limit of subband