author | Tom Henderson <tomh@tomh.org> |
Mon, 28 Sep 2015 20:27:25 -0700 | |
changeset 11676 | 05ea1489e509 |
parent 11340 | 435b74dece97 |
permissions | -rw-r--r-- |
7996 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Manuel Requena <manuel.requena@cttc.es> |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
19 |
* Modified by Marco Miozzo <mmiozzo@ctt.es> |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
20 |
* Extend to Data and SRS frames |
7996 | 21 |
*/ |
22 |
||
23 |
#include "ns3/simulator.h" |
|
24 |
||
25 |
#include "ns3/log.h" |
|
26 |
||
8157
3851d59eb714
lte sinr tests using new spectrum-test macros
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
27 |
#include "ns3/spectrum-test.h" |
3851d59eb714
lte sinr tests using new spectrum-test macros
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
28 |
|
7996 | 29 |
#include "ns3/lte-phy-tag.h" |
9089 | 30 |
#include "lte-test-ue-phy.h" |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
31 |
#include "ns3/lte-spectrum-signal-parameters.h" |
7996 | 32 |
|
9052
db76e8754e2f
Fix bugs in merging lena-pem on test headers files
mmiozzo
parents:
9047
diff
changeset
|
33 |
#include "lte-test-uplink-sinr.h" |
7996 | 34 |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
35 |
#include <ns3/lte-helper.h> |
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
36 |
#include <ns3/lte-chunk-processor.h> |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
37 |
|
10553
8c347165bb56
Move tests outside ns3 namespace
Vedran Miletić <rivanvx@gmail.com>
parents:
10344
diff
changeset
|
38 |
using namespace ns3; |
7996 | 39 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10892
diff
changeset
|
40 |
NS_LOG_COMPONENT_DEFINE ("LteUplinkSinrTest"); |
7996 | 41 |
|
42 |
/** |
|
43 |
* Test 1.2 SINR calculation in uplink |
|
44 |
*/ |
|
45 |
||
46 |
/** |
|
47 |
* TestSuite |
|
48 |
*/ |
|
8003 | 49 |
LteUplinkSinrTestSuite::LteUplinkSinrTestSuite () |
50 |
: TestSuite ("lte-uplink-sinr", SYSTEM) |
|
7996 | 51 |
{ |
52 |
/** |
|
53 |
* Build Spectrum Model values for the TX signal |
|
54 |
*/ |
|
55 |
Ptr<SpectrumModel> sm; |
|
56 |
||
57 |
Bands bands; |
|
58 |
BandInfo bi; |
|
59 |
||
60 |
bi.fl = 2.400e9; |
|
61 |
bi.fc = 2.410e9; |
|
62 |
bi.fh = 2.420e9; |
|
63 |
bands.push_back (bi); |
|
64 |
||
65 |
bi.fl = 2.420e9; |
|
66 |
bi.fc = 2.431e9; |
|
67 |
bi.fh = 2.442e9; |
|
68 |
bands.push_back (bi); |
|
69 |
||
70 |
sm = Create<SpectrumModel> (bands); |
|
71 |
||
72 |
/** |
|
73 |
* TX signals #1: Power Spectral Density (W/Hz) of the signals of interest = [-46 -inf] and [-inf -48] dBm and BW = [20 22] MHz |
|
74 |
*/ |
|
75 |
Ptr<SpectrumValue> rxPsd1 = Create<SpectrumValue> (sm); |
|
76 |
(*rxPsd1)[0] = 1.255943215755e-15; |
|
77 |
(*rxPsd1)[1] = 0.0; |
|
78 |
||
79 |
Ptr<SpectrumValue> rxPsd2 = Create<SpectrumValue> (sm); |
|
80 |
(*rxPsd2)[0] = 0.0; |
|
81 |
(*rxPsd2)[1] = 7.204059965732e-16; |
|
82 |
||
83 |
Ptr<SpectrumValue> theoreticalSinr1 = Create<SpectrumValue> (sm); |
|
84 |
(*theoreticalSinr1)[0] = 3.72589167251055; |
|
85 |
(*theoreticalSinr1)[1] = 3.72255684126076; |
|
86 |
||
9266
d26408b17360
bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents:
9089
diff
changeset
|
87 |
AddTestCase (new LteUplinkDataSinrTestCase (rxPsd1, rxPsd2, theoreticalSinr1, "sdBm = [-46 -inf] and [-inf -48]"), TestCase::QUICK); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
88 |
|
9266
d26408b17360
bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents:
9089
diff
changeset
|
89 |
AddTestCase (new LteUplinkSrsSinrTestCase (rxPsd1, rxPsd2, theoreticalSinr1, "sdBm = [-46 -inf] and [-inf -48]"), TestCase::QUICK); |
7996 | 90 |
|
91 |
/** |
|
92 |
* TX signals #2: Power Spectral Density of the signals of interest = [-63 -inf] and [-inf -61] dBm and BW = [20 22] MHz |
|
93 |
*/ |
|
94 |
Ptr<SpectrumValue> rxPsd3 = Create<SpectrumValue> (sm); |
|
95 |
(*rxPsd3)[0] = 2.505936168136e-17; |
|
96 |
(*rxPsd3)[1] = 0.0; |
|
97 |
||
98 |
Ptr<SpectrumValue> rxPsd4 = Create<SpectrumValue> (sm); |
|
99 |
(*rxPsd4)[0] = 0.0; |
|
100 |
(*rxPsd4)[1] = 3.610582885110e-17; |
|
101 |
||
102 |
Ptr<SpectrumValue> theoreticalSinr2 = Create<SpectrumValue> (sm); |
|
103 |
(*theoreticalSinr2)[0] = 0.0743413124381667; |
|
104 |
(*theoreticalSinr2)[1] = 0.1865697965291756; |
|
105 |
||
9266
d26408b17360
bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents:
9089
diff
changeset
|
106 |
AddTestCase (new LteUplinkDataSinrTestCase (rxPsd3, rxPsd4, theoreticalSinr2, "sdBm = [-63 -inf] and [-inf -61]"), TestCase::QUICK); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
107 |
|
9266
d26408b17360
bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents:
9089
diff
changeset
|
108 |
AddTestCase (new LteUplinkSrsSinrTestCase (rxPsd3, rxPsd4, theoreticalSinr2, "sdBm = [-63 -inf] and [-inf -61]"), TestCase::QUICK); |
7996 | 109 |
|
110 |
} |
|
111 |
||
8003 | 112 |
static LteUplinkSinrTestSuite lteUplinkSinrTestSuite; |
7996 | 113 |
|
114 |
||
115 |
/** |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
116 |
* TestCase Data |
7996 | 117 |
*/ |
118 |
||
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
119 |
LteUplinkDataSinrTestCase::LteUplinkDataSinrTestCase (Ptr<SpectrumValue> sv1, Ptr<SpectrumValue> sv2, Ptr<SpectrumValue> sinr, std::string name) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
120 |
: TestCase ("SINR calculation in uplink data frame: " + name), |
7996 | 121 |
m_sv1 (sv1), |
122 |
m_sv2 (sv2), |
|
123 |
m_sm (sv1->GetSpectrumModel ()), |
|
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
124 |
m_expectedSinr (sinr) |
7996 | 125 |
{ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
126 |
NS_LOG_INFO ("Creating LteUplinkDataSinrTestCase"); |
7996 | 127 |
} |
128 |
||
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
129 |
LteUplinkDataSinrTestCase::~LteUplinkDataSinrTestCase () |
7996 | 130 |
{ |
131 |
} |
|
132 |
||
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
133 |
|
7996 | 134 |
void |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
135 |
LteUplinkDataSinrTestCase::DoRun (void) |
7996 | 136 |
{ |
137 |
/** |
|
138 |
* Instantiate a single receiving LteSpectrumPhy |
|
139 |
*/ |
|
140 |
Ptr<LteSpectrumPhy> dlPhy = CreateObject<LteSpectrumPhy> (); |
|
141 |
Ptr<LteSpectrumPhy> ulPhy = CreateObject<LteSpectrumPhy> (); |
|
8009
a7a16b565d0b
Test 1.1 and 1.2: test LteUePhy interface instead of CqiSinrChunkProcessor interface
mrequena
parents:
8003
diff
changeset
|
142 |
Ptr<LteTestUePhy> uePhy = CreateObject<LteTestUePhy> (dlPhy, ulPhy); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
143 |
uint16_t cellId = 100; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
144 |
dlPhy->SetCellId (cellId); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
145 |
ulPhy->SetCellId (cellId); |
7996 | 146 |
|
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
147 |
Ptr<LteChunkProcessor> chunkProcessor = Create<LteChunkProcessor> (); |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
148 |
LteSpectrumValueCatcher actualSinrCatcher; |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
149 |
chunkProcessor->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &actualSinrCatcher)); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
150 |
ulPhy->AddDataSinrChunkProcessor (chunkProcessor); |
7996 | 151 |
|
152 |
/** |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
153 |
* Generate several calls to LteSpectrumPhy::StartRx corresponding to |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
154 |
* several signals. One will be the signal of interest, i.e., the |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
155 |
* LteSpectrumSignalParametersDataFrame of the Packet burst |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
156 |
* will have the same CellId of the receiving PHY; the others will have |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
157 |
* a different CellId and hence will be the interfering signals |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
158 |
*/ |
7996 | 159 |
|
160 |
// Number of packet bursts (2 data + 4 interferences) |
|
9077
16e6f501eeef
Really fix bug 1345 - ns-3 should build with clang >= 3.0 (requires -Wno-deprecated due to sgi-hashmap.h)
Vedran Miletić <rivanvx@gmail.com>
parents:
9052
diff
changeset
|
161 |
const int numOfDataPbs = 2; |
16e6f501eeef
Really fix bug 1345 - ns-3 should build with clang >= 3.0 (requires -Wno-deprecated due to sgi-hashmap.h)
Vedran Miletić <rivanvx@gmail.com>
parents:
9052
diff
changeset
|
162 |
const int numOfIntfPbs = 4; |
16e6f501eeef
Really fix bug 1345 - ns-3 should build with clang >= 3.0 (requires -Wno-deprecated due to sgi-hashmap.h)
Vedran Miletić <rivanvx@gmail.com>
parents:
9052
diff
changeset
|
163 |
const int numOfPbs = numOfDataPbs + numOfIntfPbs; |
7996 | 164 |
|
165 |
// Number of packets in the packet bursts |
|
9077
16e6f501eeef
Really fix bug 1345 - ns-3 should build with clang >= 3.0 (requires -Wno-deprecated due to sgi-hashmap.h)
Vedran Miletić <rivanvx@gmail.com>
parents:
9052
diff
changeset
|
166 |
const int numOfPkts = 10; |
7996 | 167 |
|
168 |
// Packet bursts |
|
169 |
Ptr<PacketBurst> packetBursts[numOfPbs]; |
|
170 |
||
171 |
// Packets |
|
172 |
Ptr<Packet> pkt[numOfPbs][numOfPkts]; |
|
173 |
||
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
174 |
// Bursts cellId |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
175 |
uint16_t pbCellId[numOfPbs]; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
176 |
|
7996 | 177 |
|
8149 | 178 |
|
7996 | 179 |
/** |
180 |
* Build packet burst (Data and interference) |
|
181 |
*/ |
|
182 |
int pb = 0; |
|
183 |
for ( int dataPb = 0 ; dataPb < numOfDataPbs ; dataPb++, pb++ ) |
|
184 |
{ |
|
185 |
// Create packet burst |
|
186 |
packetBursts[pb] = CreateObject<PacketBurst> (); |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
187 |
pbCellId[pb] = cellId; |
7996 | 188 |
// Create packets and add them to the burst |
189 |
for ( int i = 0 ; i < numOfPkts ; i++ ) |
|
190 |
{ |
|
191 |
pkt[pb][i] = Create<Packet> (1000); |
|
192 |
||
193 |
packetBursts[pb]->AddPacket ( pkt[pb][i] ); |
|
194 |
} |
|
195 |
} |
|
196 |
for ( int intfPb = 0 ; intfPb < numOfIntfPbs ; intfPb++, pb++ ) |
|
197 |
{ |
|
198 |
// Create packet burst |
|
199 |
packetBursts[pb] = CreateObject<PacketBurst> (); |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
200 |
pbCellId[pb] = cellId * (pb + 1); |
7996 | 201 |
|
202 |
// Create packets and add them to the burst |
|
203 |
for ( int i = 0 ; i < numOfPkts ; i++ ) |
|
204 |
{ |
|
205 |
pkt[pb][i] = Create<Packet> (1000); |
|
206 |
||
207 |
packetBursts[pb]->AddPacket ( pkt[pb][i] ); |
|
208 |
} |
|
209 |
} |
|
210 |
||
211 |
||
212 |
Ptr<SpectrumValue> noisePsd = Create<SpectrumValue> (m_sm); |
|
213 |
Ptr<SpectrumValue> i1 = Create<SpectrumValue> (m_sm); |
|
214 |
Ptr<SpectrumValue> i2 = Create<SpectrumValue> (m_sm); |
|
215 |
Ptr<SpectrumValue> i3 = Create<SpectrumValue> (m_sm); |
|
216 |
Ptr<SpectrumValue> i4 = Create<SpectrumValue> (m_sm); |
|
217 |
||
218 |
(*noisePsd)[0] = 5.000000000000e-19; |
|
219 |
(*noisePsd)[1] = 4.545454545455e-19; |
|
220 |
||
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; |
|
229 |
||
230 |
Time ts = Seconds (1); |
|
231 |
Time ds = Seconds (1); |
|
232 |
Time ti1 = Seconds (0); |
|
233 |
Time di1 = Seconds (3); |
|
234 |
Time ti2 = Seconds (0.7); |
|
235 |
Time di2 = Seconds (1); |
|
236 |
Time ti3 = Seconds (1.2); |
|
237 |
Time di3 = Seconds (1); |
|
238 |
Time ti4 = Seconds (1.5); |
|
239 |
Time di4 = Seconds (0.1); |
|
240 |
||
241 |
ulPhy->SetNoisePowerSpectralDensity (noisePsd); |
|
242 |
||
243 |
/** |
|
244 |
* Schedule the reception of the data signals plus the interference signals |
|
245 |
*/ |
|
246 |
||
247 |
// 2 UEs send data to the eNB through 2 subcarriers |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
248 |
Ptr<LteSpectrumSignalParametersDataFrame> sp1 = Create<LteSpectrumSignalParametersDataFrame> (); |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
249 |
sp1->psd = m_sv1; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
250 |
sp1->txPhy = 0; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
251 |
sp1->duration = ds; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
252 |
sp1->packetBurst = packetBursts[0]; |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
253 |
sp1->cellId = pbCellId[0]; |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
254 |
Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, ulPhy, sp1); |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
255 |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
256 |
Ptr<LteSpectrumSignalParametersDataFrame> sp2 = Create<LteSpectrumSignalParametersDataFrame> (); |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
257 |
sp2->psd = m_sv2; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
258 |
sp2->txPhy = 0; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
259 |
sp2->duration = ds; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
260 |
sp2->packetBurst = packetBursts[1]; |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
261 |
sp2->cellId = pbCellId[1]; |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
262 |
Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, ulPhy, sp2); |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
263 |
|
7996 | 264 |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
265 |
Ptr<LteSpectrumSignalParametersDataFrame> ip1 = Create<LteSpectrumSignalParametersDataFrame> (); |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
266 |
ip1->psd = i1; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
267 |
ip1->txPhy = 0; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
268 |
ip1->duration = di1; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
269 |
ip1->packetBurst = packetBursts[2]; |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
270 |
ip1->cellId = pbCellId[2]; |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
271 |
Simulator::Schedule (ti1, &LteSpectrumPhy::StartRx, ulPhy, ip1); |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
272 |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
273 |
Ptr<LteSpectrumSignalParametersDataFrame> ip2 = Create<LteSpectrumSignalParametersDataFrame> (); |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
274 |
ip2->psd = i2; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
275 |
ip2->txPhy = 0; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
276 |
ip2->duration = di2; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
277 |
ip2->packetBurst = packetBursts[3]; |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
278 |
ip2->cellId = pbCellId[3]; |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
279 |
Simulator::Schedule (ti2, &LteSpectrumPhy::StartRx, ulPhy, ip2); |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
280 |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
281 |
Ptr<LteSpectrumSignalParametersDataFrame> ip3 = Create<LteSpectrumSignalParametersDataFrame> (); |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
282 |
ip3->psd = i3; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
283 |
ip3->txPhy = 0; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
284 |
ip3->duration = di3; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
285 |
ip3->packetBurst = packetBursts[4]; |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
286 |
ip3->cellId = pbCellId[4]; |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
287 |
Simulator::Schedule (ti3, &LteSpectrumPhy::StartRx, ulPhy, ip3); |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
288 |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
289 |
Ptr<LteSpectrumSignalParametersDataFrame> ip4 = Create<LteSpectrumSignalParametersDataFrame> (); |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
290 |
ip4->psd = i4; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
291 |
ip4->txPhy = 0; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
292 |
ip4->duration = di4; |
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
293 |
ip4->packetBurst = packetBursts[5]; |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
294 |
ip4->cellId = pbCellId[5]; |
8339
bfa05e51eecf
merge ns-3-lena-dev with ns-3-dev
Nicola Baldo <nbaldo@cttc.es>
parents:
8253
diff
changeset
|
295 |
Simulator::Schedule (ti4, &LteSpectrumPhy::StartRx, ulPhy, ip4); |
7996 | 296 |
|
297 |
Simulator::Stop (Seconds (5.0)); |
|
298 |
Simulator::Run (); |
|
299 |
||
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
300 |
NS_LOG_INFO ("Data Frame - Theoretical SINR: " << *m_expectedSinr); |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
301 |
NS_LOG_INFO ("Data Frame - Calculated SINR: " << *(actualSinrCatcher.GetValue ())); |
7996 | 302 |
|
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
303 |
NS_TEST_EXPECT_MSG_NE (actualSinrCatcher.GetValue (), 0, "no actual SINR reported"); |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
304 |
|
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
305 |
NS_TEST_ASSERT_MSG_SPECTRUM_VALUE_EQ_TOL (*(actualSinrCatcher.GetValue ()), *m_expectedSinr, 0.0000001, "Data Frame - Wrong SINR !"); |
8345
8ac6ec71f8f8
tests lte-{up,down}link-sinr now passing valgrind
Nicola Baldo <nbaldo@cttc.es>
parents:
8339
diff
changeset
|
306 |
ulPhy->Dispose (); |
8ac6ec71f8f8
tests lte-{up,down}link-sinr now passing valgrind
Nicola Baldo <nbaldo@cttc.es>
parents:
8339
diff
changeset
|
307 |
Simulator::Destroy (); |
8ac6ec71f8f8
tests lte-{up,down}link-sinr now passing valgrind
Nicola Baldo <nbaldo@cttc.es>
parents:
8339
diff
changeset
|
308 |
|
7996 | 309 |
} |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
310 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
311 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
312 |
/** |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
313 |
* TestCase Srs |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
314 |
*/ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
315 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
316 |
LteUplinkSrsSinrTestCase::LteUplinkSrsSinrTestCase (Ptr<SpectrumValue> sv1, Ptr<SpectrumValue> sv2, Ptr<SpectrumValue> sinr, std::string name) |
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
317 |
: TestCase ("SINR calculation in uplink srs frame: " + name), |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
318 |
m_sv1 (sv1), |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
319 |
m_sv2 (sv2), |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
320 |
m_sm (sv1->GetSpectrumModel ()), |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
321 |
m_expectedSinr (sinr) |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
322 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
323 |
NS_LOG_INFO ("Creating LteUplinkSrsSinrTestCase"); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
324 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
325 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
326 |
LteUplinkSrsSinrTestCase::~LteUplinkSrsSinrTestCase () |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
327 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
328 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
329 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
330 |
void |
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
331 |
LteUplinkSrsSinrTestCase::ReportSinr (const SpectrumValue& sinr) |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
332 |
{ |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
333 |
m_actualSinr = sinr.Copy (); |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
334 |
} |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
335 |
|
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
336 |
void |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
337 |
LteUplinkSrsSinrTestCase::DoRun (void) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
338 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
339 |
/** |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
340 |
* Instantiate a single receiving LteSpectrumPhy |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
341 |
*/ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
342 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
343 |
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); |
10344
5aedb1614579
Disabled some logs in LTE module tests
Budiarto Herman <budiarto.herman@magister.fi>
parents:
9266
diff
changeset
|
344 |
// lteHelper->EnableLogComponents (); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
345 |
Ptr<LteSpectrumPhy> dlPhy = CreateObject<LteSpectrumPhy> (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
346 |
Ptr<LteSpectrumPhy> ulPhy = CreateObject<LteSpectrumPhy> (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
347 |
Ptr<LteTestUePhy> uePhy = CreateObject<LteTestUePhy> (dlPhy, ulPhy); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
348 |
uint16_t cellId = 100; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
349 |
dlPhy->SetCellId (cellId); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
350 |
ulPhy->SetCellId (cellId); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
351 |
|
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
352 |
Ptr<LteChunkProcessor> chunkProcessor = Create<LteChunkProcessor> (); |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
353 |
chunkProcessor->AddCallback (MakeCallback (&LteUplinkSrsSinrTestCase::ReportSinr, this)); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
354 |
ulPhy->AddCtrlSinrChunkProcessor (chunkProcessor); |
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
355 |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
356 |
/** |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
357 |
* Generate several calls to LteSpectrumPhy::StartRx corresponding to |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
358 |
* several signals. |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
359 |
* One will be the signal of interest, i.e., the |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
360 |
* LteSpectrumSignalParametersUlSrsFrame of the first signal will have the |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
361 |
* same CellId of the receiving PHY; the others will have a different |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
362 |
* CellId and hence will be the interfering signals |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
363 |
*/ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
364 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
365 |
// Number of packet bursts (2 data + 4 interferences) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
366 |
int numOfDataSignals = 2; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
367 |
int numOfIntfSignals = 4; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
368 |
int numOfSignals = numOfDataSignals + numOfIntfSignals; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
369 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
370 |
uint16_t pbCellId[numOfSignals]; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
371 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
372 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
373 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
374 |
/** |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
375 |
* Build packet burst (Data and interference) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
376 |
*/ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
377 |
int pb = 0; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
378 |
for ( int dataPb = 0 ; dataPb < numOfDataSignals ; dataPb++, pb++ ) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
379 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
380 |
pbCellId[pb] = cellId; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
381 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
382 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
383 |
for ( int intfPb = 0 ; intfPb < numOfIntfSignals ; intfPb++, pb++ ) |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
384 |
{ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
385 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
386 |
pbCellId[pb] = cellId * (pb + 1); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
387 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
388 |
} |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
389 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
390 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
391 |
Ptr<SpectrumValue> noisePsd = Create<SpectrumValue> (m_sm); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
392 |
Ptr<SpectrumValue> i1 = Create<SpectrumValue> (m_sm); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
393 |
Ptr<SpectrumValue> i2 = Create<SpectrumValue> (m_sm); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
394 |
Ptr<SpectrumValue> i3 = Create<SpectrumValue> (m_sm); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
395 |
Ptr<SpectrumValue> i4 = Create<SpectrumValue> (m_sm); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
396 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
397 |
(*noisePsd)[0] = 5.000000000000e-19; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
398 |
(*noisePsd)[1] = 4.545454545455e-19; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
399 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
400 |
(*i1)[0] = 5.000000000000e-18; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
401 |
(*i2)[0] = 5.000000000000e-16; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
402 |
(*i3)[0] = 1.581138830084e-16; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
403 |
(*i4)[0] = 7.924465962306e-17; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
404 |
(*i1)[1] = 1.437398936440e-18; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
405 |
(*i2)[1] = 5.722388235428e-16; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
406 |
(*i3)[1] = 7.204059965732e-17; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
407 |
(*i4)[1] = 5.722388235428e-17; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
408 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
409 |
Time ts = Seconds (1); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
410 |
Time ds = Seconds (1); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
411 |
Time ti1 = Seconds (0); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
412 |
Time di1 = Seconds (3); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
413 |
Time ti2 = Seconds (0.7); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
414 |
Time di2 = Seconds (1); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
415 |
Time ti3 = Seconds (1.2); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
416 |
Time di3 = Seconds (1); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
417 |
Time ti4 = Seconds (1.5); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
418 |
Time di4 = Seconds (0.1); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
419 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
420 |
ulPhy->SetNoisePowerSpectralDensity (noisePsd); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
421 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
422 |
/** |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
423 |
* Schedule the reception of the data signals plus the interference signals |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
424 |
*/ |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
425 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
426 |
// 2 UEs send data to the eNB through 2 subcarriers |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
427 |
Ptr<LteSpectrumSignalParametersUlSrsFrame> sp1 = Create<LteSpectrumSignalParametersUlSrsFrame> (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
428 |
sp1->psd = m_sv1; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
429 |
sp1->txPhy = 0; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
430 |
sp1->duration = ds; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
431 |
sp1->cellId = pbCellId[0]; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
432 |
Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, ulPhy, sp1); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
433 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
434 |
Ptr<LteSpectrumSignalParametersUlSrsFrame> sp2 = Create<LteSpectrumSignalParametersUlSrsFrame> (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
435 |
sp2->psd = m_sv2; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
436 |
sp2->txPhy = 0; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
437 |
sp2->duration = ds; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
438 |
sp2->cellId = pbCellId[1]; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
439 |
Simulator::Schedule (ts, &LteSpectrumPhy::StartRx, ulPhy, sp2); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
440 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
441 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
442 |
Ptr<LteSpectrumSignalParametersUlSrsFrame> ip1 = Create<LteSpectrumSignalParametersUlSrsFrame> (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
443 |
ip1->psd = i1; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
444 |
ip1->txPhy = 0; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
445 |
ip1->duration = di1; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
446 |
ip1->cellId = pbCellId[2]; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
447 |
Simulator::Schedule (ti1, &LteSpectrumPhy::StartRx, ulPhy, ip1); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
448 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
449 |
Ptr<LteSpectrumSignalParametersUlSrsFrame> ip2 = Create<LteSpectrumSignalParametersUlSrsFrame> (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
450 |
ip2->psd = i2; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
451 |
ip2->txPhy = 0; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
452 |
ip2->duration = di2; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
453 |
ip2->cellId = pbCellId[3]; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
454 |
Simulator::Schedule (ti2, &LteSpectrumPhy::StartRx, ulPhy, ip2); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
455 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
456 |
Ptr<LteSpectrumSignalParametersUlSrsFrame> ip3 = Create<LteSpectrumSignalParametersUlSrsFrame> (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
457 |
ip3->psd = i3; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
458 |
ip3->txPhy = 0; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
459 |
ip3->duration = di3; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
460 |
ip3->cellId = pbCellId[4]; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
461 |
Simulator::Schedule (ti3, &LteSpectrumPhy::StartRx, ulPhy, ip3); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
462 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
463 |
Ptr<LteSpectrumSignalParametersUlSrsFrame> ip4 = Create<LteSpectrumSignalParametersUlSrsFrame> (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
464 |
ip4->psd = i4; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
465 |
ip4->txPhy = 0; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
466 |
ip4->duration = di4; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
467 |
ip4->cellId = pbCellId[5]; |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
468 |
Simulator::Schedule (ti4, &LteSpectrumPhy::StartRx, ulPhy, ip4); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
469 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
470 |
Simulator::Stop (Seconds (5.0)); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
471 |
Simulator::Run (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
472 |
|
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
473 |
NS_ASSERT_MSG (m_actualSinr != 0, "no actual SINR reported"); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
474 |
|
11340
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
475 |
NS_LOG_INFO ("SRS Frame - Theoretical SINR: " << *m_expectedSinr); |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
476 |
NS_LOG_INFO ("SRS Frame - Calculated SINR: " << *m_actualSinr); |
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
477 |
|
435b74dece97
get rid of LteTestSinrChunkProcessor
Nicola Baldo <nbaldo@cttc.es>
parents:
10968
diff
changeset
|
478 |
NS_TEST_ASSERT_MSG_SPECTRUM_VALUE_EQ_TOL (*m_actualSinr, *m_expectedSinr, 0.0000001, "Data Frame - Wrong SINR !"); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
479 |
ulPhy->Dispose (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
480 |
Simulator::Destroy (); |
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
481 |
|
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8345
diff
changeset
|
482 |
} |