|
|
|
@ -22,16 +22,13 @@
|
|
|
|
|
|
|
|
|
|
#include "ns3/log.h" |
|
|
|
|
|
|
|
|
|
// #include "ns3/packet.h"
|
|
|
|
|
// #include "ns3/simulator.h"
|
|
|
|
|
// #include "ns3/lte-spectrum-phy.h"
|
|
|
|
|
#include "ns3/lte-phy-tag.h" |
|
|
|
|
#include "ns3/lte-ue-phy.h" |
|
|
|
|
#include "ns3/lena-test-sinr-chunk-processor.h" |
|
|
|
|
#include "ns3/lte-test-sinr-chunk-processor.h" |
|
|
|
|
|
|
|
|
|
#include "ns3/lena-test-downlink-sinr.h" |
|
|
|
|
#include "ns3/lte-test-downlink-sinr.h" |
|
|
|
|
|
|
|
|
|
NS_LOG_COMPONENT_DEFINE ("LenaDownlinkSinrTest"); |
|
|
|
|
NS_LOG_COMPONENT_DEFINE ("LteDownlinkSinrTest"); |
|
|
|
|
|
|
|
|
|
using namespace ns3; |
|
|
|
|
|
|
|
|
@ -44,15 +41,15 @@ using namespace ns3;
|
|
|
|
|
* TestSuite |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
LenaDownlinkSinrTestSuite::LenaDownlinkSinrTestSuite () |
|
|
|
|
: TestSuite ("lena-downlink-sinr", SYSTEM) |
|
|
|
|
LteDownlinkSinrTestSuite::LteDownlinkSinrTestSuite () |
|
|
|
|
: TestSuite ("lte-downlink-sinr", SYSTEM) |
|
|
|
|
{ |
|
|
|
|
LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL); |
|
|
|
|
|
|
|
|
|
LogComponentEnable ("LenaTestSinrChunkProcessor", logLevel); |
|
|
|
|
LogComponentEnable ("LenaDownlinkSinrTest", logLevel); |
|
|
|
|
LogComponentEnable ("LteTestSinrChunkProcessor", logLevel); |
|
|
|
|
LogComponentEnable ("LteDownlinkSinrTest", logLevel); |
|
|
|
|
|
|
|
|
|
NS_LOG_INFO ("Creating LenaDownlinkSinrTestSuite"); |
|
|
|
|
NS_LOG_INFO ("Creating LteDownlinkSinrTestSuite"); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Build Spectrum Model values for the TX signal |
|
|
|
@ -85,7 +82,7 @@ LenaDownlinkSinrTestSuite::LenaDownlinkSinrTestSuite ()
|
|
|
|
|
(*theoreticalSinr1)[0] = 3.72589167251055; |
|
|
|
|
(*theoreticalSinr1)[1] = 3.72255684126076; |
|
|
|
|
|
|
|
|
|
AddTestCase (new LenaDownlinkSinrTestCase (rxPsd1, theoreticalSinr1, "sdBm = [-46 -48]")); |
|
|
|
|
AddTestCase (new LteDownlinkSinrTestCase (rxPsd1, theoreticalSinr1, "sdBm = [-46 -48]")); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* TX signal #2: Power Spectral Density (W/Hz) of the signal of interest = [-63 -61] dBm and BW = [20 22] MHz |
|
|
|
@ -98,18 +95,18 @@ LenaDownlinkSinrTestSuite::LenaDownlinkSinrTestSuite ()
|
|
|
|
|
(*theoreticalSinr2)[0] = 0.0743413124381667; |
|
|
|
|
(*theoreticalSinr2)[1] = 0.1865697965291756; |
|
|
|
|
|
|
|
|
|
AddTestCase (new LenaDownlinkSinrTestCase (rxPsd2, theoreticalSinr2, "sdBm = [-63 -61]")); |
|
|
|
|
AddTestCase (new LteDownlinkSinrTestCase (rxPsd2, theoreticalSinr2, "sdBm = [-63 -61]")); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static LenaDownlinkSinrTestSuite lenaDownlinkSinrTestSuite; |
|
|
|
|
static LteDownlinkSinrTestSuite lteDownlinkSinrTestSuite; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* TestCase |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
LenaDownlinkSinrTestCase::LenaDownlinkSinrTestCase (Ptr<SpectrumValue> sv, Ptr<SpectrumValue> sinr, std::string name) |
|
|
|
|
LteDownlinkSinrTestCase::LteDownlinkSinrTestCase (Ptr<SpectrumValue> sv, Ptr<SpectrumValue> sinr, std::string name) |
|
|
|
|
: TestCase ("SINR calculation in downlink: " + name), |
|
|
|
|
m_sv (sv), |
|
|
|
|
m_sm (sv->GetSpectrumModel ()), |
|
|
|
@ -118,12 +115,12 @@ LenaDownlinkSinrTestCase::LenaDownlinkSinrTestCase (Ptr<SpectrumValue> sv, Ptr<S
|
|
|
|
|
NS_LOG_INFO ("Creating LenaDownlinkSinrTestCase"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
LenaDownlinkSinrTestCase::~LenaDownlinkSinrTestCase () |
|
|
|
|
LteDownlinkSinrTestCase::~LteDownlinkSinrTestCase () |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
LenaDownlinkSinrTestCase::DoRun (void) |
|
|
|
|
LteDownlinkSinrTestCase::DoRun (void) |
|
|
|
|
{ |
|
|
|
|
LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL); |
|
|
|
|
|
|
|
|
@ -162,7 +159,7 @@ LenaDownlinkSinrTestCase::DoRun (void)
|
|
|
|
|
|
|
|
|
|
dlPhy->SetCellId (100); |
|
|
|
|
|
|
|
|
|
Ptr<LenaTestSinrChunkProcessor> chunkProcessor = Create<LenaTestSinrChunkProcessor> (uePhy->GetObject<LtePhy> ()); |
|
|
|
|
Ptr<LteTestSinrChunkProcessor> chunkProcessor = Create<LteTestSinrChunkProcessor> (uePhy->GetObject<LtePhy> ()); |
|
|
|
|
dlPhy->AddSinrChunkProcessor (chunkProcessor); |
|
|
|
|
|
|
|
|
|
/**
|