Simple SpectrumPhy implemetation that averages the spectrum power density of incoming transmissions to produce a spectrogram. More...
#include "spectrum-analyzer.h"
Public Member Functions | |
SpectrumAnalyzer () | |
virtual | ~SpectrumAnalyzer () |
Ptr< NetDevice > | GetDevice () const |
get the associated NetDevice instance More... | |
Ptr< MobilityModel > | GetMobility () |
get the associated MobilityModel instance More... | |
Ptr< AntennaModel > | GetRxAntenna () |
get the AntennaModel used by the NetDevice for reception More... | |
Ptr< const SpectrumModel > | GetRxSpectrumModel () const |
void | SetAntenna (Ptr< AntennaModel > a) |
set the AntennaModel to be used More... | |
void | SetChannel (Ptr< SpectrumChannel > c) |
Set the channel attached to this device. More... | |
void | SetDevice (Ptr< NetDevice > d) |
set the associated NetDevice instance More... | |
void | SetMobility (Ptr< MobilityModel > m) |
Set the mobility model associated with this device. More... | |
void | SetRxSpectrumModel (Ptr< SpectrumModel > m) |
Set the spectrum model used by the SpectrumAnalyzer to represent incoming signals. More... | |
virtual void | Start () |
Start the spectrum analyzer. More... | |
void | StartRx (Ptr< SpectrumSignalParameters > params) |
Notify the SpectrumPhy instance of an incoming signal. More... | |
virtual void | Stop () |
Stop the spectrum analyzer. More... | |
![]() | |
SpectrumPhy () | |
virtual | ~SpectrumPhy () |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Implement the GetInstanceTypeId method defined in ObjectBase. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
![]() | |
static TypeId | GetTypeId (void) |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
void | DoDispose () |
Destructor implementation. More... | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
void | AddSignal (Ptr< const SpectrumValue > psd) |
virtual void | GenerateReport () |
void | SubtractSignal (Ptr< const SpectrumValue > psd) |
void | UpdateEnergyReceivedSoFar () |
Private Attributes | |
bool | m_active |
Ptr< AntennaModel > | m_antenna |
TracedCallback< Ptr< const SpectrumValue > > | m_averagePowerSpectralDensityReportTrace |
Ptr< SpectrumChannel > | m_channel |
Ptr< SpectrumValue > | m_energySpectralDensity |
Time | m_lastChangeTime |
Ptr< MobilityModel > | m_mobility |
Ptr< NetDevice > | m_netDevice |
double | m_noisePowerSpectralDensity |
Time | m_resolution |
Ptr< SpectrumModel > | m_spectrumModel |
Ptr< SpectrumValue > | m_sumPowerSpectralDensity |
Additional Inherited Members | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Simple SpectrumPhy implemetation that averages the spectrum power density of incoming transmissions to produce a spectrogram.
Introspection did not find any typical Config paths.
This PHY model supports a single antenna model instance which is used for reception (this PHY model never transmits).
Size of this type is 136 bytes (on a 64-bit architecture).
Definition at line 48 of file spectrum-analyzer.h.
ns3::SpectrumAnalyzer::SpectrumAnalyzer | ( | ) |
Definition at line 37 of file spectrum-analyzer.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 51 of file spectrum-analyzer.cc.
References NS_LOG_FUNCTION.
|
private |
Definition at line 170 of file spectrum-analyzer.cc.
References NS_LOG_FUNCTION, and UpdateEnergyReceivedSoFar().
Referenced by StartRx().
|
protectedvirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 57 of file spectrum-analyzer.cc.
References ns3::Object::DoDispose(), m_channel, m_energySpectralDensity, m_mobility, m_netDevice, m_spectrumModel, m_sumPowerSpectralDensity, and NS_LOG_FUNCTION.
|
privatevirtual |
Definition at line 201 of file spectrum-analyzer.cc.
References ns3::Time::GetSeconds(), ns3::SpectrumValue::GetSpectrumModel(), m_active, m_averagePowerSpectralDensityReportTrace, m_noisePowerSpectralDensity, m_resolution, m_sumPowerSpectralDensity, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Simulator::Schedule(), and UpdateEnergyReceivedSoFar().
Referenced by Start().
get the associated NetDevice instance
Implements ns3::SpectrumPhy.
Definition at line 102 of file spectrum-analyzer.cc.
References m_netDevice.
|
virtual |
get the associated MobilityModel instance
Implements ns3::SpectrumPhy.
Definition at line 109 of file spectrum-analyzer.cc.
References m_mobility.
|
virtual |
get the AntennaModel used by the NetDevice for reception
Implements ns3::SpectrumPhy.
Definition at line 146 of file spectrum-analyzer.cc.
References m_antenna.
|
virtual |
Implements ns3::SpectrumPhy.
Definition at line 116 of file spectrum-analyzer.cc.
References m_spectrumModel.
|
static |
Definition at line 70 of file spectrum-analyzer.cc.
References m_averagePowerSpectralDensityReportTrace, m_noisePowerSpectralDensity, m_resolution, ns3::MakeDoubleAccessor(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MilliSeconds(), and ns3::TypeId::SetParent().
void ns3::SpectrumAnalyzer::SetAntenna | ( | Ptr< AntennaModel > | a | ) |
set the AntennaModel to be used
a | the Antenna Model |
Definition at line 152 of file spectrum-analyzer.cc.
References m_antenna, and NS_LOG_FUNCTION.
|
virtual |
Set the channel attached to this device.
c | the channel |
Implements ns3::SpectrumPhy.
Definition at line 138 of file spectrum-analyzer.cc.
References m_channel, and NS_LOG_FUNCTION.
set the associated NetDevice instance
d | the NetDevice instance |
Implements ns3::SpectrumPhy.
Definition at line 122 of file spectrum-analyzer.cc.
References m_netDevice, and NS_LOG_FUNCTION.
|
virtual |
Set the mobility model associated with this device.
m | the mobility model |
Implements ns3::SpectrumPhy.
Definition at line 130 of file spectrum-analyzer.cc.
References m_mobility, and NS_LOG_FUNCTION.
void ns3::SpectrumAnalyzer::SetRxSpectrumModel | ( | Ptr< SpectrumModel > | m | ) |
Set the spectrum model used by the SpectrumAnalyzer to represent incoming signals.
m |
Definition at line 225 of file spectrum-analyzer.cc.
References m_energySpectralDensity, m_spectrumModel, m_sumPowerSpectralDensity, NS_ASSERT, and NS_LOG_FUNCTION.
|
virtual |
Start the spectrum analyzer.
Definition at line 239 of file spectrum-analyzer.cc.
References GenerateReport(), m_active, m_resolution, NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::Simulator::Schedule().
|
virtual |
Notify the SpectrumPhy instance of an incoming signal.
params | the parameters of the signals being received |
Implements ns3::SpectrumPhy.
Definition at line 161 of file spectrum-analyzer.cc.
References AddSignal(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SubtractSignal().
|
virtual |
Stop the spectrum analyzer.
Definition at line 252 of file spectrum-analyzer.cc.
References m_active.
|
private |
Definition at line 178 of file spectrum-analyzer.cc.
References NS_LOG_FUNCTION, and UpdateEnergyReceivedSoFar().
Referenced by StartRx().
|
private |
Definition at line 186 of file spectrum-analyzer.cc.
References m_lastChangeTime, ns3::Now(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by AddSignal(), GenerateReport(), and SubtractSignal().
|
private |
Definition at line 116 of file spectrum-analyzer.h.
Referenced by GenerateReport(), Start(), and Stop().
|
private |
Definition at line 100 of file spectrum-analyzer.h.
Referenced by GetRxAntenna(), and SetAntenna().
|
private |
Definition at line 118 of file spectrum-analyzer.h.
Referenced by GenerateReport(), and GetTypeId().
|
private |
Definition at line 102 of file spectrum-analyzer.h.
Referenced by DoDispose(), and SetChannel().
|
private |
Definition at line 112 of file spectrum-analyzer.h.
Referenced by DoDispose(), and SetRxSpectrumModel().
|
private |
Definition at line 115 of file spectrum-analyzer.h.
Referenced by UpdateEnergyReceivedSoFar().
|
private |
Definition at line 99 of file spectrum-analyzer.h.
Referenced by DoDispose(), GetMobility(), and SetMobility().
Definition at line 101 of file spectrum-analyzer.h.
Referenced by DoDispose(), GetDevice(), and SetDevice().
|
private |
Definition at line 113 of file spectrum-analyzer.h.
Referenced by GenerateReport(), and GetTypeId().
|
private |
Definition at line 114 of file spectrum-analyzer.h.
Referenced by GenerateReport(), GetTypeId(), and Start().
|
private |
Definition at line 110 of file spectrum-analyzer.h.
Referenced by DoDispose(), GetRxSpectrumModel(), and SetRxSpectrumModel().
|
private |
Definition at line 111 of file spectrum-analyzer.h.
Referenced by DoDispose(), GenerateReport(), and SetRxSpectrumModel().