23 #include "ns3/simulator.h"
27 #include "ns3/spectrum-test.h"
28 #include "ns3/boolean.h"
29 #include "ns3/lte-phy-tag.h"
31 #include "ns3/lte-spectrum-signal-parameters.h"
34 #include <ns3/lte-control-messages.h>
35 #include "ns3/lte-helper.h"
36 #include <ns3/lte-chunk-processor.h>
71 sm = Create<SpectrumModel> (bands);
77 (*rxPsd1)[0] = 1.255943215755e-15;
78 (*rxPsd1)[1] = 7.204059965732e-16;
81 (*theoreticalSinr1)[0] = 3.72589167251055;
82 (*theoreticalSinr1)[1] = 3.72255684126076;
91 (*rxPsd2)[0] = 2.505936168136e-17;
92 (*rxPsd2)[1] = 3.610582885110e-17;
95 (*theoreticalSinr2)[0] = 0.0743413124381667;
96 (*theoreticalSinr2)[1] = 0.1865697965291756;
112 :
TestCase (
"SINR calculation in downlink Data frame: " + name),
114 m_sm (sv->GetSpectrumModel ()),
115 m_expectedSinr (sinr)
135 uint16_t cellId = 100;
153 const int numOfPbs = 5;
156 const int numOfPkts = 10;
165 uint16_t pbCellId[numOfPbs];
170 for (
int pb = 0 ; pb < numOfPbs ; pb++ )
173 packetBursts[pb] = CreateObject<PacketBurst> ();
174 pbCellId[pb] = cellId * (pb + 1);
177 for (
int i = 0 ; i < numOfPkts ; i++ )
179 pkt[pb][i] = Create<Packet> (1000);
181 packetBursts[pb]->
AddPacket ( pkt[pb][i] );
192 (*noisePsd)[0] = 5.000000000000e-19;
193 (*noisePsd)[1] = 4.545454545455e-19;
195 (*i1)[0] = 5.000000000000e-18;
196 (*i2)[0] = 5.000000000000e-16;
197 (*i3)[0] = 1.581138830084e-16;
198 (*i4)[0] = 7.924465962306e-17;
199 (*i1)[1] = 1.437398936440e-18;
200 (*i2)[1] = 5.722388235428e-16;
201 (*i3)[1] = 7.204059965732e-17;
202 (*i4)[1] = 5.722388235428e-17;
227 sp1->
cellId = pbCellId[0];
228 Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, dlPhy, sp1);
236 ip1->
cellId = pbCellId[1];
237 Simulator::Schedule (ti1, &LteSpectrumPhy::StartRx, dlPhy, ip1);
244 ip2->
cellId = pbCellId[2];
245 Simulator::Schedule (ti2, &LteSpectrumPhy::StartRx, dlPhy, ip2);
252 ip3->
cellId = pbCellId[3];
253 Simulator::Schedule (ti3, &LteSpectrumPhy::StartRx, dlPhy, ip3);
260 ip4->
cellId = pbCellId[4];
261 Simulator::Schedule (ti4, &LteSpectrumPhy::StartRx, dlPhy, ip4);
263 Simulator::Stop (
Seconds (5.0));
271 Simulator::Destroy ();
281 :
TestCase (
"SINR calculation in downlink Ctrl Frame: " + name),
283 m_sm (sv->GetSpectrumModel ()),
284 m_expectedSinr (sinr)
286 NS_LOG_INFO (
"Creating LenaDownlinkCtrlSinrTestCase");
303 uint16_t cellId = 100;
320 const int numOfUes = 5;
323 const int numOfCtrlMsgs = 10;
326 std::list<Ptr<LteControlMessage> > ctrlMsgList[numOfUes];
329 uint16_t pbCellId[numOfUes];
334 for (
int pb = 0 ; pb < numOfUes ; pb++ )
336 pbCellId[pb] = cellId * (pb + 1);
339 for (
int i = 0 ; i < numOfCtrlMsgs ; i++ )
344 ctrlMsgList[pb].push_back (msg);
355 (*noisePsd)[0] = 5.000000000000e-19;
356 (*noisePsd)[1] = 4.545454545455e-19;
358 (*i1)[0] = 5.000000000000e-18;
359 (*i2)[0] = 5.000000000000e-16;
360 (*i3)[0] = 1.581138830084e-16;
361 (*i4)[0] = 7.924465962306e-17;
362 (*i1)[1] = 1.437398936440e-18;
363 (*i2)[1] = 5.722388235428e-16;
364 (*i3)[1] = 7.204059965732e-17;
365 (*i4)[1] = 5.722388235428e-17;
390 sp1->
cellId = pbCellId[0];
392 Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, dlPhy, sp1);
400 ip1->
cellId = pbCellId[1];
402 Simulator::Schedule (ti1, &LteSpectrumPhy::StartRx, dlPhy, ip1);
409 ip2->
cellId = pbCellId[2];
411 Simulator::Schedule (ti2, &LteSpectrumPhy::StartRx, dlPhy, ip2);
418 ip3->
cellId = pbCellId[3];
420 Simulator::Schedule (ti3, &LteSpectrumPhy::StartRx, dlPhy, ip3);
427 ip4->
cellId = pbCellId[4];
429 Simulator::Schedule (ti4, &LteSpectrumPhy::StartRx, dlPhy, ip4);
431 Simulator::Stop (
Seconds (5.0));
439 Simulator::Destroy ();