A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
three-gpp-ntn-channel-example.cc File Reference

This example is a modified version of "three-gpp-channel-example", to include the 3GPP NTN channel model. More...

#include "ns3/antenna-model.h"
#include "ns3/core-module.h"
#include "ns3/geocentric-constant-position-mobility-model.h"
#include "ns3/isotropic-antenna-model.h"
#include "ns3/mobility-model.h"
#include "ns3/node-container.h"
#include "ns3/node.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 <fstream>
Include dependency graph for three-gpp-ntn-channel-example.cc:

Go to the source code of this file.

Classes

struct  ComputeSnrParams
 A structure that holds the parameters for the ComputeSnr function. More...

Functions

static void ComputeSnr (ComputeSnrParams &params)
 Compute the average SNR.
Ptr< SpectrumValueCreateNoisePowerSpectralDensity (double fcHz, double noiseFigureDb, double bwHz, double rbWidthHz)
 Create the noise PSD for the.
Ptr< SpectrumValueCreateTxPowerSpectralDensity (double fcHz, double pwrDbm, double bwHz, double rbWidthHz)
 Create the PSD for the TX.
static void DoBeamforming (Ptr< MobilityModel > rxMob, Ptr< PhasedArrayModel > thisAntenna, Ptr< MobilityModel > txMob)
 Perform the beamforming using the DFT beamforming method.

Variables

static Ptr< ThreeGppPropagationLossModelm_propagationLossModel
 the PropagationLossModel object
static Ptr< ThreeGppSpectrumPropagationLossModelm_spectrumLossModel
 the SpectrumPropagationLossModel object
static std::ofstream resultsFile
 The results file.

Detailed Description

This example is a modified version of "three-gpp-channel-example", to include the 3GPP NTN channel model.

Specifically, most changes (which are also highlighted throughout the code) impact the main method, and comprise:

  • the configuration of ad-hoc propagation and channel condition models;
  • the use of GeocentricConstantPositionMobilityModel for the nodes' mobility. The pre-configured parameters are the one provided by 3GPP in TR 38.821, more specifically scenario 10 in down-link mode. Two static nodes, one on the ground and one in orbit, communicate with each other. The carrier frequency is set at 20GHz with 400MHz bandwidth. The result is the SNR of the signal and the path loss, saved in the ntn-snr-trace.txt file.

Definition in file three-gpp-ntn-channel-example.cc.

Function Documentation

◆ ComputeSnr()

void ComputeSnr ( ComputeSnrParams & params)
static

Compute the average SNR.

Parameters
paramsA structure that holds the parameters that are needed to perform calculations in ComputeSnr

Definition at line 237 of file three-gpp-ntn-channel-example.cc.

References ns3::ConstCast(), ns3::Create(), CreateNoisePowerSpectralDensity(), CreateTxPowerSpectralDensity(), ns3::Time::GetSeconds(), m_propagationLossModel, m_spectrumLossModel, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, resultsFile, and ns3::Sum().

Here is the call graph for this function:

◆ CreateNoisePowerSpectralDensity()

Ptr< SpectrumValue > CreateNoisePowerSpectralDensity ( double fcHz,
double noiseFigureDb,
double bwHz,
double rbWidthHz )

Create the noise PSD for the.

Parameters
fcHzthe carrier frequency in Hz
noiseFigureDbthe noise figure in dB
bwHzthe bandwidth in Hz
rbWidthHzthe Resource Block (RB) width in Hz
Returns
the pointer to the noise PSD

Definition at line 102 of file three-gpp-ntn-channel-example.cc.

References ns3::Create(), ns3::BandInfo::fc, ns3::BandInfo::fh, and ns3::BandInfo::fl.

Referenced by LteNoisePsdTestCase::LteNoisePsdTestCase(), and ComputeSnr().

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

◆ CreateTxPowerSpectralDensity()

Ptr< SpectrumValue > CreateTxPowerSpectralDensity ( double fcHz,
double pwrDbm,
double bwHz,
double rbWidthHz )

Create the PSD for the TX.

Parameters
fcHzthe carrier frequency in Hz
pwrDbmthe transmission power in dBm
bwHzthe bandwidth in Hz
rbWidthHzthe Resource Block (RB) width in Hz
Returns
the pointer to the PSD

Definition at line 59 of file three-gpp-ntn-channel-example.cc.

References ns3::Create(), ns3::BandInfo::fc, ns3::BandInfo::fh, and ns3::BandInfo::fl.

Referenced by LteDownlinkPowerControlSpectrumValueTestCase::LteDownlinkPowerControlSpectrumValueTestCase(), LteTxPsdTestCase::LteTxPsdTestCase(), and ComputeSnr().

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

◆ DoBeamforming()

void DoBeamforming ( Ptr< MobilityModel > rxMob,
Ptr< PhasedArrayModel > thisAntenna,
Ptr< MobilityModel > txMob )
static

Perform the beamforming using the DFT beamforming method.

Parameters
txMobthe mobility model of the node performing the beamforming
thisAntennathe antenna object associated to txMob
rxMobthe mobility model of the node towards which will point the beam

Definition at line 198 of file three-gpp-ntn-channel-example.cc.

References ns3::Angles::GetAzimuth(), and ns3::Angles::GetInclination().

Here is the call graph for this function:

Variable Documentation

◆ m_propagationLossModel

Ptr<ThreeGppPropagationLossModel> m_propagationLossModel
static

the PropagationLossModel object

Definition at line 43 of file three-gpp-ntn-channel-example.cc.

◆ m_spectrumLossModel

Ptr<ThreeGppSpectrumPropagationLossModel> m_spectrumLossModel
static

the SpectrumPropagationLossModel object

Definition at line 45 of file three-gpp-ntn-channel-example.cc.

◆ resultsFile

std::ofstream resultsFile
static

The results file.

Definition at line 46 of file three-gpp-ntn-channel-example.cc.

Referenced by ComputeSnr().