A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
three-gpp-spectrum-propagation-loss-model.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015, NYU WIRELESS, Tandon School of Engineering,
3 * New York University
4 * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
5 * University of Padova
6 *
7 * SPDX-License-Identifier: GPL-2.0-only
8 *
9 */
10
12
15
16#include "ns3/double.h"
17#include "ns3/log.h"
18#include "ns3/net-device.h"
19#include "ns3/node.h"
20#include "ns3/pointer.h"
21#include "ns3/simulator.h"
22#include "ns3/string.h"
23
24#include <map>
25
26namespace ns3
27{
28
29NS_LOG_COMPONENT_DEFINE("ThreeGppSpectrumPropagationLossModel");
30
31NS_OBJECT_ENSURE_REGISTERED(ThreeGppSpectrumPropagationLossModel);
32
37
42
43void
49
52{
53 static TypeId tid =
54 TypeId("ns3::ThreeGppSpectrumPropagationLossModel")
56 .SetGroupName("Spectrum")
58 .AddAttribute(
59 "ChannelModel",
60 "The channel model. It needs to implement the MatrixBasedChannelModel interface",
61 StringValue("ns3::ThreeGppChannelModel"),
65 return tid;
66}
67
68void
73
79
80double
82{
83 DoubleValue freq;
84 m_channelModel->GetAttribute("Frequency", freq);
85 return freq.Get();
86}
87
88void
90 const AttributeValue& value)
91{
92 m_channelModel->SetAttribute(name, value);
93}
94
95void
97 AttributeValue& value) const
98{
99 m_channelModel->GetAttribute(name, value);
100}
101
107{
108 NS_LOG_FUNCTION(this);
109
110 const PhasedArrayModel::ComplexVector& sW = sAnt->GetBeamformingVectorRef();
111 const PhasedArrayModel::ComplexVector& uW = uAnt->GetBeamformingVectorRef();
112 size_t sAntNumElems = sW.GetSize();
113 size_t uAntNumElems = uW.GetSize();
114 NS_ASSERT(uAntNumElems == params->m_channel.GetNumRows());
115 NS_ASSERT(sAntNumElems == params->m_channel.GetNumCols());
116 NS_LOG_DEBUG("CalcLongTerm with " << uW.GetSize() << " u antenna elements and " << sW.GetSize()
117 << " s antenna elements, and with "
118 << " s ports: " << sAnt->GetNumPorts()
119 << " u ports: " << uAnt->GetNumPorts());
120 NS_ASSERT_MSG((sAnt != nullptr) && (uAnt != nullptr), "Improper call to the method");
121 size_t numClusters = params->m_channel.GetNumPages();
122 // create and initialize the size of the longTerm 3D matrix
125 sAnt->GetNumPorts(),
126 numClusters);
127 // Calculate long term uW * Husn * sW, the result is a matrix
128 // with the dimensions #uPorts, #sPorts, #cluster
129 for (auto sPortIdx = 0; sPortIdx < sAnt->GetNumPorts(); sPortIdx++)
130 {
131 for (auto uPortIdx = 0; uPortIdx < uAnt->GetNumPorts(); uPortIdx++)
132 {
133 for (size_t cIndex = 0; cIndex < numClusters; cIndex++)
134 {
135 longTerm->Elem(uPortIdx, sPortIdx, cIndex) =
136 CalculateLongTermComponent(params, sAnt, uAnt, sPortIdx, uPortIdx, cIndex);
137 }
138 }
139 }
140 return longTerm;
141}
142
143std::complex<double>
148 uint16_t sPortIdx,
149 uint16_t uPortIdx,
150 uint16_t cIndex) const
151{
152 NS_LOG_FUNCTION(this);
153 const PhasedArrayModel::ComplexVector& sW = sAnt->GetBeamformingVectorRef();
154 const PhasedArrayModel::ComplexVector& uW = uAnt->GetBeamformingVectorRef();
155 auto sPortElems = sAnt->GetNumElemsPerPort();
156 auto uPortElems = uAnt->GetNumElemsPerPort();
157 auto startS = sAnt->ArrayIndexFromPortIndex(sPortIdx, 0);
158 auto startU = uAnt->ArrayIndexFromPortIndex(uPortIdx, 0);
159 std::complex<double> txSum(0, 0);
160 // limiting multiplication operations to the port location
161 auto sIndex = startS;
162 // The sub-array partition model is adopted for TXRU virtualization,
163 // as described in Section 5.2.2 of 3GPP TR 36.897,
164 // and so equal beam weights are used for all the ports.
165 // Support of the full-connection model for TXRU virtualization would need extensions.
166 const auto uElemsPerPort = uAnt->GetHElemsPerPort();
167 const auto sElemsPerPort = sAnt->GetHElemsPerPort();
168 for (size_t tIndex = 0; tIndex < sPortElems; tIndex++, sIndex++)
169 {
170 std::complex<double> rxSum(0, 0);
171 auto uIndex = startU;
172 for (size_t rIndex = 0; rIndex < uPortElems; rIndex++, uIndex++)
173 {
174 rxSum += uW[uIndex - startU] * params->m_channel(uIndex, sIndex, cIndex);
175 auto testV = (rIndex % uElemsPerPort);
176 auto ptInc = uElemsPerPort - 1;
177 if (testV == ptInc)
178 {
179 auto incVal = uAnt->GetNumColumns() - uElemsPerPort;
180 uIndex += incVal; // Increment by a factor to reach next column in a port
181 }
182 }
183
184 txSum += sW[sIndex - startS] * rxSum;
185 auto testV = (tIndex % sElemsPerPort);
186 auto ptInc = sElemsPerPort - 1;
187 if (testV == ptInc)
188 {
189 size_t incVal = sAnt->GetNumColumns() - sElemsPerPort;
190 sIndex += incVal; // Increment by a factor to reach next column in a port
191 }
192 }
193 return txSum;
194}
195
202 const Vector& sSpeed,
203 const ns3::Vector& uSpeed,
204 uint8_t numTxPorts,
205 uint8_t numRxPorts,
206 bool isReverse) const
207
208{
209 NS_LOG_FUNCTION(this);
210 Ptr<SpectrumSignalParameters> rxParams = params->Copy();
211 size_t numCluster = channelMatrix->m_channel.GetNumPages();
212 // compute the doppler term
213 // NOTE the update of Doppler is simplified by only taking the center angle of
214 // each cluster in to consideration.
215 double slotTime = Simulator::Now().GetSeconds();
216 double factor = 2 * M_PI * slotTime * GetFrequency() / 3e8;
217 PhasedArrayModel::ComplexVector doppler(numCluster);
218
219 // Make sure that all the structures that are passed to this function
220 // are of the correct dimensions before using the operator [].
221 NS_ASSERT(numCluster <= channelParams->m_alpha.size());
222 NS_ASSERT(numCluster <= channelParams->m_D.size());
223 NS_ASSERT(numCluster <= channelParams->m_angle[MatrixBasedChannelModel::ZOA_INDEX].size());
224 NS_ASSERT(numCluster <= channelParams->m_angle[MatrixBasedChannelModel::ZOD_INDEX].size());
225 NS_ASSERT(numCluster <= channelParams->m_angle[MatrixBasedChannelModel::AOA_INDEX].size());
226 NS_ASSERT(numCluster <= channelParams->m_angle[MatrixBasedChannelModel::AOD_INDEX].size());
227 NS_ASSERT(numCluster <= longTerm->GetNumPages());
228
229 // check if channelParams structure is generated in direction s-to-u or u-to-s
230 bool isSameDir = (channelParams->m_nodeIds == channelMatrix->m_nodeIds);
231
232 // if channel params is generated in the same direction in which we
233 // generate the channel matrix, angles and zenith of departure and arrival are ok,
234 // just set them to corresponding variable that will be used for the generation
235 // of channel matrix, otherwise we need to flip angles and zeniths of departure and arrival
236 using DPV = std::vector<std::pair<double, double>>;
237 using MBCM = MatrixBasedChannelModel;
238 const auto& cachedAngleSincos = channelParams->m_cachedAngleSincos;
239 const DPV& zoa = cachedAngleSincos[isSameDir ? MBCM::ZOA_INDEX : MBCM::ZOD_INDEX];
240 const DPV& zod = cachedAngleSincos[isSameDir ? MBCM::ZOD_INDEX : MBCM::ZOA_INDEX];
241 const DPV& aoa = cachedAngleSincos[isSameDir ? MBCM::AOA_INDEX : MBCM::AOD_INDEX];
242 const DPV& aod = cachedAngleSincos[isSameDir ? MBCM::AOD_INDEX : MBCM::AOA_INDEX];
243
244 for (size_t cIndex = 0; cIndex < numCluster; cIndex++)
245 {
246 // Compute alpha and D as described in 3GPP TR 37.885 v15.3.0, Sec. 6.2.3
247 // These terms account for an additional Doppler contribution due to the
248 // presence of moving objects in the surrounding environment, such as in
249 // vehicular scenarios.
250 // This contribution is applied only to the delayed (reflected) paths and
251 // must be properly configured by setting the value of
252 // m_vScatt, which is defined as "maximum speed of the vehicle in the
253 // layout".
254 // By default, m_vScatt is set to 0, so there is no additional Doppler
255 // contribution.
256
257 double alpha = channelParams->m_alpha[cIndex];
258 double D = channelParams->m_D[cIndex];
259
260 // cluster angle angle[direction][n], where direction = 0(aoa), 1(zoa).
261 double tempDoppler =
262 factor *
263 ((zoa[cIndex].first * aoa[cIndex].second * uSpeed.x +
264 zoa[cIndex].first * aoa[cIndex].first * uSpeed.y + zoa[cIndex].second * uSpeed.z) +
265 (zod[cIndex].first * aod[cIndex].second * sSpeed.x +
266 zod[cIndex].first * aod[cIndex].first * sSpeed.y + zod[cIndex].second * sSpeed.z) +
267 2 * alpha * D);
268 doppler[cIndex] = std::complex<double>(cos(tempDoppler), sin(tempDoppler));
269 }
270
271 NS_ASSERT(numCluster <= doppler.GetSize());
272
273 // set the channel matrix
274 rxParams->spectrumChannelMatrix = GenSpectrumChannelMatrix(rxParams->psd,
275 longTerm,
276 channelMatrix,
277 channelParams,
278 doppler,
279 numTxPorts,
280 numRxPorts,
281 isReverse);
282
283 NS_ASSERT_MSG(rxParams->psd->GetValuesN() == rxParams->spectrumChannelMatrix->GetNumPages(),
284 "RX PSD and the spectrum channel matrix should have the same number of RBs ");
285
286 // Calculate RX PSD from the spectrum channel matrix H and
287 // the precoding matrix P as: PSD = (H*P)^h * (H*P)
289 if (!rxParams->precodingMatrix)
290 {
291 // When the precoding matrix P is not set, we create one with a single column
292 ComplexMatrixArray page =
293 ComplexMatrixArray(rxParams->spectrumChannelMatrix->GetNumCols(), 1, 1);
294 // Initialize it to the inverse square of the number of txPorts
295 page.Elem(0, 0, 0) = 1.0 / sqrt(rxParams->spectrumChannelMatrix->GetNumCols());
296 for (size_t rowI = 0; rowI < rxParams->spectrumChannelMatrix->GetNumCols(); rowI++)
297 {
298 page.Elem(rowI, 0, 0) = page.Elem(0, 0, 0);
299 }
300 // Replicate vector to match the number of RBGs
302 page.MakeNCopies(rxParams->spectrumChannelMatrix->GetNumPages()));
303 }
304 else
305 {
306 p = rxParams->precodingMatrix;
307 }
308 // When we have the precoding matrix P, we first do
309 // H(rxPorts,txPorts,numRbs) x P(txPorts,txStreams,numRbs) = HxP(rxPorts,txStreams,numRbs)
310 MatrixBasedChannelModel::Complex3DVector hP = *rxParams->spectrumChannelMatrix * *p;
311
312 // Then (HxP)^h dimensions are (txStreams, rxPorts, numRbs)
313 // MatrixBasedChannelModel::Complex3DVector hPHerm = hP.HermitianTranspose();
314
315 // Finally, (HxP)^h x (HxP) = PSD(txStreams, txStreams, numRbs)
316 // MatrixBasedChannelModel::Complex3DVector psd = hPHerm * hP;
317
318 // And the received psd is the Trace(PSD).
319 // To avoid wasting computations, we only compute the main diagonal of hPHerm*hP
320 for (uint32_t rbIdx = 0; rbIdx < rxParams->psd->GetValuesN(); ++rbIdx)
321 {
322 (*rxParams->psd)[rbIdx] = 0.0;
323 for (size_t rxPort = 0; rxPort < hP.GetNumRows(); ++rxPort)
324 {
325 for (size_t txStream = 0; txStream < hP.GetNumCols(); ++txStream)
326 {
327 (*rxParams->psd)[rbIdx] +=
328 std::real(std::conj(hP(rxPort, txStream, rbIdx)) * hP(rxPort, txStream, rbIdx));
329 }
330 }
331 }
332 return rxParams;
333}
334
337 Ptr<SpectrumValue> inPsd,
342 uint8_t numTxPorts,
343 uint8_t numRxPorts,
344 bool isReverse) const
345{
346 size_t numCluster = channelMatrix->m_channel.GetNumPages();
347 auto numRb = inPsd->GetValuesN();
348
349 auto directionalLongTerm = isReverse ? longTerm->Transpose() : (*longTerm);
350
352 Create<MatrixBasedChannelModel::Complex3DVector>(numRxPorts, numTxPorts, (uint16_t)numRb);
353
354 // Precompute the delay until numRb, numCluster or RB width changes
355 // Whenever the channelParams is updated, the number of numRbs, numClusters
356 // and RB width (12*SCS) are reset, ensuring these values are updated too
357 double rbWidth = inPsd->ConstBandsBegin()->fh - inPsd->ConstBandsBegin()->fl;
358
359 if (channelParams->m_cachedDelaySincos.GetNumRows() != numRb ||
360 channelParams->m_cachedDelaySincos.GetNumCols() != numCluster ||
361 channelParams->m_cachedRbWidth != rbWidth)
362 {
363 channelParams->m_cachedRbWidth = rbWidth;
364 channelParams->m_cachedDelaySincos = ComplexMatrixArray(numRb, numCluster);
365 auto sbit = inPsd->ConstBandsBegin(); // band iterator
366 for (unsigned i = 0; i < numRb; i++)
367 {
368 double fsb = (*sbit).fc; // center frequency of the sub-band
369 for (std::size_t cIndex = 0; cIndex < numCluster; cIndex++)
370 {
371 double delay = -2 * M_PI * fsb * (channelParams->m_delay[cIndex]);
372 channelParams->m_cachedDelaySincos(i, cIndex) =
373 std::complex<double>(cos(delay), sin(delay));
374 }
375 sbit++;
376 }
377 }
378
379 // Compute the product between the doppler and the delay sincos
380 auto delaySincosCopy = channelParams->m_cachedDelaySincos;
381 for (size_t iRb = 0; iRb < inPsd->GetValuesN(); iRb++)
382 {
383 for (std::size_t cIndex = 0; cIndex < numCluster; cIndex++)
384 {
385 delaySincosCopy(iRb, cIndex) *= doppler[cIndex];
386 }
387 }
388
389 // If "params" (ChannelMatrix) and longTerm were computed for the reverse direction (e.g. this
390 // is a DL transmission but params and longTerm were last updated during UL), then the elements
391 // in longTerm start from different offsets.
392
393 auto vit = inPsd->ValuesBegin(); // psd iterator
394 size_t iRb = 0;
395 // Compute the frequency-domain channel matrix
396 while (vit != inPsd->ValuesEnd())
397 {
398 if ((*vit) != 0.00)
399 {
400 auto sqrtVit = sqrt(*vit);
401 for (auto rxPortIdx = 0; rxPortIdx < numRxPorts; rxPortIdx++)
402 {
403 for (auto txPortIdx = 0; txPortIdx < numTxPorts; txPortIdx++)
404 {
405 std::complex<double> subsbandGain(0.0, 0.0);
406 for (size_t cIndex = 0; cIndex < numCluster; cIndex++)
407 {
408 subsbandGain += directionalLongTerm(rxPortIdx, txPortIdx, cIndex) *
409 delaySincosCopy(iRb, cIndex);
410 }
411 // Multiply with the square root of the input PSD so that the norm (absolute
412 // value squared) of chanSpct will be the output PSD
413 chanSpct->Elem(rxPortIdx, txPortIdx, iRb) = sqrtVit * subsbandGain;
414 }
415 }
416 }
417 vit++;
418 iRb++;
419 }
420 return chanSpct;
421}
422
426 Ptr<const PhasedArrayModel> aPhasedArrayModel,
427 Ptr<const PhasedArrayModel> bPhasedArrayModel) const
428{
430 longTerm; // vector containing the long term component for each cluster
431
432 // check if the channel matrix was generated considering a as the s-node and
433 // b as the u-node or vice-versa
434 auto isReverse =
435 channelMatrix->IsReverse(aPhasedArrayModel->GetId(), bPhasedArrayModel->GetId());
436 auto sAntenna = isReverse ? bPhasedArrayModel : aPhasedArrayModel;
437 auto uAntenna = isReverse ? aPhasedArrayModel : bPhasedArrayModel;
438
441 if (!isReverse)
442 {
443 sW = aPhasedArrayModel->GetBeamformingVector();
444 uW = bPhasedArrayModel->GetBeamformingVector();
445 }
446 else
447 {
448 sW = bPhasedArrayModel->GetBeamformingVector();
449 uW = aPhasedArrayModel->GetBeamformingVector();
450 }
451
452 bool update = false; // indicates whether the long term has to be updated
453 bool notFound = false; // indicates if the long term has not been computed yet
454
455 // compute the long term key, the key is unique for each tx-rx pair
456 uint64_t longTermId =
457 MatrixBasedChannelModel::GetKey(aPhasedArrayModel->GetId(), bPhasedArrayModel->GetId());
458
459 // look for the long term in the map and check if it is valid
460 if (m_longTermMap.find(longTermId) != m_longTermMap.end())
461 {
462 NS_LOG_DEBUG("found the long term component in the map");
463 longTerm = m_longTermMap[longTermId]->m_longTerm;
464
465 // check if the channel matrix has been updated
466 // or the s beam has been changed
467 // or the u beam has been changed
468 update = (m_longTermMap[longTermId]->m_channel->m_generatedTime !=
469 channelMatrix->m_generatedTime ||
470 m_longTermMap[longTermId]->m_sW != sW || m_longTermMap[longTermId]->m_uW != uW);
471 }
472 else
473 {
474 NS_LOG_DEBUG("long term component NOT found");
475 notFound = true;
476 }
477
478 if (update || notFound)
479 {
480 NS_LOG_DEBUG("compute the long term");
481 // compute the long term component
482 longTerm = CalcLongTerm(channelMatrix, sAntenna, uAntenna);
483 Ptr<LongTerm> longTermItem = Create<LongTerm>();
484 longTermItem->m_longTerm = longTerm;
485 longTermItem->m_channel = channelMatrix;
486 longTermItem->m_sW = std::move(sW);
487 longTermItem->m_uW = std::move(uW);
488 // store the long term to reduce computation load
489 // only the small scale fading needs to be updated if the large scale parameters and antenna
490 // weights remain unchanged.
491 m_longTermMap[longTermId] = longTermItem;
492 }
493
494 return longTerm;
495}
496
499 Ptr<const SpectrumSignalParameters> spectrumSignalParams,
502 Ptr<const PhasedArrayModel> aPhasedArrayModel,
503 Ptr<const PhasedArrayModel> bPhasedArrayModel) const
504{
505 NS_LOG_FUNCTION(this << spectrumSignalParams << a << b << aPhasedArrayModel
506 << bPhasedArrayModel);
507
508 uint32_t aId = a->GetObject<Node>()->GetId(); // id of the node a
509 uint32_t bId = b->GetObject<Node>()->GetId(); // id of the node b
510 NS_ASSERT_MSG(aPhasedArrayModel, "Antenna not found for node " << aId);
511 NS_LOG_DEBUG("a node " << aId << " antenna " << aPhasedArrayModel);
512 NS_ASSERT_MSG(bPhasedArrayModel, "Antenna not found for node " << bId);
513 NS_LOG_DEBUG("b node " << bId << " antenna " << bPhasedArrayModel);
514
516 m_channelModel->GetChannel(a, b, aPhasedArrayModel, bPhasedArrayModel);
518 m_channelModel->GetParams(a, b);
519
520 // retrieve the long term component
522 GetLongTerm(channelMatrix, aPhasedArrayModel, bPhasedArrayModel);
523
524 auto isReverse =
525 channelMatrix->IsReverse(aPhasedArrayModel->GetId(), bPhasedArrayModel->GetId());
526
527 // apply the beamforming gain
528 return CalcBeamformingGain(spectrumSignalParams,
529 longTerm,
530 channelMatrix,
531 channelParams,
532 a->GetVelocity(),
533 b->GetVelocity(),
534 aPhasedArrayModel->GetNumPorts(),
535 bPhasedArrayModel->GetNumPorts(),
536 isReverse);
537}
538
539int64_t
541{
542 return 0;
543}
544
545} // namespace ns3
Hold a value for an Attribute.
Definition attribute.h:59
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
double Get() const
Definition double.cc:26
This is an interface for a channel model that can be described by a channel matrix,...
static const uint8_t AOA_INDEX
index of the AOA value in the m_angle array
static const uint8_t ZOD_INDEX
index of the ZOD value in the m_angle array
static const uint8_t AOD_INDEX
index of the AOD value in the m_angle array
static const uint8_t ZOA_INDEX
index of the ZOA value in the m_angle array
static uint64_t GetKey(uint32_t a, uint32_t b)
Generate a unique value for the pair of unsigned integer of 32 bits, where the order does not matter,...
A network Node.
Definition node.h:46
spectrum-aware propagation loss model that is compatible with PhasedArrayModel type of ns-3 antenna
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
Hold variables of type string.
Definition string.h:45
void GetChannelModelAttribute(const std::string &name, AttributeValue &value) const
Returns the value of an attribute belonging to the associated MatrixBasedChannelModel instance.
Ptr< SpectrumSignalParameters > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > spectrumSignalParams, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const override
Computes the received PSD.
Ptr< MatrixBasedChannelModel > m_channelModel
the model to generate the channel matrix
Ptr< MatrixBasedChannelModel::Complex3DVector > GenSpectrumChannelMatrix(Ptr< SpectrumValue > inPsd, Ptr< const MatrixBasedChannelModel::Complex3DVector > longTerm, Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, Ptr< const MatrixBasedChannelModel::ChannelParams > channelParams, PhasedArrayModel::ComplexVector doppler, uint8_t numTxPorts, uint8_t numRxPorts, bool isReverse) const
Computes the frequency-domain channel matrix with the dimensions numRxPorts*numTxPorts*numRBs.
Ptr< const MatrixBasedChannelModel::Complex3DVector > GetLongTerm(Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const
Looks for the long term component in m_longTermMap.
void SetChannelModel(Ptr< MatrixBasedChannelModel > channel)
Set the channel model object.
Ptr< const MatrixBasedChannelModel::Complex3DVector > CalcLongTerm(Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, Ptr< const PhasedArrayModel > sAnt, Ptr< const PhasedArrayModel > uAnt) const
Computes the long term component.
std::unordered_map< uint64_t, Ptr< const LongTerm > > m_longTermMap
map containing the long term components
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
void SetChannelModelAttribute(const std::string &name, const AttributeValue &value)
Sets the value of an attribute belonging to the associated MatrixBasedChannelModel instance.
Ptr< MatrixBasedChannelModel > GetChannelModel() const
Get the channel model object.
Ptr< SpectrumSignalParameters > CalcBeamformingGain(Ptr< const SpectrumSignalParameters > params, Ptr< const MatrixBasedChannelModel::Complex3DVector > longTerm, Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, Ptr< const MatrixBasedChannelModel::ChannelParams > channelParams, const Vector &sSpeed, const Vector &uSpeed, uint8_t numTxPorts, uint8_t numRxPorts, bool isReverse) const
Computes the beamforming gain and applies it to the TX PSD.
std::complex< double > CalculateLongTermComponent(Ptr< const MatrixBasedChannelModel::ChannelMatrix > params, Ptr< const PhasedArrayModel > sAnt, Ptr< const PhasedArrayModel > uAnt, uint16_t sPortIdx, uint16_t uPortIdx, uint16_t cIndex) const
Computes a longTerm component from a specific port of s device to the specific port of u device and f...
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:392
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
size_t GetSize() const
Definition val-array.h:394
size_t GetNumRows() const
Definition val-array.h:373
size_t GetNumCols() const
Definition val-array.h:380
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition pointer.h:248
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
Definition pointer.h:269
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Definition first.py:1
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MatrixArray< std::complex< double > > ComplexMatrixArray
Create an alias for MatrixArray using complex type.