antenna: Reformat sphinx doc and make it uniform to other docs

This commit is contained in:
Alberto Gallegos Ramonet
2025-07-30 17:25:35 +09:00
parent 91717fd8d1
commit 0fee46ce13
14 changed files with 339 additions and 775 deletions

View File

@@ -18,6 +18,7 @@ This file is a best-effort approach to solving this issue; we will do our best b
### Changes to existing API
* (antenna) Reformatted documentation
* (lr-wpan) Debloat MAC PD-DATA.indication and reduce packet copies.
* (zigbee) Added group table

View File

@@ -32,6 +32,7 @@ been tested on Linux. As of this release, the latest known version to work with
ns-3 has switched to the C++23 standard by default.
- (antenna) !2516 - Reformatted documentation
- (core) A stacktrace will now be printed on fatal errors in supported platforms.
### Bugs fixed

View File

@@ -16,10 +16,7 @@ SOURCES = \
source/network.rst \
source/emulation-overview.rst \
source/traffic-control.rst \
$(SRC)/antenna/doc/source/antenna.rst \
$(SRC)/antenna/doc/source/antenna-design.rst \
$(SRC)/antenna/doc/source/antenna-user.rst \
$(SRC)/antenna/doc/source/antenna-testing.rst \
$(SRC)/antenna/doc/antenna.rst \
$(SRC)/aodv/doc/aodv.rst \
$(SRC)/applications/doc/applications.rst \
$(SRC)/bridge/doc/bridge.rst \
@@ -109,8 +106,8 @@ SOURCES = \
SOURCEFIGS = \
figures/testbed.dia \
figures/emulated-channel.dia \
$(SRC)/antenna/doc/source/figures/antenna-coordinate-system.dia \
$(SRC)/antenna/doc/source/figures/circular-antenna-pattern.png \
$(SRC)/antenna/doc/figures/antenna-coordinate-system.dia \
$(SRC)/antenna/doc/figures/circular-antenna-pattern.png \
$(SRC)/applications/doc/http-embedded-object-size.png \
$(SRC)/applications/doc/http-main-object-size.png \
$(SRC)/applications/doc/http-num-of-embedded-objects.png \

View File

@@ -1,169 +0,0 @@
include $(CURDIR)/../../../doc/sphinx/defines.mk
SOURCE = source
FIGURES = $(SOURCE)/figures
# specify figures from which .png and .pdf figures need to be
# generated (all dia and eps figures)
IMAGES_EPS = ${FIGURES}/antenna-coordinate-system.eps
# specify figures for build process (all eps figures)
GRAPHS_EPS =
# rescale pdf figures as necessary
$(FIGURES)/antenna-coordinate-system.pdf_width = 3in
IMAGES_PNG = ${IMAGES_EPS:.eps=.png}
IMAGES_PDF = ${IMAGES_EPS:.eps=.pdf}
IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
RESCALE = ../../../utils/rescale-pdf.sh
%.eps : %.dia; $(DIA) -t eps $< -e $@
%.png : %.dia; $(DIA) -t png $< -e $@
%.png : %.eps; $(CONVERT) $< $@
%.pdf : %.eps
$(EPSTOPDF) $< -o=$@
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
GRAPHS_PNG = ${GRAPHS_EPS:.eps=.png}
GRAPHS_PDF = ${GRAPHS_EPS:.eps=.pdf}
GRAPHS = $(GRAPHS_EPS) $(GRAPHS_PNG) $(GRAPHS_PDF)
%.png : %.eps; $(CONVERT) $< $@
%.pdf : %.eps
$(EPSTOPDF) $< -o=$@
@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
# Internal variables.
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCE)
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
-rm -f $(IMAGES_PNG)
-rm -f $(IMAGES_PDF)
-rm -f $(GRAPHS_PNG)
-rm -f $(GRAPHS_PDF)
frag: pickle
@if test ! -d $(BUILDDIR)/frag; then mkdir $(BUILDDIR)/frag; fi
pushd $(BUILDDIR)/frag && ../../pickle-to-xml.py ../pickle/index.fpickle > navigation.xml && popd
cp -r $(BUILDDIR)/pickle/_images $(BUILDDIR)/frag
html: $(IMAGES) ${GRAPHS}
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml: $(IMAGES)
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml: $(IMAGES)
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle: $(IMAGES)
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json: $(IMAGES)
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp: $(IMAGES)
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp: $(IMAGES)
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ns-3.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ns-3.qhc"
devhelp: $(IMAGES)
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/ns-3"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ns-3"
@echo "# devhelp"
epub: $(IMAGES)
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex: $(IMAGES) ${GRAPHS}
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf: $(IMAGES) ${GRAPHS}
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text: $(IMAGES)
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man: $(IMAGES)
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
changes: $(IMAGES)
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck: $(IMAGEs)
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest: $(IMAGES)
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

334
src/antenna/doc/antenna.rst Normal file
View File

@@ -0,0 +1,334 @@
.. include:: replace.txt
.. highlight:: cpp
.. highlight:: bash
Antenna
=======
The Antenna module provides:
- A class ``Angles`` and utility functions to deal with angles.
- A base class ``AntennaModel`` that provides an interface for the modeling of the radiation pattern of an antenna with a set of classes derived from this base class, each models the radiation pattern of different types of antennas.
- A base class ``PhasedArrayModel`` that provides a flexible interface for modeling a number of Phase Antenna Array (PAA) models.
- A class ``UniformPlanarArray`` derived from this base class, implementing a Uniform Planar Array (UPA) supporting both rectangular and linear lattices.
The antenna model can be used with all the wireless technologies and physical layer models that support it.
Currently, this includes the physical layer models based on the ``SpectrumPhy`` class. Please refer to the documentation of each of these models for details.
Scope and Limitations
---------------------
Not present.
Angles
------
The Angles class holds information about an angle in 3D space using spherical coordinates in radian units.
Specifically, it uses the azimuth-inclination convention, where
* Inclination is the angle between the zenith direction (positive z-axis) and the desired direction. It is included in the range [0, pi] radians.
* Azimuth is the signed angle measured from the positive x-axis, where a positive direction goes towards the positive y-axis. It is included in the range [-pi, pi) radians.
Multiple constructors are present, supporting the most common ways to encode information on a direction.
A static boolean variable allows the user to decide whether angles should be printed in radian or degree units.
A number of angle-related utilities are offered, such as radians/degree conversions, for both scalars and vectors, and angle wrapping.
AntennaModel
------------
The AntennaModel uses the coordinate system adopted in [:ref:`1<antennaRef1>`] and
depicted in Figure :ref:`fig-antenna-coordinate-system`. This system
is obtained by translating the Cartesian coordinate system used by the
ns-3 MobilityModel into the new origin :math:`o` which is the location
of the antenna, and then transforming the coordinates of every generic
point :math:`p` of the space from Cartesian coordinates
:math:`(x,y,z)` into spherical coordinates
:math:`(r, \theta,\phi)`.
The antenna model neglects the radial component :math:`r`, and
only considers the angle components :math:`(\theta, \phi)`. An antenna
radiation pattern is then expressed as a mathematical function
:math:`g(\theta, \phi) \longrightarrow \mathcal{R}` that returns the
gain (in dB) for each possible direction of
transmission/reception. All angles are expressed in radians.
.. _fig-antenna-coordinate-system:
.. figure:: figures/antenna-coordinate-system.*
:align: center
Coordinate system of the AntennaModel
The ``AntennaModel`` is used to implement a subset of derived classes that represents different radiation patterns of a single antenna.
The current models supported are:
- Isotropic Antenna Model
- Cosine Antenna Model
- Parabolic Antenna Model
- Three Gpp Antenna Model
**Isotropic Antenna Model**
This is the simplest antenna model. This antenna radiation pattern model provides the same gain (0 dB) for all directions.
This is implemented in the ``IsotropicAntennaModel`` class.
**Cosine Antenna Model**
This is the cosine model described in [:ref:`2<antennaRef2>`]: the antenna gain is
determined as:
.. math::
g(\phi, \theta) = \cos^{n} \left(\frac{\phi - \phi_{0}}{2} \right)
where :math:`\phi_{0}` is the azimuthal orientation of the antenna
(i.e., its direction of maximum gain) and the exponential
.. math::
n = -\frac{3}{20 \log_{10} \left( \cos \frac{\phi_{3dB}}{4} \right)}
determines the desired 3dB beamwidth :math:`\phi_{3dB}`. Note that
this radiation pattern is independent of the inclination angle
:math:`\theta`.
A major difference between the model of [:ref:`2<antennaRef2>`] and the one
implemented in the class CosineAntennaModel is that only the element
factor (i.e., what described by the above formulas) is considered. In
fact, [:ref:`2<antennaRef2>`] also considered an additional antenna array
factor. The reason why the latter is excluded is that we expect that
the average user would desire to specify a given beamwidth exactly,
without adding an array factor at a latter stage which would in
practice alter the effective beamwidth of the resulting radiation
pattern.
This is implemented in the ``CosineAntennaModel`` class.
.. _ParabolicAntennaModel:
**Parabolic Antenna Model**
This model is based on the parabolic approximation of the main lobe radiation pattern. It is often
used in the context of cellular system to model the radiation pattern of a cell sector, see for
instance [:ref:`3<antennaRef3>`] and [:ref:`4<antennaRef4>`]. The antenna gain in dB is determined as:
.. math::
g_{dB}(\phi, \theta) = -\min \left( 12 \left(\frac{\phi - \phi_{0}}{\phi_{3dB}} \right)^2, A_{max} \right)
where :math:`\phi_{0}` is the azimuthal orientation of the antenna
(i.e., its direction of maximum gain), :math:`\phi_{3dB}` is its 3 dB
beamwidth, and :math:`A_{max}` is the maximum attenuation in dB of the
antenna. Note that this radiation pattern is independent of the inclination angle
:math:`\theta`.
This is implemented in the ``ParabolicAntennaModel`` class.
**Three Gpp Antenna Model**
This model implements the antenna element described in [:ref:`5<antennaRef5>`].
Parameters are fixed from the technical report, thus no attributes nor setters are provided.
The model is largely based on the :ref:`Parabolic Antenna Model<ParabolicAntennaModel>`.
Phased Array Model
------------------
The class ``PhasedArrayModel`` has been created with flexibility in mind.
It abstracts the basic idea of a Phased Antenna Array (PAA) by removing any constraint on the
position of each element, and instead generalizes the concept of steering and beamforming vectors,
solely based on the generalized location of the antenna elements.
For details on Phased Array Antennas see for instance [:ref:`6<antennaRef6>`].
Derived classes must implement the following functions:
* ``GetNumElems``: returns the number of antenna elements
* ``GetElementLocation``: returns the location of the antenna element with the specified index, normalized with respect to the wavelength
* ``GetElementFieldPattern``: returns the horizontal and vertical components of the antenna element field pattern at the specified direction. Same polarization (configurable) for all antenna elements of the array is considered.
The class ``PhasedArrayModel`` also assumes that all antenna elements are equal, a typical key assumption which allows to model the PAA field pattern as the sum of the array factor, given by the geometry of the location of the antenna elements, and the element field pattern.
Any class derived from ``AntennaModel`` is a valid antenna element for the ``PhasedArrayModel``, allowing for a great flexibility of the framework.
.. _3gpp-antenna-model:
Uniform Planar Array (UPA)
~~~~~~~~~~~~~~~~~~~~~~~~~~
The class UniformPlanarArray is a generic implementation of Uniform Planar Arrays (UPAs),
supporting rectangular and linear regular lattices.
It closely follows the implementation described in the 3GPP TR 38.901 [:ref:`7<antennaRef7>`],
considering only a single panel, i.e., :math:`N_{g} = M_{g} = 1`.
By default, the antenna array is orthogonal to the x-axis, pointing towards the positive
direction, but the orientation can be changed through the attributes ``BearingAngle``,
which adjusts the azimuth angle, and ``DowntiltAngle``, which adjusts the elevation angle.
The slant angle is instead fixed and assumed to be 0.
The number of antenna elements in the vertical and horizontal directions can be configured
through the attributes ``NumRows`` and ``NumColumns``, while the spacing between the horizontal
and vertical elements can be configured through the attributes ``AntennaHorizontalSpacing``
and ``AntennaVerticalSpacing``.
UniformPlannarArray supports the concept of antenna ports following the sub-array partition
model for TXRU virtualization, as described in Section 5.2.2 of 3GPP TR 36.897 [:ref:`8<antennaRef8>`].
The number of antenna ports in vertical and horizontal directions can be configured through
the attributes ``NumVerticalPorts`` and ``NumHorizontalPorts``, respectively. For example,
if ``NumRows`` and ``NumColumns`` are configured to 2 and 4, and the number of
``NumVerticalPorts`` and ``NumHorizontalPorts`` to 1 and 2, then the antenna elements belonging
to the first two columns of the antenna array will belong to the first antenna port,
and the third and the fourth columns will belong to the second antenna port. Note that
``NumRows`` and ``NumColumns`` must be a multiple of ``NumVerticalPorts`` and ``NumHorizontalPorts``,
respectively.
Whether the antenna is dual-polarized or not is configured through the attribute
``IsDualPolarized``. In case the antenna array is dual polarized, the total number
of antenna elements is doubled and the two polarizations are overlapped in space.
The polarization slant angle of the antenna elements belonging to the first polarization
are configured through the attribute ``PolSlantAngle``; while the antenna elements of
the second polarization have the polarization slant angle minus 90 degrees,
as described in [:ref:`7<antennaRef7>`] (i.e., :math:`{\zeta}`).
Circular Aperture Antenna Model
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The class ``CircularApertureAntennaModel`` implements the radiation pattern described in [:ref:`7<antennaRef7>`].
Specifically, the latter represents parabolic antennas, i.e., antennas which are typically used
for achieving long range communications such as earth-to-satellite links.
The default boresight orientation is parallel to the positive z-axis, and it can be tuned by
using the ``AntennaInclination`` and ``AntennaAzimuth`` parameters.
This implementation provides an exact characterization of the antenna field pattern, by leveraging
the standard library Bessel functions implementation introduced with C++17.
Accordingly, the antenna gain :math:`G` at an angle :math:`\theta` from the boresight main beam
is evaluated as:
.. math::
G \cdot 4\left | \frac{J_{1}\left ( k\cdot a\cdot sin\theta \right )}{k\cdot a\cdot sin\theta} \right
|^{2}\;\;\;\;\; for\; 0<\left | \theta \right |\leq 90^{\circ} \\
G \cdot 1\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; for\; \theta=0
where :math:`J_{1}()` is the Bessel function of the first kind and first order, and :math:`a` is
the radius of the antenna's circular aperture.
The parameter :math:`k` is equal to :math:`k=\frac{2\pi f}{x}`, where :math:`f` is the carrier
frequency, and :math:`c` is the speed of light in vacuum.
The parameters :math:`G` (in logarithmic scale), :math:`a` and :math:`f` can be configured by using
the attributes ``AntennaMaxGainDb``, ``AntennaCircularApertureRadius`` and ``OperatingFrequency``, respectively.
This type of antennas features a symmetric radiation pattern, meaning that a single angle, measured
from the boresight direction, is sufficient to characterize the radiation strength along a given direction.
.. _fig-circular-antenna-pattern:
.. figure:: figures/circular-antenna-pattern.png
:align: center
Circular aperture antenna radiation pattern with :math:`G =` 38.5 dB and :math:`a =` 10 :math:`\frac{c}{f}.`
Usage
-----
Not present.
Helpers
~~~~~~~
Not present
Attributes
~~~~~~~~~~
Not present.
Traces
~~~~~~
Not present.
Examples and Tests
------------------
In this section we describe the test suites included with the antenna
module that verify its correct functionality.
- ``test-angles.cc``: The unit test suite ``angles`` verifies that the Angles class is
constructed properly by correct conversion from 3D Cartesian
coordinates according to the available methods (construction from a
single vector and from a pair of vectors). For each method, several
test cases are provided that compare the values :math:`(\phi, \theta)`
determined by the constructor to known reference values. The test
passes if for each case the values are equal to the reference up to a
tolerance of :math:`10^{-10}` which accounts for numerical errors.
- ``test-degree-radians.cc``: The unit test suite ``degrees-radians`` verifies that the methods
``DegreesToRadians`` and ``RadiansToDegrees`` work properly by
comparing with known reference values in a number of test
cases. Each test case passes if the comparison is equal up to a
tolerance of :math:`10^{-10}` which accounts for numerical errors.
- ``test-isotropic-antenna.cc``: The unit test suite ``isotropic-antenna-model`` checks that the
``IsotropicAntennaModel`` class works properly, i.e., returns always a
0dB gain regardless of the direction.
- ``test-cosine-antenna.cc``: The unit test suite ``cosine-antenna-model`` checks that the
``CosineAntennaModel`` class works properly. Several test cases are
provided that check for the antenna gain value calculated at different
directions and for different values of the orientation, the reference
gain and the beamwidth. The reference gain is calculated by hand. Each
test case passes if the reference gain in dB is equal to the value returned
by ``CosineAntennaModel`` within a tolerance of 0.001, which accounts
for the approximation done for the calculation of the reference
values.
- ``test-parabolic-antenna.cc``: The unit test suite ``parabolic-antenna-model`` checks that the
``ParabolicAntennaModel`` class works properly. Several test cases are
provided that check for the antenna gain value calculated at different
directions and for different values of the orientation, the maximum attenuation
and the beamwidth. The reference gain is calculated by hand. Each
test case passes if the reference gain in dB is equal to the value returned
by ``ParabolicAntennaModel`` within a tolerance of 0.001, which accounts
for the approximation done for the calculation of the reference
values.
Validation
----------
Validation has been performed as described in each antenna test.
References
----------
.. _antennaRef1:
[1] C.A. Balanis, "Antenna Theory - Analysis and Design", Wiley, 2nd Ed.
.. _antennaRef2:
[2] Li Chunjian, "Efficient Antenna Patterns for Three-Sector WCDMA Systems", Master of Science Thesis, Chalmers University of Technology, Göteborg, Sweden, 2003.
.. _antennaRef3:
[3] 3GPP TSG RAN WG4 (Radio) Meeting #51, R4-092042, Simulation assumptions and parameters for FDD HeNB RF requirements.
.. _antennaRef4:
[`4 <https://dl.acm.org/doi/abs/10.1145/1234161.1234186>`_] George Calcev and Matt Dillon, "Antenna Tilt Control in CDMA Networks", in Proc. of the 2nd Annual International Wireless Internet Conference (WICON), 2006.
.. _antennaRef5:
[5] 3GPP. 2018. TR 38.901, Study on channel model for frequencies from 0.5 to 100 GHz, V15.0.0. (2018-06).
.. _antennaRef6:
[6] Robert J. Mailloux, "Phased Array Antenna Handbook", Artech House, 2nd Ed.
.. _antennaRef7:
[`7 <https://hscc.csie.ncu.edu.tw/38811.pdf>`_] 3GPP. 2018. TR 38.811, Study on New Radio (NR) to support non-terrestrial networks, V15.4.0. (2020-09).
.. _antennaRef8:
[`8 <https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=2580>`_] 3GPP. 2015. TR 36.897. Study on elevation beamforming / Full-Dimension (FD) Multiple Input Multiple Output (MIMO) for LTE. V13.0.0. (2015-06).

View File

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -1,252 +0,0 @@
.. include:: replace.txt
++++++++++++++++++++
Design documentation
++++++++++++++++++++
--------
Overview
--------
The Antenna module provides:
#. a class (Angles) and utility functions to deal with angles
#. a base class (AntennaModel) that provides an interface for the modeling of the radiation pattern of an antenna;
#. a set of classes derived from this base class that each models the radiation pattern of different types of antennas;
#. a base class (PhasedArrayModel) that provides a flexible interface for modeling a number of Phase Antenna Array (PAA) models
#. a class (UniformPlanarArray) derived from this base class, implementing a Uniform Planar Array (UPA) supporting both rectangular and linear lattices
------
Angles
------
The Angles class holds information about an angle in 3D space using spherical coordinates in radian units.
Specifically, it uses the azimuth-inclination convention, where
* Inclination is the angle between the zenith direction (positive z-axis) and the desired direction. It is included in the range [0, pi] radians.
* Azimuth is the signed angle measured from the positive x-axis, where a positive direction goes towards the positive y-axis. It is included in the range [-pi, pi) radians.
Multiple constructors are present, supporting the most common ways to encode information on a direction.
A static boolean variable allows the user to decide whether angles should be printed in radian or degree units.
A number of angle-related utilities are offered, such as radians/degree conversions, for both scalars and vectors, and angle wrapping.
------------
AntennaModel
------------
The AntennaModel uses the coordinate system adopted in [Balanis]_ and
depicted in Figure :ref:`fig-antenna-coordinate-system`. This system
is obtained by translating the Cartesian coordinate system used by the
ns-3 MobilityModel into the new origin :math:`o` which is the location
of the antenna, and then transforming the coordinates of every generic
point :math:`p` of the space from Cartesian coordinates
:math:`(x,y,z)` into spherical coordinates
:math:`(r, \theta,\phi)`.
The antenna model neglects the radial component :math:`r`, and
only considers the angle components :math:`(\theta, \phi)`. An antenna
radiation pattern is then expressed as a mathematical function
:math:`g(\theta, \phi) \longrightarrow \mathcal{R}` that returns the
gain (in dB) for each possible direction of
transmission/reception. All angles are expressed in radians.
.. _fig-antenna-coordinate-system:
.. figure:: figures/antenna-coordinate-system.*
:align: center
Coordinate system of the AntennaModel
---------------------
Single antenna models
---------------------
In this section we describe the antenna radiation pattern models that
are included within the antenna module.
IsotropicAntennaModel
+++++++++++++++++++++
This antenna radiation pattern model provides a unitary gain (0 dB)
for all direction.
CosineAntennaModel
++++++++++++++++++
This is the cosine model described in [Chunjian]_: the antenna gain is
determined as:
.. math::
g(\phi, \theta) = \cos^{n} \left(\frac{\phi - \phi_{0}}{2} \right)
where :math:`\phi_{0}` is the azimuthal orientation of the antenna
(i.e., its direction of maximum gain) and the exponential
.. math::
n = -\frac{3}{20 \log_{10} \left( \cos \frac{\phi_{3dB}}{4} \right)}
determines the desired 3dB beamwidth :math:`\phi_{3dB}`. Note that
this radiation pattern is independent of the inclination angle
:math:`\theta`.
A major difference between the model of [Chunjian]_ and the one
implemented in the class CosineAntennaModel is that only the element
factor (i.e., what described by the above formulas) is considered. In
fact, [Chunjian]_ also considered an additional antenna array
factor. The reason why the latter is excluded is that we expect that
the average user would desire to specify a given beamwidth exactly,
without adding an array factor at a latter stage which would in
practice alter the effective beamwidth of the resulting radiation
pattern.
ParabolicAntennaModel
+++++++++++++++++++++
This model is based on the parabolic approximation of the main lobe radiation pattern. It is often
used in the context of cellular system to model the radiation pattern of a cell sector, see for
instance [R4-092042a]_ and [Calcev]_. The antenna gain in dB is determined as:
.. math::
g_{dB}(\phi, \theta) = -\min \left( 12 \left(\frac{\phi - \phi_{0}}{\phi_{3dB}} \right)^2, A_{max} \right)
where :math:`\phi_{0}` is the azimuthal orientation of the antenna
(i.e., its direction of maximum gain), :math:`\phi_{3dB}` is its 3 dB
beamwidth, and :math:`A_{max}` is the maximum attenuation in dB of the
antenna. Note that this radiation pattern is independent of the inclination angle
:math:`\theta`.
ThreeGppAntennaModel
++++++++++++++++++++
This model implements the antenna element described in [38901]_.
Parameters are fixed from the technical report, thus no attributes nor setters are provided.
The model is largely based on the `ParabolicAntennaModel`_.
------------------
Phased Array Model
------------------
The class PhasedArrayModel has been created with flexibility in mind.
It abstracts the basic idea of a Phased Antenna Array (PAA) by removing any constraint on the
position of each element, and instead generalizes the concept of steering and beamforming vectors,
solely based on the generalized location of the antenna elements.
For details on Phased Array Antennas see for instance [Mailloux]_.
Derived classes must implement the following functions:
* GetNumElems: returns the number of antenna elements
* GetElementLocation: returns the location of the antenna element with the specified index, normalized with respect to the wavelength
* GetElementFieldPattern: returns the horizontal and vertical components of the antenna element field pattern at the specified direction. Same polarization (configurable) for all antenna elements of the array is considered.
The class PhasedArrayModel also assumes that all antenna elements are equal, a typical key assumption which allows to model the PAA field pattern as the sum of the array factor, given by the geometry of the location of the antenna elements, and the element field pattern.
Any class derived from AntennaModel is a valid antenna element for the PhasedArrayModel, allowing for a great flexibility of the framework.
.. _3gpp-antenna-model:
UniformPlanarArray
++++++++++++++++++
The class UniformPlanarArray is a generic implementation of Uniform Planar Arrays (UPAs),
supporting rectangular and linear regular lattices.
It closely follows the implementation described in the 3GPP TR 38.901 [38901]_,
considering only a single panel, i.e., :math:`N_{g} = M_{g} = 1`.
By default, the antenna array is orthogonal to the x-axis, pointing towards the positive
direction, but the orientation can be changed through the attributes "BearingAngle",
which adjusts the azimuth angle, and "DowntiltAngle", which adjusts the elevation angle.
The slant angle is instead fixed and assumed to be 0.
The number of antenna elements in the vertical and horizontal directions can be configured
through the attributes "NumRows" and "NumColumns", while the spacing between the horizontal
and vertical elements can be configured through the attributes "AntennaHorizontalSpacing"
and "AntennaVerticalSpacing".
UniformPlannarArray supports the concept of antenna ports following the sub-array partition
model for TXRU virtualization, as described in Section 5.2.2 of 3GPP TR 36.897 [3GPP_TR36897]_.
The number of antenna ports in vertical and horizontal directions can be configured through
the attributes "NumVerticalPorts" and "NumHorizontalPorts", respectively. For example,
if "NumRows" and "NumColumns" are configured to 2 and 4, and the number of
"NumVerticalPorts" and "NumHorizontalPorts" to 1 and 2, then the antenna elements belonging
to the first two columns of the antenna array will belong to the first antenna port,
and the third and the fourth columns will belong to the second antenna port. Note that
"NumRows" and "NumColumns" must be a multiple of "NumVerticalPorts" and "NumHorizontalPorts",
respectively.
Whether the antenna is dual-polarized or not is configured through the attribute
"IsDualPolarized". In case the antenna array is dual polarized, the total number
of antenna elements is doubled and the two polarizations are overlapped in space.
The polarization slant angle of the antenna elements belonging to the first polarization
are configured through the attribute "PolSlantAngle"; while the antenna elements of
the second polarization have the polarization slant angle minus 90 degrees,
as described in [38901]_ (i.e., :math:`{\zeta}`).
CircularApertureAntennaModel
++++++++++++++++++++++++++++
The class CircularApertureAntennaModel implements the radiation pattern described in [38811]_.
Specifically, the latter represents parabolic antennas, i.e., antennas which are typically used
for achieving long range communications such as earth-to-satellite links.
The default boresight orientation is parallel to the positive z-axis, and it can be tuned by
using the AntennaInclination and AntennaAzimuth parameters.
This implementation provides an exact characterization of the antenna field pattern, by leveraging
the standard library Bessel functions implementation introduced with C++17.
Accordingly, the antenna gain :math:`G` at an angle :math:`\theta` from the boresight main beam
is evaluated as:
.. math::
G \cdot 4\left | \frac{J_{1}\left ( k\cdot a\cdot sin\theta \right )}{k\cdot a\cdot sin\theta} \right
|^{2}\;\;\;\;\; for\; 0<\left | \theta \right |\leq 90^{\circ} \\
G \cdot 1\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; for\; \theta=0
where :math:`J_{1}()` is the Bessel function of the first kind and first order, and :math:`a` is
the radius of the antenna's circular aperture.
The parameter :math:`k` is equal to :math:`k=\frac{2\pi f}{x}`, where :math:`f` is the carrier
frequency, and :math:`c` is the speed of light in vacuum.
The parameters :math:`G` (in logarithmic scale), :math:`a` and :math:`f` can be configured by using
the attributes "AntennaMaxGainDb", "AntennaCircularApertureRadius" and "OperatingFrequency", respectively.
This type of antennas features a symmetric radiation pattern, meaning that a single angle, measured
from the boresight direction, is sufficient to characterize the radiation strength along a given direction.
.. _fig-circular-antenna-pattern:
.. figure:: figures/circular-antenna-pattern.png
:align: center
Circular aperture antenna radiation pattern with :math:`G =` 38.5 dB and :math:`a =` 10 :math:`\frac{c}{f}.`
.. [Balanis] C.A. Balanis, "Antenna Theory - Analysis and Design", Wiley, 2nd Ed.
.. [Chunjian] Li Chunjian, "Efficient Antenna Patterns for
Three-Sector WCDMA Systems", Master of Science Thesis, Chalmers
University of Technology, Göteborg, Sweden, 2003
.. [Calcev] George Calcev and Matt Dillon, "Antenna Tilt Control in
CDMA Networks", in Proc. of the 2nd Annual International Wireless
Internet Conference (WICON), 2006
.. [R4-092042a] 3GPP TSG RAN WG4 (Radio) Meeting #51, R4-092042, Simulation
assumptions and parameters for FDD HeNB RF requirements.
.. [38901] 3GPP. 2018. TR 38.901, Study on channel model for frequencies from 0.5 to 100 GHz, V15.0.0. (2018-06).
.. [38811] 3GPP. 2018. TR 38.811, Study on New Radio (NR) to support non-terrestrial networks, V15.4.0. (2020-09).
.. [Mailloux] Robert J. Mailloux, "Phased Array Antenna Handbook", Artech House, 2nd Ed.
.. [3GPP_TR36897] 3GPP. 2015. TR 36.897. Study on elevation beamforming / Full-Dimension (FD)
Multiple Input Multiple Output (MIMO) for LTE. V13.0.0. (2015-06)

View File

@@ -1,76 +0,0 @@
+++++++++++++++++++++++++++++++++++++
Testing Documentation
+++++++++++++++++++++++++++++++++++++
In this section we describe the test suites included with the antenna
module that verify its correct functionality.
Angles
------
The unit test suite ``angles`` verifies that the Angles class is
constructed properly by correct conversion from 3D Cartesian
coordinates according to the available methods (construction from a
single vector and from a pair of vectors). For each method, several
test cases are provided that compare the values :math:`(\phi, \theta)`
determined by the constructor to known reference values. The test
passes if for each case the values are equal to the reference up to a
tolerance of :math:`10^{-10}` which accounts for numerical errors.
DegreesToRadians
----------------
The unit test suite ``degrees-radians`` verifies that the methods
``DegreesToRadians`` and ``RadiansToDegrees`` work properly by
comparing with known reference values in a number of test
cases. Each test case passes if the comparison is equal up to a
tolerance of :math:`10^{-10}` which accounts for numerical errors.
IsotropicAntennaModel
---------------------
The unit test suite ``isotropic-antenna-model`` checks that the
``IsotropicAntennaModel`` class works properly, i.e., returns always a
0dB gain regardless of the direction.
CosineAntennaModel
------------------
The unit test suite ``cosine-antenna-model`` checks that the
``CosineAntennaModel`` class works properly. Several test cases are
provided that check for the antenna gain value calculated at different
directions and for different values of the orientation, the reference
gain and the beamwidth. The reference gain is calculated by hand. Each
test case passes if the reference gain in dB is equal to the value returned
by ``CosineAntennaModel`` within a tolerance of 0.001, which accounts
for the approximation done for the calculation of the reference
values.
ParabolicAntennaModel
---------------------
The unit test suite ``parabolic-antenna-model`` checks that the
``ParabolicAntennaModel`` class works properly. Several test cases are
provided that check for the antenna gain value calculated at different
directions and for different values of the orientation, the maximum attenuation
and the beamwidth. The reference gain is calculated by hand. Each
test case passes if the reference gain in dB is equal to the value returned
by ``ParabolicAntennaModel`` within a tolerance of 0.001, which accounts
for the approximation done for the calculation of the reference
values.

View File

@@ -1,16 +0,0 @@
.. include:: replace.txt
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
User Documentation
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The antenna modeled can be used with all the wireless technologies and
physical layer models that support it. Currently, this includes
the physical layer models based on the SpectrumPhy. Please refer to
the documentation of each of these models for details.

View File

@@ -1,17 +0,0 @@
#####################################################
Antenna Module
#####################################################
.. toctree::
antenna-design
antenna-user
antenna-testing

View File

@@ -1,219 +0,0 @@
# -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ["sphinx.ext.imgmath"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# The suffix of source filenames.
source_suffix = ".rst"
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = "index"
# General information about the project.
project = "LENA"
copyright = "2011-2012, CTTC"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "ns-3-dev"
# The full version, including alpha/beta/rc tags.
release = "ns-3-dev"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "default"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}
# If false, no module index is generated.
# html_domain_indices = True
# If false, no index is generated.
# html_use_index = True
# If true, the index is split into individual pages for each letter.
# html_split_index = False
# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Output file base name for HTML help builder.
# htmlhelp_basename = 'ns-3doc'
# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
# latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
# latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
(
"antenna",
"antenna.tex",
"Antenna Module Documentation",
"Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)",
"manual",
),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False
# If true, show page references after internal links.
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
# latex_show_urls = False
# Additional stuff for the LaTeX preamble.
# latex_preamble = ''
# Documents to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("index", "ns-3-model-library", "ns-3 Model Library", ["ns-3 project"], 1)]

View File

@@ -1,17 +0,0 @@
#####################################################
Antenna Module
#####################################################
.. toctree::
antenna-design
antenna-user
antenna-testing

View File

@@ -1,3 +0,0 @@
.. |ns3| replace:: *ns-3*
.. |ns2| replace:: *ns-2*