A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::SpectrumAnalyzerHelper Class Reference

Class to allow the Spectrum Analysis. More...

#include "spectrum-analyzer-helper.h"

+ Collaboration diagram for ns3::SpectrumAnalyzerHelper:

Public Member Functions

 SpectrumAnalyzerHelper ()
 
 ~SpectrumAnalyzerHelper ()
 
void EnableAsciiAll (std::string prefix)
 Enable ASCII output.
 
NetDeviceContainer Install (NodeContainer c) const
 
NetDeviceContainer Install (Ptr< Node > node) const
 
NetDeviceContainer Install (std::string nodeName) const
 
template<typename... Ts>
void SetAntenna (std::string type, Ts &&... args)
 
void SetChannel (Ptr< SpectrumChannel > channel)
 Set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper.
 
void SetChannel (std::string channelName)
 Set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper.
 
void SetDeviceAttribute (std::string n1, const AttributeValue &v1)
 
void SetPhyAttribute (std::string name, const AttributeValue &v)
 
void SetRxSpectrumModel (Ptr< SpectrumModel > m)
 Set the spectrum model used by the created SpectrumAnalyzer instances to represent incoming signals.
 

Private Attributes

ObjectFactory m_antenna
 Object factory for the Antenna objects.
 
Ptr< SpectrumChannelm_channel
 Channel.
 
ObjectFactory m_device
 Object factory for the NetDevice objects.
 
ObjectFactory m_phy
 Object factory for the phy objects.
 
std::string m_prefix
 Prefix for the output files.
 
Ptr< SpectrumModelm_rxSpectrumModel
 Spectrum model.
 

Detailed Description

Class to allow the Spectrum Analysis.

Definition at line 31 of file spectrum-analyzer-helper.h.

Constructor & Destructor Documentation

◆ SpectrumAnalyzerHelper()

ns3::SpectrumAnalyzerHelper::SpectrumAnalyzerHelper ( )

Definition at line 57 of file spectrum-analyzer-helper.cc.

References m_antenna, m_device, m_phy, NS_LOG_FUNCTION, and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ ~SpectrumAnalyzerHelper()

ns3::SpectrumAnalyzerHelper::~SpectrumAnalyzerHelper ( )

Definition at line 65 of file spectrum-analyzer-helper.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ EnableAsciiAll()

void ns3::SpectrumAnalyzerHelper::EnableAsciiAll ( std::string prefix)

Enable ASCII output.

This will create one filename for every created SpectrumAnalyzer instance.

Parameters
prefixthe prefix of the filename of the traces that will be created.

Definition at line 107 of file spectrum-analyzer-helper.cc.

References m_prefix, and NS_LOG_FUNCTION.

◆ Install() [1/3]

NetDeviceContainer ns3::SpectrumAnalyzerHelper::Install ( NodeContainer c) const
Parameters
cthe set of nodes on which a device must be created
Returns
a device container which contains all the devices created by this method.

Definition at line 114 of file spectrum-analyzer-helper.cc.

References ns3::NodeContainer::Begin(), ns3::Config::ConnectWithoutContext(), ns3::ObjectFactory::Create(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::NodeContainer::End(), ns3::AsciiTraceHelper::GetFilenameFromDevice(), ns3::Object::GetObject(), m_antenna, m_channel, m_device, m_phy, m_prefix, m_rxSpectrumModel, ns3::MakeBoundCallback(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::WriteAveragePowerSpectralDensityReport().

Referenced by Install(), and Install().

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

◆ Install() [2/3]

NetDeviceContainer ns3::SpectrumAnalyzerHelper::Install ( Ptr< Node > node) const
Parameters
nodethe node on which a device must be created
Returns
a device container which contains all the devices created by this method.

Definition at line 179 of file spectrum-analyzer-helper.cc.

References Install(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ Install() [3/3]

NetDeviceContainer ns3::SpectrumAnalyzerHelper::Install ( std::string nodeName) const
Parameters
nodeNamethe name of node on which a device must be created
Returns
a device container which contains all the devices created by this method.

Definition at line 186 of file spectrum-analyzer-helper.cc.

References ns3::Names::Find(), Install(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetAntenna()

template<typename... Ts>
void ns3::SpectrumAnalyzerHelper::SetAntenna ( std::string type,
Ts &&... args )
Template Parameters
Ts[deduced] Argument types
Parameters
typethe type of the model to set
[in]argsName and AttributeValue pairs to set.

Configure the AntennaModel instance for each new device to be created

Definition at line 125 of file spectrum-analyzer-helper.h.

References m_antenna.

◆ SetChannel() [1/2]

void ns3::SpectrumAnalyzerHelper::SetChannel ( Ptr< SpectrumChannel > channel)

Set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper.

Parameters
channel

Definition at line 71 of file spectrum-analyzer-helper.cc.

References m_channel, and NS_LOG_FUNCTION.

◆ SetChannel() [2/2]

void ns3::SpectrumAnalyzerHelper::SetChannel ( std::string channelName)

Set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper.

Parameters
channelName

Definition at line 78 of file spectrum-analyzer-helper.cc.

References ns3::Names::Find(), m_channel, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetDeviceAttribute()

void ns3::SpectrumAnalyzerHelper::SetDeviceAttribute ( std::string n1,
const AttributeValue & v1 )
Parameters
n1the name of the attribute to set
v1the value of the attribute to set

Set these attributes on each AlohaNoackNetDevice created

Definition at line 93 of file spectrum-analyzer-helper.cc.

References m_device, NS_LOG_FUNCTION, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

◆ SetPhyAttribute()

void ns3::SpectrumAnalyzerHelper::SetPhyAttribute ( std::string name,
const AttributeValue & v )
Parameters
namethe name of the attribute to set
vthe value of the attribute

Set these attributes on each HdOfdmSpectrumPhy instance to be created

Definition at line 86 of file spectrum-analyzer-helper.cc.

References m_phy, NS_LOG_FUNCTION, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

◆ SetRxSpectrumModel()

void ns3::SpectrumAnalyzerHelper::SetRxSpectrumModel ( Ptr< SpectrumModel > m)

Set the spectrum model used by the created SpectrumAnalyzer instances to represent incoming signals.

Parameters
m

Definition at line 100 of file spectrum-analyzer-helper.cc.

References m_rxSpectrumModel, and NS_LOG_FUNCTION.

Member Data Documentation

◆ m_antenna

ObjectFactory ns3::SpectrumAnalyzerHelper::m_antenna
private

Object factory for the Antenna objects.

Definition at line 112 of file spectrum-analyzer-helper.h.

Referenced by SpectrumAnalyzerHelper(), Install(), and SetAntenna().

◆ m_channel

Ptr<SpectrumChannel> ns3::SpectrumAnalyzerHelper::m_channel
private

Channel.

Definition at line 114 of file spectrum-analyzer-helper.h.

Referenced by Install(), SetChannel(), and SetChannel().

◆ m_device

ObjectFactory ns3::SpectrumAnalyzerHelper::m_device
private

Object factory for the NetDevice objects.

Definition at line 111 of file spectrum-analyzer-helper.h.

Referenced by SpectrumAnalyzerHelper(), Install(), and SetDeviceAttribute().

◆ m_phy

ObjectFactory ns3::SpectrumAnalyzerHelper::m_phy
private

Object factory for the phy objects.

Definition at line 110 of file spectrum-analyzer-helper.h.

Referenced by SpectrumAnalyzerHelper(), Install(), and SetPhyAttribute().

◆ m_prefix

std::string ns3::SpectrumAnalyzerHelper::m_prefix
private

Prefix for the output files.

Definition at line 116 of file spectrum-analyzer-helper.h.

Referenced by EnableAsciiAll(), and Install().

◆ m_rxSpectrumModel

Ptr<SpectrumModel> ns3::SpectrumAnalyzerHelper::m_rxSpectrumModel
private

Spectrum model.

Definition at line 115 of file spectrum-analyzer-helper.h.

Referenced by Install(), and SetRxSpectrumModel().


The documentation for this class was generated from the following files: