23 #include "ns3/simulator.h"
27 #include "ns3/spectrum-test.h"
29 #include "ns3/lte-phy-tag.h"
31 #include "ns3/lte-spectrum-signal-parameters.h"
35 #include <ns3/lte-helper.h>
36 #include <ns3/lte-chunk-processor.h>
70 sm = Create<SpectrumModel> (bands);
76 (*rxPsd1)[0] = 1.255943215755e-15;
81 (*rxPsd2)[1] = 7.204059965732e-16;
84 (*theoreticalSinr1)[0] = 3.72589167251055;
85 (*theoreticalSinr1)[1] = 3.72255684126076;
95 (*rxPsd3)[0] = 2.505936168136e-17;
100 (*rxPsd4)[1] = 3.610582885110e-17;
103 (*theoreticalSinr2)[0] = 0.0743413124381667;
104 (*theoreticalSinr2)[1] = 0.1865697965291756;
120 :
TestCase (
"SINR calculation in uplink data frame: " + name),
123 m_sm (sv1->GetSpectrumModel ()),
124 m_expectedSinr (sinr)
126 NS_LOG_INFO (
"Creating LteUplinkDataSinrTestCase");
143 uint16_t cellId = 100;
161 const int numOfDataPbs = 2;
162 const int numOfIntfPbs = 4;
163 const int numOfPbs = numOfDataPbs + numOfIntfPbs;
166 const int numOfPkts = 10;
175 uint16_t pbCellId[numOfPbs];
183 for (
int dataPb = 0 ; dataPb < numOfDataPbs ; dataPb++, pb++ )
186 packetBursts[pb] = CreateObject<PacketBurst> ();
187 pbCellId[pb] = cellId;
189 for (
int i = 0 ; i < numOfPkts ; i++ )
191 pkt[pb][i] = Create<Packet> (1000);
193 packetBursts[pb]->
AddPacket ( pkt[pb][i] );
196 for (
int intfPb = 0 ; intfPb < numOfIntfPbs ; intfPb++, pb++ )
199 packetBursts[pb] = CreateObject<PacketBurst> ();
200 pbCellId[pb] = cellId * (pb + 1);
203 for (
int i = 0 ; i < numOfPkts ; i++ )
205 pkt[pb][i] = Create<Packet> (1000);
207 packetBursts[pb]->
AddPacket ( pkt[pb][i] );
218 (*noisePsd)[0] = 5.000000000000e-19;
219 (*noisePsd)[1] = 4.545454545455e-19;
221 (*i1)[0] = 5.000000000000e-18;
222 (*i2)[0] = 5.000000000000e-16;
223 (*i3)[0] = 1.581138830084e-16;
224 (*i4)[0] = 7.924465962306e-17;
225 (*i1)[1] = 1.437398936440e-18;
226 (*i2)[1] = 5.722388235428e-16;
227 (*i3)[1] = 7.204059965732e-17;
228 (*i4)[1] = 5.722388235428e-17;
253 sp1->
cellId = pbCellId[0];
254 Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, ulPhy, sp1);
261 sp2->
cellId = pbCellId[1];
262 Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, ulPhy, sp2);
270 ip1->
cellId = pbCellId[2];
271 Simulator::Schedule (ti1, &LteSpectrumPhy::StartRx, ulPhy, ip1);
278 ip2->
cellId = pbCellId[3];
279 Simulator::Schedule (ti2, &LteSpectrumPhy::StartRx, ulPhy, ip2);
286 ip3->
cellId = pbCellId[4];
287 Simulator::Schedule (ti3, &LteSpectrumPhy::StartRx, ulPhy, ip3);
294 ip4->
cellId = pbCellId[5];
295 Simulator::Schedule (ti4, &LteSpectrumPhy::StartRx, ulPhy, ip4);
297 Simulator::Stop (
Seconds (5.0));
307 Simulator::Destroy ();
317 :
TestCase (
"SINR calculation in uplink srs frame: " + name),
320 m_sm (sv1->GetSpectrumModel ()),
321 m_expectedSinr (sinr)
348 uint16_t cellId = 100;
366 int numOfDataSignals = 2;
367 int numOfIntfSignals = 4;
368 int numOfSignals = numOfDataSignals + numOfIntfSignals;
370 uint16_t pbCellId[numOfSignals];
378 for (
int dataPb = 0 ; dataPb < numOfDataSignals ; dataPb++, pb++ )
380 pbCellId[pb] = cellId;
383 for (
int intfPb = 0 ; intfPb < numOfIntfSignals ; intfPb++, pb++ )
386 pbCellId[pb] = cellId * (pb + 1);
397 (*noisePsd)[0] = 5.000000000000e-19;
398 (*noisePsd)[1] = 4.545454545455e-19;
400 (*i1)[0] = 5.000000000000e-18;
401 (*i2)[0] = 5.000000000000e-16;
402 (*i3)[0] = 1.581138830084e-16;
403 (*i4)[0] = 7.924465962306e-17;
404 (*i1)[1] = 1.437398936440e-18;
405 (*i2)[1] = 5.722388235428e-16;
406 (*i3)[1] = 7.204059965732e-17;
407 (*i4)[1] = 5.722388235428e-17;
431 sp1->
cellId = pbCellId[0];
432 Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, ulPhy, sp1);
438 sp2->
cellId = pbCellId[1];
439 Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, ulPhy, sp2);
446 ip1->
cellId = pbCellId[2];
447 Simulator::Schedule (ti1, &LteSpectrumPhy::StartRx, ulPhy, ip1);
453 ip2->
cellId = pbCellId[3];
454 Simulator::Schedule (ti2, &LteSpectrumPhy::StartRx, ulPhy, ip2);
460 ip3->
cellId = pbCellId[4];
461 Simulator::Schedule (ti3, &LteSpectrumPhy::StartRx, ulPhy, ip3);
467 ip4->
cellId = pbCellId[5];
468 Simulator::Schedule (ti4, &LteSpectrumPhy::StartRx, ulPhy, ip4);
470 Simulator::Stop (
Seconds (5.0));
480 Simulator::Destroy ();