A Discrete-Event Network Simulator
API
uniform-planar-array.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  */
17 
18 #ifndef UNIFORM_PLANAR_ARRAY_H
19 #define UNIFORM_PLANAR_ARRAY_H
20 
21 #include "phased-array-model.h"
22 
23 #include <ns3/object.h>
24 
25 namespace ns3
26 {
27 
37 {
38  public:
43 
47  ~UniformPlanarArray() override;
48 
53  static TypeId GetTypeId();
54 
65  std::pair<double, double> GetElementFieldPattern(Angles a, uint8_t polIndex = 0) const override;
66 
84  Vector GetElementLocation(uint64_t index) const override;
85 
91  bool IsDualPol() const override;
92 
97  double GetPolSlant() const override;
98 
104  uint8_t GetNumPols() const override;
105 
111  size_t GetNumElems() const override;
112 
119  void SetNumColumns(uint32_t n) override;
120 
125  uint32_t GetNumColumns() const override;
126 
133  void SetNumRows(uint32_t n) override;
134 
139  uint32_t GetNumRows() const override;
140 
145  void SetNumVerticalPorts(uint16_t nPorts) override;
146 
151  void SetNumHorizontalPorts(uint16_t nPorts) override;
152 
157  uint16_t GetNumVerticalPorts() const override;
158 
163  uint16_t GetNumHorizontalPorts() const override;
164 
169  uint16_t GetNumPorts() const override;
170 
175  size_t GetVElemsPerPort() const override;
176 
181  size_t GetHElemsPerPort() const override;
182 
187  size_t GetNumElemsPerPort() const override;
188 
195  uint16_t ArrayIndexFromPortIndex(uint16_t portIndex, uint16_t subElementIndex) const override;
196 
203  void SetAlpha(double alpha);
204 
211  void SetBeta(double beta);
212 
219  void SetPolSlant(double polSlant);
220 
227  void SetAntennaHorizontalSpacing(double s);
228 
233  double GetAntennaHorizontalSpacing() const;
234 
241  void SetAntennaVerticalSpacing(double s);
242 
247  double GetAntennaVerticalSpacing() const;
248 
254  void SetDualPol(bool isDualPol);
255 
261  uint8_t GetElemPol(size_t elemIndex) const override;
262 
263  private:
264  uint32_t m_numColumns{1};
265  uint32_t m_numRows{1};
266  double m_disV{0.5};
267  double m_disH{0.5};
268  double m_alpha{0.0};
269  double m_cosAlpha{1.0};
270  double m_sinAlpha{0.0};
271  double m_beta{0.0};
272  double m_cosBeta{1.0};
273  double m_sinBeta{0.0};
274  double m_polSlant{0.0};
275  bool m_isDualPolarized{false};
276  uint16_t m_numVPorts{1};
277  uint16_t m_numHPorts{1};
278  std::vector<double> m_cosPolSlant{1.0, 0.0};
279  std::vector<double> m_sinPolSlant{0.0, -1.0};
280 };
281 
282 } /* namespace ns3 */
283 
284 #endif /* UNIFORM_PLANAR_ARRAY_H */
Class holding the azimuth and inclination angles of spherical coordinates.
Definition: angles.h:118
Class implementing the phased array model virtual base class.
a unique identifier for an interface.
Definition: type-id.h:59
Class implementing Uniform Planar Array (UPA) model.
double m_disV
antenna spacing in the vertical direction in multiples of wave length
double m_sinAlpha
the sine of alpha
void SetPolSlant(double polSlant)
Set the polarization slant angle This method sets the polarization slant angle and computes its cosin...
uint16_t GetNumPorts() const override
Get the total number of antenna ports.
double m_disH
antenna spacing in the horizontal direction in multiples of wave length
void SetBeta(double beta)
Set the downtilt angle This method sets the downtilt angle and computes its cosine and sine.
bool m_isDualPolarized
if true antenna elements are dual-polarized
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.
void SetNumRows(uint32_t n) override
Set the number of rows of the phased array This method resets the stored beamforming vector to a Comp...
bool IsDualPol() const override
Check if an antenna array contains dual-polarized elements.
static TypeId GetTypeId()
Get the type ID.
void SetAlpha(double alpha)
Set the bearing angle This method sets the bearing angle and computes its cosine and sine.
void SetNumColumns(uint32_t n) override
Set the number of columns of the phased array This method resets the stored beamforming vector to a C...
double GetAntennaVerticalSpacing() const
Get the vertical spacing for the antenna elements of the phased array.
uint16_t GetNumVerticalPorts() const override
Get the number of vertical antenna ports.
uint16_t m_numVPorts
Number of vertical ports.
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 ...
double m_polSlant
the polarization slant angle in radians
uint8_t GetElemPol(size_t elemIndex) const override
Returns the index of polarization to which belongs the antenna element with a specific index.
uint32_t GetNumRows() const override
Get the number of rows of the phased array.
double GetPolSlant() const override
Returns polarization angle of first polarization.
double m_cosBeta
the cosine of Beta
void SetAntennaVerticalSpacing(double s)
Set the vertical spacing for the antenna elements of the phased array This method resets the stored b...
double GetAntennaHorizontalSpacing() const
Get the horizontal spacing for the antenna elements of the phased array.
~UniformPlanarArray() override
Destructor.
uint32_t m_numRows
number of rows
Vector GetElementLocation(uint64_t index) const override
Returns the location of the antenna element with the specified index assuming the left bottom corner ...
uint32_t m_numColumns
number of columns
double m_alpha
the bearing angle in radians
uint16_t GetNumHorizontalPorts() const override
Get the number of horizontal antenna ports.
uint16_t m_numHPorts
Number of horizontal ports.
void SetDualPol(bool isDualPol)
Set the polarization.
size_t GetHElemsPerPort() const override
Get the number of horizontal elements belonging to each port.
void SetNumVerticalPorts(uint16_t nPorts) override
Set the number of vertical antenna ports.
size_t GetVElemsPerPort() const override
Get the number of vertical elements belonging to each port.
uint32_t GetNumColumns() const override
Get the number of columns of the phased array.
void SetNumHorizontalPorts(uint16_t nPorts) override
Set the number of horizontal antenna ports.
std::vector< double > m_cosPolSlant
the cosine of polarization slant angle
double m_sinBeta
the sine of Beta
size_t GetNumElems() const override
Returns the number of total antenna elements.
void SetAntennaHorizontalSpacing(double s)
Set the horizontal spacing for the antenna elements of the phased array This method resets the stored...
double m_beta
the downtilt angle in radians
double m_cosAlpha
the cosine of alpha
size_t GetNumElemsPerPort() const override
Get the total number of elements belonging to each port.
uint8_t GetNumPols() const override
Returns the number of polarizations, 2 in the case that the antenna is dual-polarized,...
std::vector< double > m_sinPolSlant
the sine polarization slant angle
Every class exported by the ns3 library is enclosed in the ns3 namespace.