Class implementing Uniform Planar Array (UPA) model. More...
#include "uniform-planar-array.h"
Public Member Functions | |
UniformPlanarArray () | |
Constructor. More... | |
~UniformPlanarArray () override | |
Destructor. More... | |
uint16_t | ArrayIndexFromPortIndex (uint16_t portIndex, uint16_t subElementIndex) const override |
Maps element within a port to an index of element within the antenna array. More... | |
double | GetAntennaHorizontalSpacing () const |
Get the horizontal spacing for the antenna elements of the phased array. More... | |
double | GetAntennaVerticalSpacing () const |
Get the vertical spacing for the antenna elements of the phased array. More... | |
std::pair< double, double > | GetElementFieldPattern (Angles a, uint8_t polIndex=0) const override |
Returns the horizontal and vertical components of the antenna element field pattern at the specified direction and for the specified polarization. More... | |
Vector | GetElementLocation (uint64_t index) const override |
Returns the location of the antenna element with the specified index assuming the left bottom corner is (0,0,0), normalized with respect to the wavelength. More... | |
uint8_t | GetElemPol (size_t elemIndex) const override |
Returns the index of polarization to which belongs the antenna element with a specific index. More... | |
size_t | GetHElemsPerPort () const override |
Get the number of horizontal elements belonging to each port. More... | |
uint32_t | GetNumColumns () const override |
Get the number of columns of the phased array. More... | |
size_t | GetNumElems () const override |
Returns the number of total antenna elements. More... | |
size_t | GetNumElemsPerPort () const override |
Get the total number of elements belonging to each port. More... | |
uint16_t | GetNumHorizontalPorts () const override |
Get the number of horizontal antenna ports. More... | |
uint8_t | GetNumPols () const override |
Returns the number of polarizations, 2 in the case that the antenna is dual-polarized, otherwise 1. More... | |
uint16_t | GetNumPorts () const override |
Get the total number of antenna ports. More... | |
uint32_t | GetNumRows () const override |
Get the number of rows of the phased array. More... | |
uint16_t | GetNumVerticalPorts () const override |
Get the number of vertical antenna ports. More... | |
double | GetPolSlant () const override |
Returns polarization angle of first polarization. More... | |
size_t | GetVElemsPerPort () const override |
Get the number of vertical elements belonging to each port. More... | |
bool | IsDualPol () const override |
Check if an antenna array contains dual-polarized elements. More... | |
void | SetAlpha (double alpha) |
Set the bearing angle This method sets the bearing angle and computes its cosine and sine. More... | |
void | SetAntennaHorizontalSpacing (double s) |
Set the horizontal spacing for the antenna elements of the phased array This method resets the stored beamforming vector to a ComplexVector of the correct size, but zero-filled. More... | |
void | SetAntennaVerticalSpacing (double s) |
Set the vertical spacing for the antenna elements of the phased array This method resets the stored beamforming vector to a ComplexVector of the correct size, but zero-filled. More... | |
void | SetBeta (double beta) |
Set the downtilt angle This method sets the downtilt angle and computes its cosine and sine. More... | |
void | SetDualPol (bool isDualPol) |
Set the polarization. More... | |
void | SetNumColumns (uint32_t n) override |
Set the number of columns of the phased array This method resets the stored beamforming vector to a ComplexVector of the correct size, but zero-filled. More... | |
void | SetNumHorizontalPorts (uint16_t nPorts) override |
Set the number of horizontal antenna ports. More... | |
void | SetNumRows (uint32_t n) override |
Set the number of rows of the phased array This method resets the stored beamforming vector to a ComplexVector of the correct size, but zero-filled. More... | |
void | SetNumVerticalPorts (uint16_t nPorts) override |
Set the number of vertical antenna ports. More... | |
void | SetPolSlant (double polSlant) |
Set the polarization slant angle This method sets the polarization slant angle and computes its cosine and sine. More... | |
![]() | |
PhasedArrayModel () | |
Constructor. More... | |
~PhasedArrayModel () override | |
Destructor. More... | |
Ptr< const AntennaModel > | GetAntennaElement () const |
Returns a pointer to the AntennaModel instance used to model the elements of the array. More... | |
ComplexVector | GetBeamformingVector () const |
Returns the beamforming vector that is currently being used. More... | |
ComplexVector | GetBeamformingVector (Angles a) const |
Returns the beamforming vector that points towards the specified position. More... | |
const PhasedArrayModel::ComplexVector & | GetBeamformingVectorRef () const |
Returns the const reference of the beamforming vector that is currently being used. More... | |
uint32_t | GetId () const |
Returns the ID of this antenna array instance. More... | |
ComplexVector | GetSteeringVector (Angles a) const |
Returns the steering vector that points toward the specified position. More... | |
double | norm (const ComplexVector &complexVector) const |
Computes the Frobenius norm of the complex vector. More... | |
void | SetAntennaElement (Ptr< AntennaModel > antennaElement) |
Sets the antenna model to be used. More... | |
void | SetBeamformingVector (const ComplexVector &beamformingVector) |
Sets the beamforming vector to be used. More... | |
![]() | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () 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 errors. 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 () |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
![]() | |
static TypeId | GetTypeId () |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Private Attributes | |
double | m_alpha {0.0} |
the bearing angle in radians More... | |
double | m_beta {0.0} |
the downtilt angle in radians More... | |
double | m_cosAlpha {1.0} |
the cosine of alpha More... | |
double | m_cosBeta {1.0} |
the cosine of Beta More... | |
std::vector< double > | m_cosPolSlant {1.0, 0.0} |
the cosine of polarization slant angle More... | |
double | m_disH {0.5} |
antenna spacing in the horizontal direction in multiples of wave length More... | |
double | m_disV {0.5} |
antenna spacing in the vertical direction in multiples of wave length More... | |
bool | m_isDualPolarized {false} |
if true antenna elements are dual-polarized More... | |
uint32_t | m_numColumns {1} |
number of columns More... | |
uint16_t | m_numHPorts {1} |
Number of horizontal ports. More... | |
uint32_t | m_numRows {1} |
number of rows More... | |
uint16_t | m_numVPorts {1} |
Number of vertical ports. More... | |
double | m_polSlant {0.0} |
the polarization slant angle in radians More... | |
double | m_sinAlpha {0.0} |
the sine of alpha More... | |
double | m_sinBeta {0.0} |
the sine of Beta More... | |
std::vector< double > | m_sinPolSlant {0.0, -1.0} |
the sine polarization slant angle More... | |
Additional Inherited Members | |
![]() | |
using | ComplexVector = ComplexMatrixArray |
the underlying Valarray More... | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose () |
Destructor implementation. More... | |
virtual void | DoInitialize () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
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 () |
Notifier called once the ObjectBase is fully constructed. More... | |
![]() | |
Ptr< AntennaModel > | m_antennaElement |
the model of the antenna element in use More... | |
ComplexVector | m_beamformingVector |
the beamforming vector in use More... | |
uint32_t | m_id {0} |
the ID of this antenna array instance More... | |
bool | m_isBfVectorValid |
ensures the validity of the beamforming vector More... | |
![]() | |
static uint32_t | m_idCounter = 0 |
the ID counter that is used to determine the unique antenna array ID More... | |
![]() | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Class implementing Uniform Planar Array (UPA) model.
Definition at line 36 of file uniform-planar-array.h.
ns3::UniformPlanarArray::UniformPlanarArray | ( | ) |
Constructor.
Definition at line 32 of file uniform-planar-array.cc.
|
override |
Destructor.
Definition at line 37 of file uniform-planar-array.cc.
|
overridevirtual |
Maps element within a port to an index of element within the antenna array.
portIndex | the port index |
subElementIndex | the element index within the port |
Implements ns3::PhasedArrayModel.
Definition at line 352 of file uniform-planar-array.cc.
References GetHElemsPerPort(), GetNumColumns(), GetNumHorizontalPorts(), GetNumPorts(), GetNumRows(), GetNumVerticalPorts(), GetVElemsPerPort(), NS_ASSERT, and NS_ASSERT_MSG.
double ns3::UniformPlanarArray::GetAntennaHorizontalSpacing | ( | ) | const |
Get the horizontal spacing for the antenna elements of the phased array.
Definition at line 183 of file uniform-planar-array.cc.
References m_disH.
Referenced by GetTypeId().
double ns3::UniformPlanarArray::GetAntennaVerticalSpacing | ( | ) | const |
Get the vertical spacing for the antenna elements of the phased array.
Definition at line 202 of file uniform-planar-array.cc.
References m_disV.
Referenced by GetTypeId().
|
overridevirtual |
Returns the horizontal and vertical components of the antenna element field pattern at the specified direction and for the specified polarization.
a | the angle indicating the interested direction |
polIndex | the index of the polarization for which will be retrieved the field pattern |
Implements ns3::PhasedArrayModel.
Definition at line 208 of file uniform-planar-array.cc.
References ns3::Angles::GetAzimuth(), ns3::AntennaModel::GetGainDb(), ns3::Angles::GetInclination(), GetNumPols(), m_alpha, ns3::PhasedArrayModel::m_antennaElement, m_cosBeta, m_cosPolSlant, m_sinBeta, m_sinPolSlant, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::RadiansToDegrees().
|
overridevirtual |
Returns the location of the antenna element with the specified index assuming the left bottom corner is (0,0,0), normalized with respect to the wavelength.
Antenna elements are scanned row by row, left to right and bottom to top. For example, an antenna with 2 rows and 3 columns will be ordered as follows: ^ z | 3 4 5 | 0 1 2 -------—> y In case of dual-polarized antennas, the antennas of the first and the second polarization are overlapped in space.
index | index of the antenna element |
Implements ns3::PhasedArrayModel.
Definition at line 254 of file uniform-planar-array.cc.
References m_cosAlpha, m_cosBeta, m_disH, m_disV, m_isDualPolarized, m_numColumns, m_numRows, m_sinAlpha, m_sinBeta, and NS_LOG_FUNCTION.
|
overridevirtual |
Returns the index of polarization to which belongs the antenna element with a specific index.
elemIndex | the antenna element index |
Implements ns3::PhasedArrayModel.
Definition at line 399 of file uniform-planar-array.cc.
References GetNumColumns(), GetNumElems(), GetNumRows(), and NS_ASSERT.
|
overridevirtual |
Get the number of horizontal elements belonging to each port.
Implements ns3::PhasedArrayModel.
Definition at line 338 of file uniform-planar-array.cc.
References m_numColumns, and m_numHPorts.
Referenced by ArrayIndexFromPortIndex(), and GetNumElemsPerPort().
|
overridevirtual |
Get the number of columns of the phased array.
Implements ns3::PhasedArrayModel.
Definition at line 123 of file uniform-planar-array.cc.
References m_numColumns.
Referenced by ArrayIndexFromPortIndex(), GetElemPol(), and GetTypeId().
|
overridevirtual |
Returns the number of total antenna elements.
Note that if the antenna is dual-polarized the number of total antenna elements is doubled.
Implements ns3::PhasedArrayModel.
Definition at line 287 of file uniform-planar-array.cc.
References GetNumPols(), m_numColumns, and m_numRows.
Referenced by GetElemPol().
|
overridevirtual |
Get the total number of elements belonging to each port.
Implements ns3::PhasedArrayModel.
Definition at line 344 of file uniform-planar-array.cc.
References GetHElemsPerPort(), and GetVElemsPerPort().
|
overridevirtual |
Get the number of horizontal antenna ports.
Implements ns3::PhasedArrayModel.
Definition at line 320 of file uniform-planar-array.cc.
References m_numHPorts.
Referenced by ArrayIndexFromPortIndex(), and GetTypeId().
|
overridevirtual |
Returns the number of polarizations, 2 in the case that the antenna is dual-polarized, otherwise 1.
Implements ns3::PhasedArrayModel.
Definition at line 281 of file uniform-planar-array.cc.
References m_isDualPolarized.
Referenced by GetElementFieldPattern(), GetNumElems(), and GetNumPorts().
|
overridevirtual |
Get the total number of antenna ports.
Implements ns3::PhasedArrayModel.
Definition at line 326 of file uniform-planar-array.cc.
References GetNumPols(), m_numHPorts, and m_numVPorts.
Referenced by ArrayIndexFromPortIndex().
|
overridevirtual |
Get the number of rows of the phased array.
Implements ns3::PhasedArrayModel.
Definition at line 140 of file uniform-planar-array.cc.
References m_numRows.
Referenced by ArrayIndexFromPortIndex(), GetElemPol(), and GetTypeId().
|
overridevirtual |
Get the number of vertical antenna ports.
Implements ns3::PhasedArrayModel.
Definition at line 314 of file uniform-planar-array.cc.
References m_numVPorts.
Referenced by ArrayIndexFromPortIndex(), and GetTypeId().
|
overridevirtual |
Returns polarization angle of first polarization.
Implements ns3::PhasedArrayModel.
Definition at line 393 of file uniform-planar-array.cc.
References m_polSlant.
Referenced by GetTypeId().
|
static |
Get the type ID.
Definition at line 42 of file uniform-planar-array.cc.
References GetAntennaHorizontalSpacing(), GetAntennaVerticalSpacing(), GetNumColumns(), GetNumHorizontalPorts(), GetNumRows(), GetNumVerticalPorts(), GetPolSlant(), IsDualPol(), ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeDoubleAccessor(), ns3::MakeUintegerAccessor(), SetAlpha(), SetAntennaHorizontalSpacing(), SetAntennaVerticalSpacing(), SetBeta(), SetDualPol(), SetNumColumns(), SetNumHorizontalPorts(), SetNumRows(), SetNumVerticalPorts(), ns3::TypeId::SetParent(), and SetPolSlant().
|
overridevirtual |
Get the number of vertical elements belonging to each port.
Implements ns3::PhasedArrayModel.
Definition at line 332 of file uniform-planar-array.cc.
References m_numRows, and m_numVPorts.
Referenced by ArrayIndexFromPortIndex(), and GetNumElemsPerPort().
|
overridevirtual |
Check if an antenna array contains dual-polarized elements.
Implements ns3::PhasedArrayModel.
Definition at line 376 of file uniform-planar-array.cc.
References m_isDualPolarized.
Referenced by GetTypeId().
void ns3::UniformPlanarArray::SetAlpha | ( | double | alpha | ) |
Set the bearing angle This method sets the bearing angle and computes its cosine and sine.
alpha | the bearing angle in radians |
Definition at line 146 of file uniform-planar-array.cc.
References m_alpha, m_cosAlpha, and m_sinAlpha.
Referenced by GetTypeId().
void ns3::UniformPlanarArray::SetAntennaHorizontalSpacing | ( | double | s | ) |
Set the horizontal spacing for the antenna elements of the phased array This method resets the stored beamforming vector to a ComplexVector of the correct size, but zero-filled.
s | the horizontal spacing in multiples of wavelength |
Definition at line 170 of file uniform-planar-array.cc.
References m_disH, ns3::PhasedArrayModel::m_isBfVectorValid, NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::UniformPlanarArray::SetAntennaVerticalSpacing | ( | double | s | ) |
Set the vertical spacing for the antenna elements of the phased array This method resets the stored beamforming vector to a ComplexVector of the correct size, but zero-filled.
s | the vertical spacing in multiples of wavelength |
Definition at line 189 of file uniform-planar-array.cc.
References m_disV, ns3::PhasedArrayModel::m_isBfVectorValid, NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::UniformPlanarArray::SetBeta | ( | double | beta | ) |
Set the downtilt angle This method sets the downtilt angle and computes its cosine and sine.
beta | the downtilt angle in radians |
Definition at line 154 of file uniform-planar-array.cc.
References m_beta, m_cosBeta, and m_sinBeta.
Referenced by GetTypeId().
void ns3::UniformPlanarArray::SetDualPol | ( | bool | isDualPol | ) |
Set the polarization.
isDualPol | whether to set the antenna array to be dual-polarized, if true, antenna will be dual-polarized |
Definition at line 382 of file uniform-planar-array.cc.
References m_cosPolSlant, m_isDualPolarized, m_polSlant, and m_sinPolSlant.
Referenced by GetTypeId().
|
overridevirtual |
Set the number of columns of the phased array This method resets the stored beamforming vector to a ComplexVector of the correct size, but zero-filled.
n | the number of columns |
Implements ns3::PhasedArrayModel.
Definition at line 112 of file uniform-planar-array.cc.
References ns3::PhasedArrayModel::m_isBfVectorValid, m_numColumns, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
overridevirtual |
Set the number of horizontal antenna ports.
nPorts |
Implements ns3::PhasedArrayModel.
Definition at line 305 of file uniform-planar-array.cc.
References m_numColumns, m_numHPorts, and NS_ASSERT_MSG.
Referenced by GetTypeId().
|
overridevirtual |
Set the number of rows of the phased array This method resets the stored beamforming vector to a ComplexVector of the correct size, but zero-filled.
n | the number of rows |
Implements ns3::PhasedArrayModel.
Definition at line 129 of file uniform-planar-array.cc.
References ns3::PhasedArrayModel::m_isBfVectorValid, m_numRows, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
overridevirtual |
Set the number of vertical antenna ports.
nPorts | The number of vertical ports to be configured |
Implements ns3::PhasedArrayModel.
Definition at line 295 of file uniform-planar-array.cc.
References m_numRows, m_numVPorts, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::UniformPlanarArray::SetPolSlant | ( | double | polSlant | ) |
Set the polarization slant angle This method sets the polarization slant angle and computes its cosine and sine.
polSlant | the polarization slant angle in radians |
Definition at line 162 of file uniform-planar-array.cc.
References m_cosPolSlant, m_polSlant, and m_sinPolSlant.
Referenced by GetTypeId().
|
private |
the bearing angle in radians
Definition at line 268 of file uniform-planar-array.h.
Referenced by GetElementFieldPattern(), and SetAlpha().
|
private |
the downtilt angle in radians
Definition at line 271 of file uniform-planar-array.h.
Referenced by SetBeta().
|
private |
the cosine of alpha
Definition at line 269 of file uniform-planar-array.h.
Referenced by GetElementLocation(), and SetAlpha().
|
private |
the cosine of Beta
Definition at line 272 of file uniform-planar-array.h.
Referenced by GetElementFieldPattern(), GetElementLocation(), and SetBeta().
|
private |
the cosine of polarization slant angle
Definition at line 278 of file uniform-planar-array.h.
Referenced by GetElementFieldPattern(), SetDualPol(), and SetPolSlant().
|
private |
antenna spacing in the horizontal direction in multiples of wave length
Definition at line 267 of file uniform-planar-array.h.
Referenced by GetAntennaHorizontalSpacing(), GetElementLocation(), and SetAntennaHorizontalSpacing().
|
private |
antenna spacing in the vertical direction in multiples of wave length
Definition at line 266 of file uniform-planar-array.h.
Referenced by GetAntennaVerticalSpacing(), GetElementLocation(), and SetAntennaVerticalSpacing().
|
private |
if true antenna elements are dual-polarized
Definition at line 275 of file uniform-planar-array.h.
Referenced by GetElementLocation(), GetNumPols(), IsDualPol(), and SetDualPol().
|
private |
number of columns
Definition at line 264 of file uniform-planar-array.h.
Referenced by GetElementLocation(), GetHElemsPerPort(), GetNumColumns(), GetNumElems(), SetNumColumns(), and SetNumHorizontalPorts().
|
private |
Number of horizontal ports.
Definition at line 277 of file uniform-planar-array.h.
Referenced by GetHElemsPerPort(), GetNumHorizontalPorts(), GetNumPorts(), and SetNumHorizontalPorts().
|
private |
number of rows
Definition at line 265 of file uniform-planar-array.h.
Referenced by GetElementLocation(), GetNumElems(), GetNumRows(), GetVElemsPerPort(), SetNumRows(), and SetNumVerticalPorts().
|
private |
Number of vertical ports.
Definition at line 276 of file uniform-planar-array.h.
Referenced by GetNumPorts(), GetNumVerticalPorts(), GetVElemsPerPort(), and SetNumVerticalPorts().
|
private |
the polarization slant angle in radians
Definition at line 274 of file uniform-planar-array.h.
Referenced by GetPolSlant(), SetDualPol(), and SetPolSlant().
|
private |
the sine of alpha
Definition at line 270 of file uniform-planar-array.h.
Referenced by GetElementLocation(), and SetAlpha().
|
private |
the sine of Beta
Definition at line 273 of file uniform-planar-array.h.
Referenced by GetElementFieldPattern(), GetElementLocation(), and SetBeta().
|
private |
the sine polarization slant angle
Definition at line 279 of file uniform-planar-array.h.
Referenced by GetElementFieldPattern(), SetDualPol(), and SetPolSlant().