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

This example shows how to configure the 3GPP channel model classes to compute the SNR between two nodes. More...

#include "ns3/channel-condition-model.h"
#include "ns3/constant-position-mobility-model.h"
#include "ns3/core-module.h"
#include "ns3/lte-spectrum-value-helper.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-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 (const ComputeSnrParams &params)
 Compute the average SNR.
static void DoBeamforming (Ptr< MobilityModel > txMob, Ptr< PhasedArrayModel > thisAntenna, Ptr< MobilityModel > rxMob)
 Perform the beamforming using the DFT beamforming method.

Variables

static Ptr< ThreeGppPropagationLossModelm_propagationLossModel
 the PropagationLossModel object
static Ptr< ThreeGppSpectrumPropagationLossModelm_spectrumLossModel
 the SpectrumPropagationLossModel object

Detailed Description

This example shows how to configure the 3GPP channel model classes to compute the SNR between two nodes.

The simulation involves two static nodes which are placed at a certain distance from each other and communicate through a wireless channel at 2 GHz with a bandwidth of 18 MHz. The default propagation environment is 3D-urban macro (UMa), and it can be configured changing the value of the string "scenario". Each node hosts has an antenna array with 4 antenna elements.

Usage

$ ./ns3 run "three-gpp-channel-example [Program Options]"

Program Options

--frequency
Operating frequency in Hz [2.125e+09]
--txPow
TX power in dBm [49]
--noiseFigure
Noise figure in dB [9]
--distance
Distance between TX and RX nodes in meters [10]
--simTime
Simulation time in milliseconds [1000]
--timeRes
Time resolution in milliseconds [10]
--scenario
3GPP propagation scenario [UMa]

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

Function Documentation

◆ ComputeSnr()

void ComputeSnr ( const 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 110 of file three-gpp-channel-example.cc.

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

Here is the call graph for this function:

◆ DoBeamforming()

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

Perform the beamforming using the DFT beamforming method.

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

Definition at line 66 of file three-gpp-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 40 of file three-gpp-channel-example.cc.

◆ m_spectrumLossModel

Ptr<ThreeGppSpectrumPropagationLossModel> m_spectrumLossModel
static

the SpectrumPropagationLossModel object

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