A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
cosine-antenna-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 CTTC
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef COSINE_ANTENNA_MODEL_H
10#define COSINE_ANTENNA_MODEL_H
11
12#include "antenna-model.h"
13
14#include <ns3/object.h>
15
16namespace ns3
17{
18
19/**
20 * \ingroup antenna
21 *
22 * \brief Cosine Antenna Model
23 *
24 * This class implements the cosine model, similarly to what is described in:
25 * Cosine Antenna Element, Mathworks, Phased Array System Toolbox (Sep. 2020)
26 * Available online: https://www.mathworks.com/help/phased/ug/cosine-antenna-element.html
27 *
28 * The power pattern of the element is equal to:
29 // P(az,el) = cos(az/2)^2m * cos(pi/2 - incl/2)^2n,
30 // where az is the azimuth angle, and incl is the inclination angle.
31 *
32 * Differently from the source, the response is defined for azimuth and elevation angles
33 * between –180 and 180 degrees and is always positive.
34 * There is no response at the backside of a cosine antenna.
35 * The cosine response pattern achieves a maximum value of 1 (0 dB) at 0 degrees azimuth
36 * and 90 degrees inclination.
37 * An extra settable gain is added to the original model, to improve its generality.
38 */
40{
41 public:
42 /**
43 * \brief Get the type ID.
44 * \return The object TypeId.
45 */
46 static TypeId GetTypeId();
47
48 // inherited from AntennaModel
49 double GetGainDb(Angles a) override;
50
51 /**
52 * Get the vertical 3 dB beamwidth of the cosine antenna model.
53 * \return the vertical beamwidth in degrees
54 */
55 double GetVerticalBeamwidth() const;
56
57 /**
58 * Get the horizontal 3 dB beamwidth of the cosine antenna model.
59 * \return the horizontal beamwidth in degrees
60 */
61 double GetHorizontalBeamwidth() const;
62
63 /**
64 * Get the horizontal orientation of the antenna element.
65 * \return the horizontal orientation in degrees
66 */
67 double GetOrientation() const;
68
69 private:
70 /**
71 * Set the vertical 3 dB beamwidth (bilateral) of the cosine antenna model.
72 * \param verticalBeamwidthDegrees the vertical beamwidth in degrees
73 */
74 void SetVerticalBeamwidth(double verticalBeamwidthDegrees);
75
76 /**
77 * Set the horizontal 3 dB beamwidth (bilateral) of the cosine antenna model.
78 * \param horizontalBeamwidthDegrees the horizontal beamwidth in degrees
79 */
80 void SetHorizontalBeamwidth(double horizontalBeamwidthDegrees);
81
82 /**
83 * Set the horizontal orientation of the antenna element.
84 * \param orientationDegrees the horizontal orientation in degrees
85 */
86 void SetOrientation(double orientationDegrees);
87
88 /**
89 * Compute the exponent of the cosine antenna model from the beamwidth
90 * \param beamwidthDegrees the beamwidth in degrees
91 * \return the exponent
92 */
93 static double GetExponentFromBeamwidth(double beamwidthDegrees);
94
95 /**
96 * Compute the beamwidth of the cosine antenna model from the exponent
97 * \param exponent the exponent
98 * \return beamwidth in degrees
99 */
100 static double GetBeamwidthFromExponent(double exponent);
101
102 double m_verticalExponent; //!< exponent of the vertical direction
103 double m_horizontalExponent; //!< exponent of the horizontal direction
104 double m_orientationRadians; //!< orientation in radians in the horizontal direction (bearing)
105 double m_maxGain; //!< antenna gain in dB towards the main orientation
106};
107
108} // namespace ns3
109
110#endif // COSINE_ANTENNA_MODEL_H
Class holding the azimuth and inclination angles of spherical coordinates.
Definition angles.h:107
interface for antenna radiation pattern models
Cosine Antenna Model.
double m_maxGain
antenna gain in dB towards the main orientation
void SetHorizontalBeamwidth(double horizontalBeamwidthDegrees)
Set the horizontal 3 dB beamwidth (bilateral) of the cosine antenna model.
double GetHorizontalBeamwidth() const
Get the horizontal 3 dB beamwidth of the cosine antenna model.
double GetGainDb(Angles a) override
this method is expected to be re-implemented by each antenna model
double GetOrientation() const
Get the horizontal orientation of the antenna element.
static double GetBeamwidthFromExponent(double exponent)
Compute the beamwidth of the cosine antenna model from the exponent.
static double GetExponentFromBeamwidth(double beamwidthDegrees)
Compute the exponent of the cosine antenna model from the beamwidth.
static TypeId GetTypeId()
Get the type ID.
double GetVerticalBeamwidth() const
Get the vertical 3 dB beamwidth of the cosine antenna model.
double m_verticalExponent
exponent of the vertical direction
void SetVerticalBeamwidth(double verticalBeamwidthDegrees)
Set the vertical 3 dB beamwidth (bilateral) of the cosine antenna model.
void SetOrientation(double orientationDegrees)
Set the horizontal orientation of the antenna element.
double m_orientationRadians
orientation in radians in the horizontal direction (bearing)
double m_horizontalExponent
exponent of the horizontal direction
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.