A Discrete-Event Network Simulator
API
three-gpp-channel-test-suite.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#include "ns3/abort.h"
19#include "ns3/angles.h"
20#include "ns3/channel-condition-model.h"
21#include "ns3/config.h"
22#include "ns3/constant-position-mobility-model.h"
23#include "ns3/double.h"
24#include "ns3/isotropic-antenna-model.h"
25#include "ns3/log.h"
26#include "ns3/node-container.h"
27#include "ns3/pointer.h"
28#include "ns3/simple-net-device.h"
29#include "ns3/simulator.h"
30#include "ns3/spectrum-signal-parameters.h"
31#include "ns3/string.h"
32#include "ns3/test.h"
33#include "ns3/three-gpp-channel-model.h"
34#include "ns3/three-gpp-spectrum-propagation-loss-model.h"
35#include "ns3/uinteger.h"
36#include "ns3/uniform-planar-array.h"
37#include "ns3/wifi-spectrum-value-helper.h"
38
39using namespace ns3;
40
41NS_LOG_COMPONENT_DEFINE("ThreeGppChannelTestSuite");
42
51{
52 public:
57
62
63 private:
67 void DoRun() override;
68
80 Ptr<PhasedArrayModel> txAntenna,
81 Ptr<PhasedArrayModel> rxAntenna);
82
83 std::vector<double> m_normVector;
84};
85
87 : TestCase("Check the dimensions and the norm of the channel matrix")
88{
89}
90
92{
93}
94
95void
99 Ptr<PhasedArrayModel> txAntenna,
100 Ptr<PhasedArrayModel> rxAntenna)
101{
102 uint64_t txAntennaElements = txAntenna->GetNumberOfElements();
103 uint64_t rxAntennaElements = rxAntenna->GetNumberOfElements();
104
106 channelModel->GetChannel(txMob, rxMob, txAntenna, rxAntenna);
107
108 double channelNorm = 0;
109 uint8_t numTotClusters = channelMatrix->m_channel.at(0).at(0).size();
110 for (uint8_t cIndex = 0; cIndex < numTotClusters; cIndex++)
111 {
112 double clusterNorm = 0;
113 for (uint64_t sIndex = 0; sIndex < txAntennaElements; sIndex++)
114 {
115 for (uint32_t uIndex = 0; uIndex < rxAntennaElements; uIndex++)
116 {
117 clusterNorm +=
118 std::pow(std::abs(channelMatrix->m_channel.at(uIndex).at(sIndex).at(cIndex)),
119 2);
120 }
121 }
122 channelNorm += clusterNorm;
123 }
124 m_normVector.push_back(channelNorm);
125}
126
127void
129{
130 // Build the scenario for the test
131 uint8_t txAntennaElements[]{2, 2}; // tx antenna dimensions
132 uint8_t rxAntennaElements[]{2, 2}; // rx antenna dimensions
133 uint32_t updatePeriodMs = 100; // update period in ms
134
135 // create the channel condition model
136 Ptr<ChannelConditionModel> channelConditionModel =
137 CreateObject<NeverLosChannelConditionModel>();
138
139 // create the ThreeGppChannelModel object used to generate the channel matrix
140 Ptr<ThreeGppChannelModel> channelModel = CreateObject<ThreeGppChannelModel>();
141 channelModel->SetAttribute("Frequency", DoubleValue(60.0e9));
142 channelModel->SetAttribute("Scenario", StringValue("RMa"));
143 channelModel->SetAttribute("ChannelConditionModel", PointerValue(channelConditionModel));
144 channelModel->SetAttribute("UpdatePeriod", TimeValue(MilliSeconds(updatePeriodMs - 1)));
145
146 // create the tx and rx nodes
148 nodes.Create(2);
149
150 // create the tx and rx devices
151 Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice>();
152 Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice>();
153
154 // associate the nodes and the devices
155 nodes.Get(0)->AddDevice(txDev);
156 txDev->SetNode(nodes.Get(0));
157 nodes.Get(1)->AddDevice(rxDev);
158 rxDev->SetNode(nodes.Get(1));
159
160 // create the tx and rx mobility models and set their positions
161 Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel>();
162 txMob->SetPosition(Vector(0.0, 0.0, 10.0));
163 Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel>();
164 rxMob->SetPosition(Vector(100.0, 0.0, 10.0));
165
166 // associate the nodes and the mobility models
167 nodes.Get(0)->AggregateObject(txMob);
168 nodes.Get(1)->AggregateObject(rxMob);
169
170 // create the tx and rx antennas and set the their dimensions
171 Ptr<PhasedArrayModel> txAntenna = CreateObjectWithAttributes<UniformPlanarArray>(
172 "NumColumns",
173 UintegerValue(txAntennaElements[0]),
174 "NumRows",
175 UintegerValue(txAntennaElements[1]),
176 "AntennaElement",
177 PointerValue(CreateObject<IsotropicAntennaModel>()));
178 Ptr<PhasedArrayModel> rxAntenna = CreateObjectWithAttributes<UniformPlanarArray>(
179 "NumColumns",
180 UintegerValue(rxAntennaElements[0]),
181 "NumRows",
182 UintegerValue(rxAntennaElements[1]),
183 "AntennaElement",
184 PointerValue(CreateObject<IsotropicAntennaModel>()));
185
186 // generate the channel matrix
188 channelModel->GetChannel(txMob, rxMob, txAntenna, rxAntenna);
189
190 // check the channel matrix dimensions
192 channelMatrix->m_channel.at(0).size(),
193 txAntennaElements[0] * txAntennaElements[1],
194 "The second dimension of H should be equal to the number of tx antenna elements");
196 channelMatrix->m_channel.size(),
197 rxAntennaElements[0] * rxAntennaElements[1],
198 "The first dimension of H should be equal to the number of rx antenna elements");
199
200 // test if the channel matrix is correctly generated
201 uint16_t numIt = 1000;
202 for (uint16_t i = 0; i < numIt; i++)
203 {
204 Simulator::Schedule(MilliSeconds(updatePeriodMs * i),
206 this,
207 channelModel,
208 txMob,
209 rxMob,
210 txAntenna,
211 rxAntenna);
212 }
213
214 Simulator::Run();
215
216 // compute the sample mean
217 double sampleMean = 0;
218 for (auto i : m_normVector)
219 {
220 sampleMean += i;
221 }
222 sampleMean /= numIt;
223
224 // compute the sample standard deviation
225 double sampleStd = 0;
226 for (auto i : m_normVector)
227 {
228 sampleStd += ((i - sampleMean) * (i - sampleMean));
229 }
230 sampleStd = std::sqrt(sampleStd / (numIt - 1));
231
232 // perform the one sample t-test with a significance level of 0.05 to test
233 // the hypothesis "E [|H|^2] = M*N, where |H| indicates the Frobenius norm of
234 // H, M is the number of transmit antenna elements, and N is the number of
235 // the receive antenna elements"
236 double t = (sampleMean - txAntennaElements[0] * txAntennaElements[1] * rxAntennaElements[0] *
237 rxAntennaElements[1]) /
238 (sampleMean / std::sqrt(numIt));
239
240 // Using a significance level of 0.05, we reject the null hypothesis if |t| is
241 // greater than the critical value from a t-distribution with df = numIt-1
243 std::abs(t),
244 0,
245 1.65,
246 "We reject the hypothesis E[|H|^2] = M*N with a significance level of 0.05");
247
248 Simulator::Destroy();
249}
250
259{
260 public:
265
270
271 private:
275 void DoRun() override;
276
287 void DoGetChannel(Ptr<ThreeGppChannelModel> channelModel,
288 Ptr<MobilityModel> txMob,
289 Ptr<MobilityModel> rxMob,
290 Ptr<PhasedArrayModel> txAntenna,
291 Ptr<PhasedArrayModel> rxAntenna,
292 bool update);
293
296};
297
299 : TestCase("Check if the channel realizations are correctly updated during the simulation")
300{
301}
302
304{
305}
306
307void
309 Ptr<MobilityModel> txMob,
310 Ptr<MobilityModel> rxMob,
311 Ptr<PhasedArrayModel> txAntenna,
312 Ptr<PhasedArrayModel> rxAntenna,
313 bool update)
314{
315 // retrieve the channel matrix
317 channelModel->GetChannel(txMob, rxMob, txAntenna, rxAntenna);
318
319 if (!m_currentChannel)
320 {
321 // this is the first time we compute the channel matrix, we initialize
322 // m_currentChannel
323 m_currentChannel = channelMatrix;
324 }
325 else
326 {
327 // compare the old and the new channel matrices
328 NS_TEST_ASSERT_MSG_EQ((m_currentChannel != channelMatrix),
329 update,
330 Simulator::Now().GetMilliSeconds()
331 << " The channel matrix is not correctly updated");
332 }
333}
334
335void
337{
338 // Build the scenario for the test
339
340 uint8_t txAntennaElements[]{2, 2}; // tx antenna dimensions
341 uint8_t rxAntennaElements[]{4, 4}; // rx antenna dimensions
342 uint32_t updatePeriodMs = 100; // update period in ms
343
344 // create the channel condition model
345 Ptr<ChannelConditionModel> channelConditionModel =
346 CreateObject<AlwaysLosChannelConditionModel>();
347
348 // create the ThreeGppChannelModel object used to generate the channel matrix
349 Ptr<ThreeGppChannelModel> channelModel = CreateObject<ThreeGppChannelModel>();
350 channelModel->SetAttribute("Frequency", DoubleValue(60.0e9));
351 channelModel->SetAttribute("Scenario", StringValue("UMa"));
352 channelModel->SetAttribute("ChannelConditionModel", PointerValue(channelConditionModel));
353 channelModel->SetAttribute("UpdatePeriod", TimeValue(MilliSeconds(updatePeriodMs)));
354
355 // create the tx and rx nodes
357 nodes.Create(2);
358
359 // create the tx and rx devices
360 Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice>();
361 Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice>();
362
363 // associate the nodes and the devices
364 nodes.Get(0)->AddDevice(txDev);
365 txDev->SetNode(nodes.Get(0));
366 nodes.Get(1)->AddDevice(rxDev);
367 rxDev->SetNode(nodes.Get(1));
368
369 // create the tx and rx mobility models and set their positions
370 Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel>();
371 txMob->SetPosition(Vector(0.0, 0.0, 10.0));
372 Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel>();
373 rxMob->SetPosition(Vector(100.0, 0.0, 1.6));
374
375 // associate the nodes and the mobility models
376 nodes.Get(0)->AggregateObject(txMob);
377 nodes.Get(1)->AggregateObject(rxMob);
378
379 // create the tx and rx antennas and set the their dimensions
380 Ptr<PhasedArrayModel> txAntenna = CreateObjectWithAttributes<UniformPlanarArray>(
381 "NumColumns",
382 UintegerValue(txAntennaElements[0]),
383 "NumRows",
384 UintegerValue(txAntennaElements[1]),
385 "AntennaElement",
386 PointerValue(CreateObject<IsotropicAntennaModel>()));
387 Ptr<PhasedArrayModel> rxAntenna = CreateObjectWithAttributes<UniformPlanarArray>(
388 "NumColumns",
389 UintegerValue(rxAntennaElements[0]),
390 "NumRows",
391 UintegerValue(rxAntennaElements[1]),
392 "AntennaElement",
393 PointerValue(CreateObject<IsotropicAntennaModel>()));
394
395 // check if the channel matrix is correctly updated
396
397 // compute the channel matrix for the first time
398 uint32_t firstTimeMs =
399 1; // time instant at which the channel matrix is generated for the first time
400 Simulator::Schedule(MilliSeconds(firstTimeMs),
402 this,
403 channelModel,
404 txMob,
405 rxMob,
406 txAntenna,
407 rxAntenna,
408 true);
409
410 // call GetChannel before the update period is exceeded, the channel matrix
411 // should not be updated
412 Simulator::Schedule(MilliSeconds(firstTimeMs + updatePeriodMs / 2),
414 this,
415 channelModel,
416 txMob,
417 rxMob,
418 txAntenna,
419 rxAntenna,
420 false);
421
422 // call GetChannel when the update period is exceeded, the channel matrix
423 // should be recomputed
424 Simulator::Schedule(MilliSeconds(firstTimeMs + updatePeriodMs + 1),
426 this,
427 channelModel,
428 txMob,
429 rxMob,
430 txAntenna,
431 rxAntenna,
432 true);
433
434 Simulator::Run();
435 Simulator::Destroy();
436}
437
445{
454};
455
467{
468 public:
473
478
479 private:
483 void DoRun() override;
484
492 void DoBeamforming(Ptr<NetDevice> thisDevice,
493 Ptr<PhasedArrayModel> thisAntenna,
494 Ptr<NetDevice> otherDevice,
495 Ptr<PhasedArrayModel> otherAntenna);
496
504
512};
513
515 : TestCase("Test case for the ThreeGppSpectrumPropagationLossModel class")
516{
517}
518
520{
521}
522
523void
525 Ptr<PhasedArrayModel> thisAntenna,
526 Ptr<NetDevice> otherDevice,
527 Ptr<PhasedArrayModel> otherAntenna)
528{
529 Vector aPos = thisDevice->GetNode()->GetObject<MobilityModel>()->GetPosition();
530 Vector bPos = otherDevice->GetNode()->GetObject<MobilityModel>()->GetPosition();
531
532 // compute the azimuth and the elevation angles
533 Angles completeAngle(bPos, aPos);
534
535 PhasedArrayModel::ComplexVector antennaWeights =
536 thisAntenna->GetBeamformingVector(completeAngle);
537 thisAntenna->SetBeamformingVector(antennaWeights);
538}
539
540bool
543{
544 bool ret = true;
545 for (uint8_t i = 0; i < first->GetSpectrumModel()->GetNumBands(); i++)
546 {
547 if ((*first)[i] != (*second)[i])
548 {
549 ret = false;
550 continue;
551 }
552 }
553 return ret;
554}
555
556void
558 const CheckLongTermUpdateParams& params)
559{
561 params.txMob,
562 params.rxMob,
563 params.txAntenna,
564 params.rxAntenna);
566 false,
567 "The long term is not updated when the channel matrix is recomputed");
568}
569
570void
572{
573 // Build the scenario for the test
574 Config::SetDefault("ns3::ThreeGppChannelModel::UpdatePeriod", TimeValue(MilliSeconds(100)));
575
576 uint8_t txAntennaElements[]{4, 4}; // tx antenna dimensions
577 uint8_t rxAntennaElements[]{4, 4}; // rx antenna dimensions
578
579 // create the ChannelConditionModel object to be used to retrieve the
580 // channel condition
581 Ptr<ChannelConditionModel> condModel = CreateObject<AlwaysLosChannelConditionModel>();
582
583 // create the ThreeGppSpectrumPropagationLossModel object, set frequency,
584 // scenario and channel condition model to be used
586 CreateObject<ThreeGppSpectrumPropagationLossModel>();
587 lossModel->SetChannelModelAttribute("Frequency", DoubleValue(2.4e9));
588 lossModel->SetChannelModelAttribute("Scenario", StringValue("UMa"));
589 lossModel->SetChannelModelAttribute(
590 "ChannelConditionModel",
591 PointerValue(condModel)); // create the ThreeGppChannelModel object used to generate the
592 // channel matrix
593
594 // create the tx and rx nodes
596 nodes.Create(2);
597
598 // create the tx and rx devices
599 Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice>();
600 Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice>();
601
602 // associate the nodes and the devices
603 nodes.Get(0)->AddDevice(txDev);
604 txDev->SetNode(nodes.Get(0));
605 nodes.Get(1)->AddDevice(rxDev);
606 rxDev->SetNode(nodes.Get(1));
607
608 // create the tx and rx mobility models and set their positions
609 Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel>();
610 txMob->SetPosition(Vector(0.0, 0.0, 10.0));
611 Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel>();
612 rxMob->SetPosition(
613 Vector(15.0, 0.0, 10.0)); // in this position the channel condition is always LOS
614
615 // associate the nodes and the mobility models
616 nodes.Get(0)->AggregateObject(txMob);
617 nodes.Get(1)->AggregateObject(rxMob);
618
619 // create the tx and rx antennas and set the their dimensions
620 Ptr<PhasedArrayModel> txAntenna = CreateObjectWithAttributes<UniformPlanarArray>(
621 "NumColumns",
622 UintegerValue(txAntennaElements[0]),
623 "NumRows",
624 UintegerValue(txAntennaElements[1]),
625 "AntennaElement",
626 PointerValue(CreateObject<IsotropicAntennaModel>()));
627 Ptr<PhasedArrayModel> rxAntenna = CreateObjectWithAttributes<UniformPlanarArray>(
628 "NumColumns",
629 UintegerValue(rxAntennaElements[0]),
630 "NumRows",
631 UintegerValue(rxAntennaElements[1]),
632 "AntennaElement",
633 PointerValue(CreateObject<IsotropicAntennaModel>()));
634
635 // set the beamforming vectors
636 DoBeamforming(txDev, txAntenna, rxDev, rxAntenna);
637 DoBeamforming(rxDev, rxAntenna, txDev, txAntenna);
638
639 // create the tx psd
641 double txPower = 0.1; // Watts
642 uint32_t channelNumber = 1;
643 Ptr<SpectrumValue> txPsd = sf.CreateTxPowerSpectralDensity(txPower, channelNumber);
644 Ptr<SpectrumSignalParameters> txParams = Create<SpectrumSignalParameters>();
645 txParams->psd = txPsd->Copy();
646
647 // compute the rx psd
648 Ptr<SpectrumValue> rxPsdOld =
649 lossModel->DoCalcRxPowerSpectralDensity(txParams, txMob, rxMob, txAntenna, rxAntenna);
650
651 // 1) check that the rx PSD is equal for both the direct and the reverse channel
652 Ptr<SpectrumValue> rxPsdNew =
653 lossModel->DoCalcRxPowerSpectralDensity(txParams, rxMob, txMob, rxAntenna, txAntenna);
654 NS_TEST_ASSERT_MSG_EQ(ArePsdEqual(rxPsdOld, rxPsdNew),
655 true,
656 "The long term for the direct and the reverse channel are different");
657
658 // 2) check if the long term is updated when changing the BF vector
659 // change the position of the rx device and recompute the beamforming vectors
660 rxMob->SetPosition(Vector(10.0, 5.0, 10.0));
662 txBfVector[0] = std::complex<double>(0.0, 0.0);
663 txAntenna->SetBeamformingVector(txBfVector);
664
665 rxPsdNew =
666 lossModel->DoCalcRxPowerSpectralDensity(txParams, rxMob, txMob, rxAntenna, txAntenna);
667 NS_TEST_ASSERT_MSG_EQ(ArePsdEqual(rxPsdOld, rxPsdNew),
668 false,
669 "Changing the BF vectors the rx PSD does not change");
670
671 // update rxPsdOld
672 rxPsdOld = rxPsdNew;
673
674 // 3) check if the long term is updated when the channel matrix is recomputed
676 params{lossModel, txParams, txMob, rxMob, rxPsdOld, txAntenna, rxAntenna};
677 Simulator::Schedule(MilliSeconds(101),
679 this,
680 params);
681
682 Simulator::Run();
683 Simulator::Destroy();
684}
685
692{
693 public:
698};
699
701 : TestSuite("three-gpp-channel", UNIT)
702{
704 AddTestCase(new ThreeGppChannelMatrixUpdateTest, TestCase::QUICK);
706}
707
Test case for the ThreeGppChannelModel class.
void DoRun() override
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...
void DoRun() override
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.
void DoRun() override
Build the test scenario.
static bool ArePsdEqual(Ptr< SpectrumValue > first, Ptr< SpectrumValue > second)
Checks if two PSDs are equal.
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:118
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:42
Keep track of the current position and velocity of an object.
void SetPosition(const Vector &position)
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Definition: node.cc:138
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Definition: object.cc:259
ComplexVector GetBeamformingVector() const
Returns the beamforming vector that is currently being used.
virtual uint64_t GetNumberOfElements() 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:42
encapsulates test code
Definition: test.h:1060
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:305
A suite of tests to run.
Definition: test.h:1256
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:1425
Hold an unsigned integer type.
Definition: uinteger.h:45
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:891
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
Time Now()
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:296
#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:144
#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:337
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1350
NodeContainer nodes
Definition: first.py:1
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.