16#include "ns3/lte-chunk-processor.h"
17#include "ns3/lte-helper.h"
18#include "ns3/lte-phy-tag.h"
19#include "ns3/lte-spectrum-signal-parameters.h"
20#include "ns3/simulator.h"
21#include "ns3/spectrum-test.h"
62 (*rxPsd1)[0] = 1.255943215755e-15;
67 (*rxPsd2)[1] = 7.204059965732e-16;
70 (*theoreticalSinr1)[0] = 3.72589167251055;
71 (*theoreticalSinr1)[1] = 3.72255684126076;
76 "sdBm = [-46 -inf] and [-inf -48]"),
77 TestCase::Duration::QUICK);
82 "sdBm = [-46 -inf] and [-inf -48]"),
83 TestCase::Duration::QUICK);
90 (*rxPsd3)[0] = 2.505936168136e-17;
95 (*rxPsd4)[1] = 3.610582885110e-17;
98 (*theoreticalSinr2)[0] = 0.0743413124381667;
99 (*theoreticalSinr2)[1] = 0.1865697965291756;
104 "sdBm = [-63 -inf] and [-inf -61]"),
105 TestCase::Duration::QUICK);
110 "sdBm = [-63 -inf] and [-inf -61]"),
111 TestCase::Duration::QUICK);
128 :
TestCase(
"SINR calculation in uplink data frame: " + name),
131 m_sm(
sv1->GetSpectrumModel()),
150 uint16_t cellId = 100;
151 dlPhy->SetCellId(cellId);
152 ulPhy->SetCellId(cellId);
223 (*noisePsd)[0] = 5.000000000000e-19;
224 (*noisePsd)[1] = 4.545454545455e-19;
226 (*i1)[0] = 5.000000000000e-18;
227 (*i2)[0] = 5.000000000000e-16;
228 (*i3)[0] = 1.581138830084e-16;
229 (*i4)[0] = 7.924465962306e-17;
230 (*i1)[1] = 1.437398936440e-18;
231 (*i2)[1] = 5.722388235428e-16;
232 (*i3)[1] = 7.204059965732e-17;
233 (*i4)[1] = 5.722388235428e-17;
255 sp1->txPhy =
nullptr;
263 sp2->txPhy =
nullptr;
271 ip1->txPhy =
nullptr;
279 ip2->txPhy =
nullptr;
287 ip3->txPhy =
nullptr;
295 ip4->txPhy =
nullptr;
312 "Data Frame - Wrong SINR !");
325 :
TestCase(
"SINR calculation in uplink srs frame: " + name),
328 m_sm(
sv1->GetSpectrumModel()),
356 uint16_t cellId = 100;
357 dlPhy->SetCellId(cellId);
358 ulPhy->SetCellId(cellId);
399 (*noisePsd)[0] = 5.000000000000e-19;
400 (*noisePsd)[1] = 4.545454545455e-19;
402 (*i1)[0] = 5.000000000000e-18;
403 (*i2)[0] = 5.000000000000e-16;
404 (*i3)[0] = 1.581138830084e-16;
405 (*i4)[0] = 7.924465962306e-17;
406 (*i1)[1] = 1.437398936440e-18;
407 (*i2)[1] = 5.722388235428e-16;
408 (*i3)[1] = 7.204059965732e-17;
409 (*i4)[1] = 5.722388235428e-17;
432 sp1->txPhy =
nullptr;
440 sp2->txPhy =
nullptr;
448 ip1->txPhy =
nullptr;
456 ip2->txPhy =
nullptr;
464 ip3->txPhy =
nullptr;
472 ip4->txPhy =
nullptr;
488 "Data Frame - Wrong SINR !");
Test generation of SINR in the uplink.
Ptr< SpectrumValue > m_sv1
the spectrum value #1
Ptr< SpectrumValue > m_sv2
the spectrum value #2
void DoRun() override
Implementation to actually run this TestCase.
Ptr< const SpectrumModel > m_sm
the spectrum model
Ptr< SpectrumValue > m_expectedSinr
the expected SINR
~LteUplinkDataSinrTestCase() override
LteUplinkDataSinrTestCase(Ptr< SpectrumValue > sv1, Ptr< SpectrumValue > sv2, Ptr< SpectrumValue > sinr, std::string name)
Constructor.
Test 1.2 SINR calculation in uplink.
LteUplinkSinrTestSuite()
Test 1.2 SINR calculation in uplink.
In this test one signal will be of interest, i.e., the SRS of the first signal will have the same Cel...
void ReportSinr(const SpectrumValue &sinr)
Callback to be connected to an LteChunkProcessor to collect the reported SINR.
~LteUplinkSrsSinrTestCase() override
Ptr< SpectrumValue > m_actualSinr
the actual SINR
Ptr< const SpectrumModel > m_sm
the spectrum model
Ptr< SpectrumValue > m_expectedSinr
the expected SINR
void DoRun() override
Implementation to actually run this TestCase.
LteUplinkSrsSinrTestCase(Ptr< SpectrumValue > sv1, Ptr< SpectrumValue > sv2, Ptr< SpectrumValue > sinr, std::string name)
Constructor.
Ptr< SpectrumValue > m_sv2
the spectrum value #2
Ptr< SpectrumValue > m_sv1
the spectrum value #1
void StartRx(Ptr< SpectrumSignalParameters > params) override
Notify the SpectrumPhy instance of an incoming signal.
A sink to be plugged to the callback of LteChunkProcessor allowing to save and later retrieve the lat...
void ReportValue(const SpectrumValue &value)
function to be plugged to LteChunkProcessor::AddCallback ()
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Set of values corresponding to a given SpectrumModel.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
static LteUplinkSinrTestSuite lteUplinkSinrTestSuite
Static variable for test initialization.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#define NS_TEST_ASSERT_MSG_SPECTRUM_VALUE_EQ_TOL(actual, expected, tol, msg)
Test if two SpectrumValue instances are equal within a given tolerance.
#define NS_TEST_EXPECT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
std::vector< BandInfo > Bands
Container of BandInfo.
The building block of a SpectrumModel.
double fl
lower limit of subband