22 #include "ns3/simulator.h"
24 #include "ns3/string.h"
25 #include "ns3/double.h"
27 #include "ns3/boolean.h"
29 #include "ns3/mobility-helper.h"
30 #include "ns3/lte-helper.h"
32 #include "ns3/lte-ue-phy.h"
33 #include "ns3/lte-ue-net-device.h"
34 #include "ns3/lte-enb-phy.h"
35 #include "ns3/lte-enb-net-device.h"
36 #include "ns3/ff-mac-scheduler.h"
38 #include "ns3/lte-global-pathloss-database.h"
40 #include <ns3/lte-chunk-processor.h>
68 static std::string BuildNameString (
double orientationDegrees,
double beamwidthDegrees,
double x,
double y);
78 LteEnbAntennaTestCase (
double orientationDegrees,
double beamwidthDegrees,
double x,
double y,
double antennaGainDb);
83 virtual void DoRun (
void);
97 std::ostringstream oss;
98 oss <<
"o=" << orientationDegrees
99 <<
", bw=" << beamwidthDegrees
107 :
TestCase (BuildNameString (orientationDegrees, beamwidthDegrees,
x, y)),
108 m_orientationDegrees (orientationDegrees),
109 m_beamwidthDegrees (beamwidthDegrees),
112 m_antennaGainDb (antennaGainDb)
147 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
148 positionAlloc->
Add (Vector (
m_x,
m_y, 0.0));
150 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
151 mobility.SetPositionAllocator (positionAlloc);
172 lteHelper->
Attach (ueDevs, enbDevs.
Get (0));
184 testDlSinr->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinrCatcher));
190 testUlSinr->AddCallback (
MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinrCatcher));
200 MakeCallback (&DownlinkLteGlobalPathlossDatabase::UpdatePathloss, &dlPathlossDb));
202 MakeCallback (&UplinkLteGlobalPathlossDatabase::UpdatePathloss, &ulPathlossDb));
204 Simulator::Stop (
Seconds (0.035));
207 const double enbTxPowerDbm = 30;
208 const double ueTxPowerDbm = 10;
209 const double ktDbm = -174;
210 const double noisePowerDbm = ktDbm + 10 * std::log10 (25 * 180000);
211 const double ueNoiseFigureDb = 9.0;
212 const double enbNoiseFigureDb = 5.0;
217 double expectedSinrDl = enbTxPowerDbm +
m_antennaGainDb - noisePowerDbm + ueNoiseFigureDb;
218 if (expectedSinrDl > 0)
220 double calculatedSinrDbDl = -INFINITY;
223 calculatedSinrDbDl = 10.0 * std::log10 (dlSinrCatcher.
GetValue ()->operator[] (0));
226 double calculatedAntennaGainDbDl = - (enbTxPowerDbm - calculatedSinrDbDl - noisePowerDbm - ueNoiseFigureDb);
230 double expectedSinrUl = ueTxPowerDbm +
m_antennaGainDb - noisePowerDbm + enbNoiseFigureDb;
231 if (expectedSinrUl > 0)
233 double calculatedSinrDbUl = -INFINITY;
236 calculatedSinrDbUl = 10.0 * std::log10 (ulSinrCatcher.
GetValue ()->operator[] (0));
238 double calculatedAntennaGainDbUl = - (ueTxPowerDbm - calculatedSinrDbUl - noisePowerDbm - enbNoiseFigureDb);
244 double measuredLossDl = dlPathlossDb.
GetPathloss (1, 1);
246 double measuredLossUl = ulPathlossDb.
GetPathloss (1, 1);
250 Simulator::Destroy ();