A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
three-gpp-spatiotemporal-channel-consistency-example.cc File Reference
#include "ns3/buildings-module.h"
#include "ns3/core-module.h"
#include "ns3/mobility-module.h"
#include "ns3/network-module.h"
#include "ns3/spectrum-signal-parameters.h"
#include "ns3/three-gpp-channel-model.h"
#include "ns3/three-gpp-propagation-loss-model.h"
#include "ns3/three-gpp-spectrum-propagation-loss-model.h"
#include "ns3/uniform-planar-array.h"
#include <algorithm>
#include <array>
#include <fstream>
#include <limits>
Include dependency graph for three-gpp-spatiotemporal-channel-consistency-example.cc:

Go to the source code of this file.

Classes

struct  ChannelMetrics
 Metrics for the first three channel components and clusters. More...
struct  ComputeSnrParams
 A structure that holds the parameters for the ComputeSnr function. More...

Functions

static void ComputeSnr (const ComputeSnrParams &params)
 Computes the SNR.
static void CreateQuasiOmniBf (Ptr< PhasedArrayModel > antenna)
 Set QuasiOmni beamforming vector to the antenna array.
static ChannelMetrics GetChannelMetrics (const ComputeSnrParams &params)
 Get metrics for the first three channel components and clusters.
static double PowerRatioToDb (double power)
 Convert a non-negative linear power ratio to dB.
void PrintGnuplottableBuildingListToFile (std::string filename)
 Generates a GNU-plottable file representing the buildings deployed in the scenario.

Variables

static Ptr< ChannelConditionModel > g_condModel
 the ChannelConditionModel object
static Ptr< ThreeGppPropagationLossModel > g_propagationLossModel
 the log component
static Ptr< ThreeGppSpectrumPropagationLossModel > g_spectrumLossModel
 the SpectrumPropagationLossModel object

Function Documentation

◆ ComputeSnr()

void ComputeSnr ( const ComputeSnrParams & params)
static

Computes the SNR.

Parameters
paramsA structure that holds a bunch of parameters needed by ComputeSnr function to calculate the average SNR

Definition at line 288 of file three-gpp-spatiotemporal-channel-consistency-example.cc.

References ChannelMetrics::aoa, ChannelMetrics::clusterPowerDb, ChannelMetrics::componentPowerDb, ns3::Create(), ChannelMetrics::delay, g_condModel, g_propagationLossModel, g_spectrumLossModel, GetChannelMetrics(), ns3::Time::GetSeconds(), ns3::Simulator::Now(), ns3::Sum(), and ChannelMetrics::zoa.

Here is the call graph for this function:

◆ CreateQuasiOmniBf()

void CreateQuasiOmniBf ( Ptr< PhasedArrayModel > antenna)
static

Set QuasiOmni beamforming vector to the antenna array.

Parameters
Antenna modulethe antenna array to which will be set quasi omni beamforming vector

Definition at line 235 of file three-gpp-spatiotemporal-channel-consistency-example.cc.

◆ GetChannelMetrics()

ChannelMetrics GetChannelMetrics ( const ComputeSnrParams & params)
static

Get metrics for the first three channel components and clusters.

The channel-component power is computed as the mean squared magnitude of the coefficients in each channel-matrix component (squared Frobenius norm normalized by the number of TX/RX antenna-element pairs). In LOS, component 0 therefore includes the deterministic LOS contribution coherently combined with the strongest stochastic cluster by the channel model.

The cluster power, delay, AoA, and ZoA are taken directly from the channel parameters. These quantities retain their cluster-level definition and are used for the cluster-based spatial-consistency metrics.

Parameters
paramsthe objects used to obtain the channel and channel parameters
Returns
channel-component and cluster metrics for the first three entries

Definition at line 159 of file three-gpp-spatiotemporal-channel-consistency-example.cc.

References ns3::MatrixBasedChannelModel::AOA_INDEX, ns3::DynamicCast(), NS_ABORT_MSG_IF, PowerRatioToDb(), and ns3::MatrixBasedChannelModel::ZOA_INDEX.

Referenced by ComputeSnr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PowerRatioToDb()

double PowerRatioToDb ( double power)
static

Convert a non-negative linear power ratio to dB.

Parameters
powerthe linear power ratio
Returns
the power ratio in dB

Definition at line 135 of file three-gpp-spatiotemporal-channel-consistency-example.cc.

Referenced by GetChannelMetrics().

Here is the caller graph for this function:

◆ PrintGnuplottableBuildingListToFile()

void PrintGnuplottableBuildingListToFile ( std::string filename)

Generates a GNU-plottable file representing the buildings deployed in the scenario.

Parameters
filenamethe name of the output file

Definition at line 342 of file three-gpp-spatiotemporal-channel-consistency-example.cc.

References ns3::BuildingList::Begin(), ns3::BuildingList::End(), NS_LOG_ERROR, ns3::Box::xMax, ns3::Box::xMin, ns3::Box::yMax, and ns3::Box::yMin.

Here is the call graph for this function:

Variable Documentation

◆ g_condModel

Ptr<ChannelConditionModel> g_condModel
static

◆ g_propagationLossModel

Ptr<ThreeGppPropagationLossModel> g_propagationLossModel
static

the log component

the PropagationLossModel object

Definition at line 90 of file three-gpp-spatiotemporal-channel-consistency-example.cc.

Referenced by ComputeSnr().

◆ g_spectrumLossModel