A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
16
namespace
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
*/
39
class
CosineAntennaModel
:
public
AntennaModel
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
antenna-model.h
ns3::Angles
Class holding the azimuth and inclination angles of spherical coordinates.
Definition
angles.h:107
ns3::AntennaModel
interface for antenna radiation pattern models
Definition
antenna-model.h:44
ns3::CosineAntennaModel
Cosine Antenna Model.
Definition
cosine-antenna-model.h:40
ns3::CosineAntennaModel::m_maxGain
double m_maxGain
antenna gain in dB towards the main orientation
Definition
cosine-antenna-model.h:105
ns3::CosineAntennaModel::SetHorizontalBeamwidth
void SetHorizontalBeamwidth(double horizontalBeamwidthDegrees)
Set the horizontal 3 dB beamwidth (bilateral) of the cosine antenna model.
Definition
cosine-antenna-model.cc:105
ns3::CosineAntennaModel::GetHorizontalBeamwidth
double GetHorizontalBeamwidth() const
Get the horizontal 3 dB beamwidth of the cosine antenna model.
Definition
cosine-antenna-model.cc:118
ns3::CosineAntennaModel::GetGainDb
double GetGainDb(Angles a) override
this method is expected to be re-implemented by each antenna model
Definition
cosine-antenna-model.cc:137
ns3::CosineAntennaModel::GetOrientation
double GetOrientation() const
Get the horizontal orientation of the antenna element.
Definition
cosine-antenna-model.cc:131
ns3::CosineAntennaModel::GetBeamwidthFromExponent
static double GetBeamwidthFromExponent(double exponent)
Compute the beamwidth of the cosine antenna model from the exponent.
Definition
cosine-antenna-model.cc:86
ns3::CosineAntennaModel::GetExponentFromBeamwidth
static double GetExponentFromBeamwidth(double beamwidthDegrees)
Compute the exponent of the cosine antenna model from the beamwidth.
Definition
cosine-antenna-model.cc:63
ns3::CosineAntennaModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
cosine-antenna-model.cc:26
ns3::CosineAntennaModel::GetVerticalBeamwidth
double GetVerticalBeamwidth() const
Get the vertical 3 dB beamwidth of the cosine antenna model.
Definition
cosine-antenna-model.cc:112
ns3::CosineAntennaModel::m_verticalExponent
double m_verticalExponent
exponent of the vertical direction
Definition
cosine-antenna-model.h:102
ns3::CosineAntennaModel::SetVerticalBeamwidth
void SetVerticalBeamwidth(double verticalBeamwidthDegrees)
Set the vertical 3 dB beamwidth (bilateral) of the cosine antenna model.
Definition
cosine-antenna-model.cc:98
ns3::CosineAntennaModel::SetOrientation
void SetOrientation(double orientationDegrees)
Set the horizontal orientation of the antenna element.
Definition
cosine-antenna-model.cc:124
ns3::CosineAntennaModel::m_orientationRadians
double m_orientationRadians
orientation in radians in the horizontal direction (bearing)
Definition
cosine-antenna-model.h:104
ns3::CosineAntennaModel::m_horizontalExponent
double m_horizontalExponent
exponent of the horizontal direction
Definition
cosine-antenna-model.h:103
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
antenna
model
cosine-antenna-model.h
Generated on Fri Nov 8 2024 13:58:58 for ns-3 by
1.11.0