A Discrete-Event Network Simulator
API
three-gpp-channel-test-suite.cc
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
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
19#include "ns3/log.h"
20#include "ns3/abort.h"
21#include "ns3/test.h"
22#include "ns3/config.h"
23#include "ns3/double.h"
24#include "ns3/uinteger.h"
25#include "ns3/string.h"
26#include "ns3/angles.h"
27#include "ns3/pointer.h"
28#include "ns3/node-container.h"
29#include "ns3/constant-position-mobility-model.h"
30#include "ns3/uniform-planar-array.h"
31#include "ns3/isotropic-antenna-model.h"
32#include "ns3/three-gpp-channel-model.h"
33#include "ns3/simple-net-device.h"
34#include "ns3/simulator.h"
35#include "ns3/channel-condition-model.h"
36#include "ns3/three-gpp-spectrum-propagation-loss-model.h"
37#include "ns3/wifi-spectrum-value-helper.h"
38#include "ns3/spectrum-signal-parameters.h"
39
40using namespace ns3;
41
42NS_LOG_COMPONENT_DEFINE ("ThreeGppChannelTestSuite");
43
52{
53public:
58
63
64private:
68 virtual void DoRun (void);
69
79
80 std::vector<double> m_normVector;
81};
82
84 : TestCase ("Check the dimensions and the norm of the channel matrix")
85{
86}
87
89{
90}
91
92void
94{
95 uint64_t txAntennaElements = txAntenna->GetNumberOfElements ();
96 uint64_t rxAntennaElements = rxAntenna->GetNumberOfElements ();
97
98 Ptr<const ThreeGppChannelModel::ChannelMatrix> channelMatrix = channelModel->GetChannel (txMob, rxMob, txAntenna, rxAntenna);
99
100 double channelNorm = 0;
101 uint8_t numTotClusters = channelMatrix->m_channel.at (0).at (0).size ();
102 for (uint8_t cIndex = 0; cIndex < numTotClusters; cIndex++)
103 {
104 double clusterNorm = 0;
105 for (uint64_t sIndex = 0; sIndex < txAntennaElements; sIndex++)
106 {
107 for (uint32_t uIndex = 0; uIndex < rxAntennaElements; uIndex++)
108 {
109 clusterNorm += std::pow (std::abs (channelMatrix->m_channel.at (uIndex).at (sIndex).at (cIndex)), 2);
110 }
111 }
112 channelNorm += clusterNorm;
113 }
114 m_normVector.push_back (channelNorm);
115}
116
117void
119{
120 // Build the scenario for the test
121 uint8_t txAntennaElements[] {2, 2}; // tx antenna dimensions
122 uint8_t rxAntennaElements[] {2, 2}; // rx antenna dimensions
123 uint32_t updatePeriodMs = 100; // update period in ms
124
125 // create the channel condition model
126 Ptr<ChannelConditionModel> channelConditionModel = CreateObject<NeverLosChannelConditionModel> ();
127
128 // create the ThreeGppChannelModel object used to generate the channel matrix
129 Ptr<ThreeGppChannelModel> channelModel = CreateObject<ThreeGppChannelModel> ();
130 channelModel->SetAttribute ("Frequency", DoubleValue (60.0e9));
131 channelModel->SetAttribute ("Scenario", StringValue ("RMa"));
132 channelModel->SetAttribute ("ChannelConditionModel", PointerValue (channelConditionModel));
133 channelModel->SetAttribute ("UpdatePeriod", TimeValue (MilliSeconds (updatePeriodMs-1)));
134
135 // create the tx and rx nodes
137 nodes.Create (2);
138
139 // create the tx and rx devices
140 Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice> ();
141 Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice> ();
142
143 // associate the nodes and the devices
144 nodes.Get (0)->AddDevice (txDev);
145 txDev->SetNode (nodes.Get (0));
146 nodes.Get (1)->AddDevice (rxDev);
147 rxDev->SetNode (nodes.Get (1));
148
149 // create the tx and rx mobility models and set their positions
150 Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel> ();
151 txMob->SetPosition (Vector (0.0,0.0,10.0));
152 Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel> ();
153 rxMob->SetPosition (Vector (100.0,0.0,10.0));
154
155 // associate the nodes and the mobility models
156 nodes.Get (0)->AggregateObject (txMob);
157 nodes.Get (1)->AggregateObject (rxMob);
158
159 // create the tx and rx antennas and set the their dimensions
160 Ptr<PhasedArrayModel> txAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (txAntennaElements [0]),
161 "NumRows", UintegerValue (txAntennaElements [1]),
162 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
163 Ptr<PhasedArrayModel> rxAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (rxAntennaElements [0]),
164 "NumRows", UintegerValue (rxAntennaElements [1]),
165 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
166
167 // generate the channel matrix
168 Ptr<const ThreeGppChannelModel::ChannelMatrix> channelMatrix = channelModel->GetChannel (txMob, rxMob, txAntenna, rxAntenna);
169
170 // check the channel matrix dimensions
171 NS_TEST_ASSERT_MSG_EQ (channelMatrix->m_channel.at (0).size (), txAntennaElements [0] * txAntennaElements [1], "The second dimension of H should be equal to the number of tx antenna elements");
172 NS_TEST_ASSERT_MSG_EQ (channelMatrix->m_channel.size (), rxAntennaElements [0] * rxAntennaElements [1], "The first dimension of H should be equal to the number of rx antenna elements");
173
174 // test if the channel matrix is correctly generated
175 uint16_t numIt = 1000;
176 for (uint16_t i = 0; i < numIt; i++)
177 {
178 Simulator::Schedule (MilliSeconds (updatePeriodMs * i), &ThreeGppChannelMatrixComputationTest::DoComputeNorm, this, channelModel, txMob, rxMob, txAntenna, rxAntenna);
179 }
180
182
183 // compute the sample mean
184 double sampleMean = 0;
185 for (auto i : m_normVector)
186 {
187 sampleMean += i;
188 }
189 sampleMean /= numIt;
190
191 // compute the sample standard deviation
192 double sampleStd = 0;
193 for (auto i : m_normVector)
194 {
195 sampleStd += ((i - sampleMean) * (i - sampleMean));
196 }
197 sampleStd = std::sqrt (sampleStd / (numIt - 1));
198
199 // perform the one sample t-test with a significance level of 0.05 to test
200 // the hypothesis "E [|H|^2] = M*N, where |H| indicates the Frobenius norm of
201 // H, M is the number of transmit antenna elements, and N is the number of
202 // the receive antenna elements"
203 double t = (sampleMean - txAntennaElements [0] * txAntennaElements [1] * rxAntennaElements [0] * rxAntennaElements [1]) / (sampleMean / std::sqrt (numIt));
204
205 // Using a significance level of 0.05, we reject the null hypothesis if |t| is
206 // greater than the critical value from a t-distribution with df = numIt-1
207 NS_TEST_ASSERT_MSG_EQ_TOL (std::abs (t), 0, 1.65, "We reject the hypothesis E[|H|^2] = M*N with a significance level of 0.05");
208
209 Simulator::Destroy ();
210}
211
220{
221public:
226
231
232private:
236 virtual void DoRun (void);
237
248 void DoGetChannel (Ptr<ThreeGppChannelModel> channelModel, Ptr<MobilityModel> txMob, Ptr<MobilityModel> rxMob, Ptr<PhasedArrayModel> txAntenna, Ptr<PhasedArrayModel> rxAntenna, bool update);
249
251};
252
254 : TestCase ("Check if the channel realizations are correctly updated during the simulation")
255{
256}
257
259{
260}
261
262void
264{
265 // retrieve the channel matrix
266 Ptr<const ThreeGppChannelModel::ChannelMatrix> channelMatrix = channelModel->GetChannel (txMob, rxMob, txAntenna, rxAntenna);
267
268 if (!m_currentChannel)
269 {
270 // this is the first time we compute the channel matrix, we initialize
271 // m_currentChannel
272 m_currentChannel = channelMatrix;
273 }
274 else
275 {
276 // compare the old and the new channel matrices
277 NS_TEST_ASSERT_MSG_EQ ((m_currentChannel != channelMatrix), update, Simulator::Now ().GetMilliSeconds () << " The channel matrix is not correctly updated");
278 }
279}
280
281void
283{
284 // Build the scenario for the test
285
286 uint8_t txAntennaElements[] {2, 2}; // tx antenna dimensions
287 uint8_t rxAntennaElements[] {4, 4}; // rx antenna dimensions
288 uint32_t updatePeriodMs = 100; // update period in ms
289
290 // create the channel condition model
291 Ptr<ChannelConditionModel> channelConditionModel = CreateObject<AlwaysLosChannelConditionModel> ();
292
293 // create the ThreeGppChannelModel object used to generate the channel matrix
294 Ptr<ThreeGppChannelModel> channelModel = CreateObject<ThreeGppChannelModel> ();
295 channelModel->SetAttribute ("Frequency", DoubleValue (60.0e9));
296 channelModel->SetAttribute ("Scenario", StringValue ("UMa"));
297 channelModel->SetAttribute ("ChannelConditionModel", PointerValue (channelConditionModel));
298 channelModel->SetAttribute ("UpdatePeriod", TimeValue (MilliSeconds (updatePeriodMs)));
299
300 // create the tx and rx nodes
302 nodes.Create (2);
303
304 // create the tx and rx devices
305 Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice> ();
306 Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice> ();
307
308 // associate the nodes and the devices
309 nodes.Get (0)->AddDevice (txDev);
310 txDev->SetNode (nodes.Get (0));
311 nodes.Get (1)->AddDevice (rxDev);
312 rxDev->SetNode (nodes.Get (1));
313
314 // create the tx and rx mobility models and set their positions
315 Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel> ();
316 txMob->SetPosition (Vector (0.0,0.0,10.0));
317 Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel> ();
318 rxMob->SetPosition (Vector (100.0,0.0,1.6));
319
320 // associate the nodes and the mobility models
321 nodes.Get (0)->AggregateObject (txMob);
322 nodes.Get (1)->AggregateObject (rxMob);
323
324 // create the tx and rx antennas and set the their dimensions
325 Ptr<PhasedArrayModel> txAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (txAntennaElements [0]),
326 "NumRows", UintegerValue (txAntennaElements [1]),
327 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
328 Ptr<PhasedArrayModel> rxAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (rxAntennaElements [0]),
329 "NumRows", UintegerValue (rxAntennaElements [1]),
330 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
331
332 // check if the channel matrix is correctly updated
333
334 // compute the channel matrix for the first time
335 uint32_t firstTimeMs = 1; // time instant at which the channel matrix is generated for the first time
336 Simulator::Schedule (MilliSeconds (firstTimeMs), &ThreeGppChannelMatrixUpdateTest::DoGetChannel,
337 this, channelModel, txMob, rxMob, txAntenna, rxAntenna, true);
338
339 // call GetChannel before the update period is exceeded, the channel matrix
340 // should not be updated
341 Simulator::Schedule (MilliSeconds (firstTimeMs + updatePeriodMs / 2), &ThreeGppChannelMatrixUpdateTest::DoGetChannel,
342 this, channelModel, txMob, rxMob, txAntenna, rxAntenna, false);
343
344 // call GetChannel when the update period is exceeded, the channel matrix
345 // should be recomputed
346 Simulator::Schedule (MilliSeconds (firstTimeMs + updatePeriodMs + 1), &ThreeGppChannelMatrixUpdateTest::DoGetChannel,
347 this, channelModel, txMob, rxMob, txAntenna, rxAntenna, true);
348
350 Simulator::Destroy ();
351}
352
360{
368};
369
381{
382public:
387
392
393private:
397 virtual void DoRun (void);
398
406 void DoBeamforming (Ptr<NetDevice> thisDevice, Ptr<PhasedArrayModel> thisAntenna, Ptr<NetDevice> otherDevice, Ptr<PhasedArrayModel> otherAntenna);
407
414
422};
423
425 : TestCase ("Test case for the ThreeGppSpectrumPropagationLossModel class")
426{
427}
428
430{
431}
432
433void
435{
436 Vector aPos = thisDevice->GetNode ()->GetObject<MobilityModel> ()->GetPosition ();
437 Vector bPos = otherDevice->GetNode ()->GetObject<MobilityModel> ()->GetPosition ();
438
439 // compute the azimuth and the elevation angles
440 Angles completeAngle (bPos,aPos);
441
442 PhasedArrayModel::ComplexVector antennaWeights = thisAntenna->GetBeamformingVector (completeAngle);
443 thisAntenna->SetBeamformingVector (antennaWeights);
444}
445
446bool
448{
449 bool ret = true;
450 for (uint8_t i = 0; i < first->GetSpectrumModel ()->GetNumBands (); i++)
451 {
452 if ((*first) [i] != (*second) [i])
453 {
454 ret = false;
455 continue;
456 }
457 }
458 return ret;
459}
460
461void
463{
464 Ptr<SpectrumValue> rxPsdNew = params.lossModel->DoCalcRxPowerSpectralDensity (params.txParams, params.txMob, params.rxMob, params.txAntenna, params.rxAntenna);
465 NS_TEST_ASSERT_MSG_EQ (ArePsdEqual (params.rxPsdOld, rxPsdNew), false, "The long term is not updated when the channel matrix is recomputed");
466}
467
468void
470{
471 // Build the scenario for the test
472 Config::SetDefault ("ns3::ThreeGppChannelModel::UpdatePeriod", TimeValue (MilliSeconds (100)));
473
474 uint8_t txAntennaElements[] {4, 4}; // tx antenna dimensions
475 uint8_t rxAntennaElements[] {4, 4}; // rx antenna dimensions
476
477 // create the ChannelConditionModel object to be used to retrieve the
478 // channel condition
479 Ptr<ChannelConditionModel> condModel = CreateObject<AlwaysLosChannelConditionModel> ();
480
481 // create the ThreeGppSpectrumPropagationLossModel object, set frequency,
482 // scenario and channel condition model to be used
483 Ptr<ThreeGppSpectrumPropagationLossModel> lossModel = CreateObject<ThreeGppSpectrumPropagationLossModel> ();
484 lossModel->SetChannelModelAttribute ("Frequency", DoubleValue(2.4e9));
485 lossModel->SetChannelModelAttribute ("Scenario", StringValue("UMa"));
486 lossModel->SetChannelModelAttribute ("ChannelConditionModel", PointerValue (condModel)); // create the ThreeGppChannelModel object used to generate the channel matrix
487
488 // create the tx and rx nodes
490 nodes.Create (2);
491
492 // create the tx and rx devices
493 Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice> ();
494 Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice> ();
495
496 // associate the nodes and the devices
497 nodes.Get (0)->AddDevice (txDev);
498 txDev->SetNode (nodes.Get (0));
499 nodes.Get (1)->AddDevice (rxDev);
500 rxDev->SetNode (nodes.Get (1));
501
502 // create the tx and rx mobility models and set their positions
503 Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel> ();
504 txMob->SetPosition (Vector (0.0,0.0,10.0));
505 Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel> ();
506 rxMob->SetPosition (Vector (15.0,0.0,10.0)); // in this position the channel condition is always LOS
507
508 // associate the nodes and the mobility models
509 nodes.Get (0)->AggregateObject (txMob);
510 nodes.Get (1)->AggregateObject (rxMob);
511
512 // create the tx and rx antennas and set the their dimensions
513 Ptr<PhasedArrayModel> txAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (txAntennaElements [0]),
514 "NumRows", UintegerValue (txAntennaElements [1]),
515 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
516 Ptr<PhasedArrayModel> rxAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (rxAntennaElements [0]),
517 "NumRows", UintegerValue (rxAntennaElements [1]),
518 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
519
520 // set the beamforming vectors
521 DoBeamforming (txDev, txAntenna, rxDev, rxAntenna);
522 DoBeamforming (rxDev, rxAntenna, txDev, txAntenna);
523
524 // create the tx psd
526 double txPower = 0.1; // Watts
527 uint32_t channelNumber = 1;
528 Ptr<SpectrumValue> txPsd = sf.CreateTxPowerSpectralDensity (txPower, channelNumber);
529 Ptr<SpectrumSignalParameters> txParams = Create<SpectrumSignalParameters> ();
530 txParams->psd = txPsd->Copy ();
531
532 // compute the rx psd
533 Ptr<SpectrumValue> rxPsdOld = lossModel->DoCalcRxPowerSpectralDensity (txParams, txMob, rxMob, txAntenna, rxAntenna);
534
535 // 1) check that the rx PSD is equal for both the direct and the reverse channel
536 Ptr<SpectrumValue> rxPsdNew = lossModel->DoCalcRxPowerSpectralDensity (txParams, rxMob, txMob, rxAntenna, txAntenna);
537 NS_TEST_ASSERT_MSG_EQ (ArePsdEqual (rxPsdOld, rxPsdNew), true, "The long term for the direct and the reverse channel are different");
538
539 // 2) check if the long term is updated when changing the BF vector
540 // change the position of the rx device and recompute the beamforming vectors
541 rxMob->SetPosition (Vector (10.0, 5.0, 10.0));
542 PhasedArrayModel::ComplexVector txBfVector = txAntenna->GetBeamformingVector ();
543 txBfVector [0] = std::complex<double> (0.0, 0.0);
544 txAntenna->SetBeamformingVector (txBfVector);
545
546 rxPsdNew = lossModel->DoCalcRxPowerSpectralDensity (txParams, rxMob, txMob, rxAntenna, txAntenna);
547 NS_TEST_ASSERT_MSG_EQ (ArePsdEqual (rxPsdOld, rxPsdNew), false, "Changing the BF vectors the rx PSD does not change");
548
549 // update rxPsdOld
550 rxPsdOld = rxPsdNew;
551
552 // 3) check if the long term is updated when the channel matrix is recomputed
553 CheckLongTermUpdateParams params{lossModel, txParams, txMob, rxMob, rxPsdOld, txAntenna, rxAntenna};
555 this, params);
556
558 Simulator::Destroy ();
559}
560
567{
568public:
573};
574
576 : TestSuite ("three-gpp-channel", UNIT)
577{
579 AddTestCase (new ThreeGppChannelMatrixUpdateTest, TestCase::QUICK);
581}
582
void Run(ObjectFactory &factory, uint32_t pop, uint32_t total, uint32_t runs, Ptr< RandomVariableStream > eventStream, bool calRev)
Perform the runs for a single scheduler type.
Test case for the ThreeGppChannelModel class.
virtual void DoRun(void)
Build the test scenario.
std::vector< double > m_normVector
each element is the norm of a channel realization
void DoComputeNorm(Ptr< ThreeGppChannelModel > channelModel, Ptr< MobilityModel > txMob, Ptr< MobilityModel > rxMob, Ptr< PhasedArrayModel > txAntenna, Ptr< PhasedArrayModel > rxAntenna)
Compute the Frobenius norm of the channel matrix and stores it in m_normVector.
Test case for the ThreeGppChannelModel class.
void DoGetChannel(Ptr< ThreeGppChannelModel > channelModel, Ptr< MobilityModel > txMob, Ptr< MobilityModel > rxMob, Ptr< PhasedArrayModel > txAntenna, Ptr< PhasedArrayModel > rxAntenna, bool update)
This method is used to schedule the channel matrix computation at different time instants and to chec...
virtual void DoRun(void)
Build the test scenario.
Ptr< const ThreeGppChannelModel::ChannelMatrix > m_currentChannel
used by DoGetChannel to store the current channel matrix
Test suite for the ThreeGppChannelModel class.
Test case for the ThreeGppSpectrumPropagationLossModelTest class.
static bool ArePsdEqual(Ptr< SpectrumValue > first, Ptr< SpectrumValue > second)
Checks if two PSDs are equal.
virtual void DoRun(void)
Build the test scenario.
void CheckLongTermUpdate(const CheckLongTermUpdateParams &params)
Test of the long term component is correctly updated when the channel matrix is recomputed.
void DoBeamforming(Ptr< NetDevice > thisDevice, Ptr< PhasedArrayModel > thisAntenna, Ptr< NetDevice > otherDevice, Ptr< PhasedArrayModel > otherAntenna)
Points the beam of thisDevice towards otherDevice.
Class holding the azimuth and inclination angles of spherical coordinates.
Definition: angles.h:119
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:41
Keep track of the current position and velocity of an object.
void SetPosition(const Vector &position)
virtual Ptr< Node > GetNode(void) const =0
keep track of a set of node pointers.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
ComplexVector GetBeamformingVector(void) const
Returns the beamforming vector that is currently being used.
virtual uint64_t GetNumberOfElements(void) const =0
Returns the number of antenna elements.
void SetBeamformingVector(const ComplexVector &beamformingVector)
Sets the beamforming vector to be used.
std::vector< std::complex< double > > ComplexVector
type definition for complex vectors
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Ptr< SpectrumValue > Copy() const
Hold variables of type string.
Definition: string.h:41
encapsulates test code
Definition: test.h:994
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
A suite of tests to run.
Definition: test.h:1188
Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const override
Computes the received PSD.
void SetChannelModelAttribute(const std::string &name, const AttributeValue &value)
Sets the value of an attribute belonging to the associated MatrixBasedChannelModel instance.
AttributeValue implementation for Time.
Definition: nstime.h:1309
Hold an unsigned integer type.
Definition: uinteger.h:44
Implements Wifi SpectrumValue for the 2.4 GHz ISM band only, with a 5 MHz spectrum resolution.
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity(double txPower, uint8_t channel)
Creates a SpectrumValue instance that represents the TX Power Spectral Density of a wifi device corre...
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition: test.h:141
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Definition: test.h:323
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1253
Definition: first.py:1
nodes
Definition: first.py:28
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Definition: second.py:1
A structure that holds the parameters for the function CheckLongTermUpdate.
Ptr< ThreeGppSpectrumPropagationLossModel > lossModel
the ThreeGppSpectrumPropagationLossModel object used to compute the rx PSD
Ptr< MobilityModel > txMob
the mobility model of the tx device
Ptr< SpectrumValue > rxPsdOld
the previously received PSD
Ptr< SpectrumSignalParameters > txParams
the params of the tx signal
Ptr< PhasedArrayModel > rxAntenna
the antenna array of the rx device
Ptr< MobilityModel > rxMob
the mobility model of the rx device
Ptr< PhasedArrayModel > txAntenna
the antenna array of the tx device
Complex3DVector m_channel
channel matrix H[u][s][n].
Ptr< SpectrumValue > psd
The Power Spectral Density of the waveform, in linear units.
static ThreeGppChannelTestSuite myTestSuite
Static variable for test initialization.