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

SpectrumPhy implementation that creates a customizable TV transmitter which transmits a PSD spectrum specified by user-set attributes. More...

#include "tv-spectrum-transmitter.h"

+ Inheritance diagram for ns3::TvSpectrumTransmitter:
+ Collaboration diagram for ns3::TvSpectrumTransmitter:

Public Types

enum  TvType { TVTYPE_ANALOG , TVTYPE_8VSB , TVTYPE_COFDM }
 types of TV transmitters: analog, digital 8-VSB, or digital COFDM More...
 

Public Member Functions

 TvSpectrumTransmitter ()
 
 ~TvSpectrumTransmitter () override
 
virtual void CreateTvPsd ()
 Creates power spectral density (PSD) spectrum of the TV transmitter and sets it for transmission.
 
Ptr< ObjectGetAntenna () const override
 Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.
 
Ptr< SpectrumChannelGetChannel () const
 Get the spectrum channel.
 
Ptr< NetDeviceGetDevice () const override
 Get the associated NetDevice instance.
 
Ptr< MobilityModelGetMobility () const override
 Get the associated MobilityModel instance.
 
Ptr< const SpectrumModelGetRxSpectrumModel () const override
 
Ptr< SpectrumValueGetTxPsd () const
 Get the power spectral density of the TV transmitter's signal.
 
void SetChannel (Ptr< SpectrumChannel > c) override
 Set the channel attached to this device.
 
void SetDevice (Ptr< NetDevice > d) override
 Set the associated NetDevice instance.
 
void SetMobility (Ptr< MobilityModel > m) override
 Set the mobility model associated with this device.
 
virtual void Start ()
 Starts the TV Transmitter's transmission on the spectrum channel.
 
void StartRx (Ptr< SpectrumSignalParameters > params) override
 Notify the SpectrumPhy instance of an incoming signal.
 
virtual void Stop ()
 Stops the TV Transmitter's transmission on the spectrum channel.
 
- Public Member Functions inherited from ns3::SpectrumPhy
 SpectrumPhy ()
 
 SpectrumPhy (const SpectrumPhy &)=delete
 
 ~SpectrumPhy () override
 
SpectrumPhyoperator= (const SpectrumPhy &)=delete
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::SpectrumPhy
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Member Functions

virtual void SetupTx ()
 Sets up signal to be transmitted.
 

Private Attributes

bool m_active
 True if TV transmitter is transmitting.
 
Ptr< AntennaModelm_antenna
 Pointer to antenna model object.
 
double m_basePsd
 Base power spectral density value (in dBm/Hz) of TV transmitter's signal.
 
Ptr< SpectrumChannelm_channel
 Pointer to spectrum channel object.
 
double m_channelBandwidth
 Bandwidth (in Hz) of TV transmitter's signal.
 
Ptr< MobilityModelm_mobility
 Pointer to mobility model object.
 
Ptr< NetDevicem_netDevice
 Pointer to net device object.
 
double m_startFrequency
 Start frequency (in Hz) of TV transmitter's signal.
 
Time m_startingTime
 Timepoint after simulation begins that TV transmitter will begin transmitting.
 
Time m_transmitDuration
 Length of time that TV transmitter will transmit for.
 
TvType m_tvType
 Type of TV transmitter.
 
Ptr< SpectrumValuem_txPsd
 Pointer to power spectral density of TV transmitter's signal.
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Detailed Description

SpectrumPhy implementation that creates a customizable TV transmitter which transmits a PSD spectrum specified by user-set attributes.

This PHY model supports a single antenna model instance which is used for transmission (this PHY model never receives).

Definition at line 34 of file tv-spectrum-transmitter.h.

Member Enumeration Documentation

◆ TvType

types of TV transmitters: analog, digital 8-VSB, or digital COFDM

Enumerator
TVTYPE_ANALOG 
TVTYPE_8VSB 
TVTYPE_COFDM 

Definition at line 40 of file tv-spectrum-transmitter.h.

Constructor & Destructor Documentation

◆ TvSpectrumTransmitter()

ns3::TvSpectrumTransmitter::TvSpectrumTransmitter ( )

Definition at line 31 of file tv-spectrum-transmitter.cc.

References NS_LOG_FUNCTION.

◆ ~TvSpectrumTransmitter()

ns3::TvSpectrumTransmitter::~TvSpectrumTransmitter ( )
override

Member Function Documentation

◆ CreateTvPsd()

void ns3::TvSpectrumTransmitter::CreateTvPsd ( )
virtual

Creates power spectral density (PSD) spectrum of the TV transmitter and sets it for transmission.

8-VSB PSD approximated from Figure 3 of the following article: Baron, Stanley.

Before calling this method, must set attributes and parameters that are applicable to your transmitter.

8-VSB PSD approximated from Figure 3 of the following article: Baron, Stanley. "First-Hand:Digital Television: The Digital Terrestrial Television Broadcasting (DTTB) Standard." IEEE Global History Network. <http://www.ieeeghn.org/wiki/index.php/First-Hand:Digital_Television:The Digital_Terrestrial_Television_Broadcasting_(DTTB)_Standard>.

COFDM PSD approximated from Figure 12 (8k mode) of the following article: Kopp, Carlo. "High Definition Television." High Definition Television. Air Power Australia. http://www.ausairpower.net/AC-1100.html.

Analog PSD approximated from Figure 4 of the following paper: Stephen Shellhammer, Ahmed Sadek, and Wenyi Zhang. "Technical Challenges for Cognitive Radio in the TV White Space Spectrum." Qualcomm Incorporated.

"First-Hand:Digital Television: The Digital Terrestrial Television Broadcasting (DTTB) Standard." IEEE Global History Network. <http://www.ieeeghn.org/wiki/index.php/First-Hand:Digital_Television:The_Digital_Terrestrial_Television_Broadcasting(DTTB)_Standard>.

COFDM PSD approximated from Figure 12 (8k mode) of the following article: Kopp, Carlo. "High Definition Television." High Definition Television. Air Power Australia. http://www.ausairpower.net/AC-1100.html.

Analog PSD approximated from Figure 4 of the following paper: Stephen Shellhammer, Ahmed Sadek, and Wenyi Zhang. "Technical Challenges for Cognitive Radio in the TV White Space Spectrum." Qualcomm Incorporated.

Definition at line 233 of file tv-spectrum-transmitter.cc.

References ns3::Create(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, ns3::g_tvSpectrumModelMap, m_basePsd, m_channelBandwidth, m_startFrequency, m_tvType, m_txPsd, NS_ASSERT, NS_LOG_ERROR, NS_LOG_FUNCTION, TVTYPE_8VSB, TVTYPE_ANALOG, and TVTYPE_COFDM.

+ Here is the call graph for this function:

◆ GetAntenna()

Ptr< Object > ns3::TvSpectrumTransmitter::GetAntenna ( ) const
overridevirtual

Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.

Note that in general and depending on each module design, there can be multiple SpectrumPhy instances per NetDevice.

Returns
a Ptr to the AntennaModel used by this SpectrumPhy instance for transmission and/or reception

Implements ns3::SpectrumPhy.

Definition at line 163 of file tv-spectrum-transmitter.cc.

References m_antenna, and NS_LOG_FUNCTION.

◆ GetChannel()

Ptr< SpectrumChannel > ns3::TvSpectrumTransmitter::GetChannel ( ) const

Get the spectrum channel.

Returns
a pointer to the assigned spectrum channel

Definition at line 176 of file tv-spectrum-transmitter.cc.

References m_channel, and NS_LOG_FUNCTION.

◆ GetDevice()

Ptr< NetDevice > ns3::TvSpectrumTransmitter::GetDevice ( ) const
overridevirtual

Get the associated NetDevice instance.

Returns
a Ptr to the associated NetDevice instance

Implements ns3::SpectrumPhy.

Definition at line 149 of file tv-spectrum-transmitter.cc.

References m_netDevice, and NS_LOG_FUNCTION.

◆ GetMobility()

Ptr< MobilityModel > ns3::TvSpectrumTransmitter::GetMobility ( ) const
overridevirtual

Get the associated MobilityModel instance.

Returns
a Ptr to the associated MobilityModel instance

Implements ns3::SpectrumPhy.

Definition at line 142 of file tv-spectrum-transmitter.cc.

References m_mobility, and NS_LOG_FUNCTION.

◆ GetRxSpectrumModel()

Ptr< const SpectrumModel > ns3::TvSpectrumTransmitter::GetRxSpectrumModel ( ) const
overridevirtual
Returns
returns the SpectrumModel that this SpectrumPhy expects to be used for all SpectrumValues that are passed to StartRx. If 0 is returned, it means that any model will be accepted.

Implements ns3::SpectrumPhy.

Definition at line 156 of file tv-spectrum-transmitter.cc.

References NS_LOG_FUNCTION.

◆ GetTxPsd()

Ptr< SpectrumValue > ns3::TvSpectrumTransmitter::GetTxPsd ( ) const

Get the power spectral density of the TV transmitter's signal.

Returns
a pointer to the PSD

Definition at line 542 of file tv-spectrum-transmitter.cc.

References m_txPsd, and NS_LOG_FUNCTION.

◆ GetTypeId()

TypeId ns3::TvSpectrumTransmitter::GetTypeId ( )
static

Register this type.

Returns
The object TypeId.

Definition at line 59 of file tv-spectrum-transmitter.cc.

References m_antenna, m_basePsd, m_channelBandwidth, m_startFrequency, m_startingTime, m_transmitDuration, m_tvType, ns3::MakeDoubleAccessor(), ns3::MakeDoubleChecker(), ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::Seconds(), ns3::TypeId::SetParent(), TVTYPE_8VSB, TVTYPE_ANALOG, and TVTYPE_COFDM.

+ Here is the call graph for this function:

◆ SetChannel()

void ns3::TvSpectrumTransmitter::SetChannel ( Ptr< SpectrumChannel > c)
overridevirtual

Set the channel attached to this device.

Parameters
cthe channel

Implements ns3::SpectrumPhy.

Definition at line 121 of file tv-spectrum-transmitter.cc.

References m_channel, and NS_LOG_FUNCTION.

◆ SetDevice()

void ns3::TvSpectrumTransmitter::SetDevice ( Ptr< NetDevice > d)
overridevirtual

Set the associated NetDevice instance.

Parameters
dthe NetDevice instance

Implements ns3::SpectrumPhy.

Definition at line 135 of file tv-spectrum-transmitter.cc.

References m_netDevice, and NS_LOG_FUNCTION.

◆ SetMobility()

void ns3::TvSpectrumTransmitter::SetMobility ( Ptr< MobilityModel > m)
overridevirtual

Set the mobility model associated with this device.

Parameters
mthe mobility model

Implements ns3::SpectrumPhy.

Definition at line 128 of file tv-spectrum-transmitter.cc.

References m_mobility, and NS_LOG_FUNCTION.

◆ SetupTx()

void ns3::TvSpectrumTransmitter::SetupTx ( )
privatevirtual

Sets up signal to be transmitted.

Definition at line 549 of file tv-spectrum-transmitter.cc.

References ns3::Create(), ns3::Object::GetObject(), m_antenna, m_channel, m_transmitDuration, m_txPsd, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by Start().

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

◆ Start()

void ns3::TvSpectrumTransmitter::Start ( )
virtual

Starts the TV Transmitter's transmission on the spectrum channel.

Definition at line 562 of file tv-spectrum-transmitter.cc.

References m_active, m_startingTime, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), and SetupTx().

+ Here is the call graph for this function:

◆ StartRx()

void ns3::TvSpectrumTransmitter::StartRx ( Ptr< SpectrumSignalParameters > params)
overridevirtual

Notify the SpectrumPhy instance of an incoming signal.

Parameters
paramsthe parameters of the signals being received

Implements ns3::SpectrumPhy.

Definition at line 170 of file tv-spectrum-transmitter.cc.

References NS_LOG_FUNCTION.

◆ Stop()

void ns3::TvSpectrumTransmitter::Stop ( )
virtual

Stops the TV Transmitter's transmission on the spectrum channel.

Definition at line 574 of file tv-spectrum-transmitter.cc.

References m_active, and NS_LOG_FUNCTION.

Member Data Documentation

◆ m_active

bool ns3::TvSpectrumTransmitter::m_active
private

True if TV transmitter is transmitting.

Definition at line 130 of file tv-spectrum-transmitter.h.

Referenced by Start(), and Stop().

◆ m_antenna

Ptr<AntennaModel> ns3::TvSpectrumTransmitter::m_antenna
private

Pointer to antenna model object.

Definition at line 115 of file tv-spectrum-transmitter.h.

Referenced by ~TvSpectrumTransmitter(), GetAntenna(), GetTypeId(), and SetupTx().

◆ m_basePsd

double ns3::TvSpectrumTransmitter::m_basePsd
private

Base power spectral density value (in dBm/Hz) of TV transmitter's signal.

Definition at line 125 of file tv-spectrum-transmitter.h.

Referenced by CreateTvPsd(), and GetTypeId().

◆ m_channel

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

Pointer to spectrum channel object.

Definition at line 117 of file tv-spectrum-transmitter.h.

Referenced by ~TvSpectrumTransmitter(), GetChannel(), SetChannel(), and SetupTx().

◆ m_channelBandwidth

double ns3::TvSpectrumTransmitter::m_channelBandwidth
private

Bandwidth (in Hz) of TV transmitter's signal.

Definition at line 124 of file tv-spectrum-transmitter.h.

Referenced by CreateTvPsd(), and GetTypeId().

◆ m_mobility

Ptr<MobilityModel> ns3::TvSpectrumTransmitter::m_mobility
private

Pointer to mobility model object.

Definition at line 114 of file tv-spectrum-transmitter.h.

Referenced by ~TvSpectrumTransmitter(), GetMobility(), and SetMobility().

◆ m_netDevice

Ptr<NetDevice> ns3::TvSpectrumTransmitter::m_netDevice
private

Pointer to net device object.

Definition at line 116 of file tv-spectrum-transmitter.h.

Referenced by ~TvSpectrumTransmitter(), GetDevice(), and SetDevice().

◆ m_startFrequency

double ns3::TvSpectrumTransmitter::m_startFrequency
private

Start frequency (in Hz) of TV transmitter's signal.

Definition at line 123 of file tv-spectrum-transmitter.h.

Referenced by CreateTvPsd(), and GetTypeId().

◆ m_startingTime

Time ns3::TvSpectrumTransmitter::m_startingTime
private

Timepoint after simulation begins that TV transmitter will begin transmitting.

Definition at line 127 of file tv-spectrum-transmitter.h.

Referenced by GetTypeId(), and Start().

◆ m_transmitDuration

Time ns3::TvSpectrumTransmitter::m_transmitDuration
private

Length of time that TV transmitter will transmit for.

Definition at line 129 of file tv-spectrum-transmitter.h.

Referenced by GetTypeId(), and SetupTx().

◆ m_tvType

TvType ns3::TvSpectrumTransmitter::m_tvType
private

Type of TV transmitter.

Definition at line 122 of file tv-spectrum-transmitter.h.

Referenced by CreateTvPsd(), and GetTypeId().

◆ m_txPsd

Ptr<SpectrumValue> ns3::TvSpectrumTransmitter::m_txPsd
private

Pointer to power spectral density of TV transmitter's signal.

Definition at line 126 of file tv-spectrum-transmitter.h.

Referenced by ~TvSpectrumTransmitter(), CreateTvPsd(), GetTxPsd(), and SetupTx().


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