From 4ca8b12ea0d732b45b66eebf6b8bb1946eea5324 Mon Sep 17 00:00:00 2001 From: bbojovic Date: Thu, 1 Jul 2021 08:44:46 +0200 Subject: [PATCH] spectrum: Support passing the TX and RX PhasedArrayModel objects to spectrum model This possibility is needed for the types of spectrum propagation models that need to have a pointer to the TX and RX antenna arrays to perform calculations, such as e.g., ThreeGppSpectrumPropagationLossModel, which currently has hard limitation of having a maximum of 1 antenna array instance per device. ThreeGppSpectrumPropagationLossModel now inherits a new class PhasedArraySpectrumPropagationLossModel. Its DoCalcRxPowerSpectralDensity function has now two additional parameters: TX and RX antenna arrays. Also, AddDevice function is removed from ThreeGppSpectrumPropagationLossModel, because it is not anymore needed to specify for each device its TX/RX antenna, since these are now passed as parameters. Hence, to use ThreeGppSpectrumPropagationLossModel, when implementing Spectrum PHY features, modules should implement the function of SpectrumPhy GetAntenna to return the instance of PhasedArrayModel of that SpectrumPhy. These instances will be passed by MultiModelSpectrumChannel (one of the core classes in the spectrum module) to propagation classes, children of PhasedArraySpectrumPropagationLossModel, when it is necessary to DoCalcRxPowerSpectralDensity to callculate the propagation loss. Additionally: Fixed pair key generation for 3gpp channel model: Previous implementation was using a cantor function of two integer of 32 bits and as a results was giving a unique representatio of 32 bits. This is wrong, because such function needed even more than 64 bits to represent that value. Even if in ns-3 simulation we are not going to have such large node numbers, we should fix this. Instead of just changing 64 bits from cantor function, I propose to replace the cantor function with just simple concatenation of two 32 bits. I also propose moving min and max inside of the function, to prevent some eventual future errors in using GetKey, because with the previous implementation there was assumption that who calls GetKey will previously sort its parameters, and first provide the min value, and then the max value, and this was not even documented. --- CHANGES.html | 4 + RELEASE_NOTES.md | 3 + .../three-gpp-v2v-channel-example.cc | 69 +++++++--- src/spectrum/CMakeLists.txt | 2 + src/spectrum/doc/spectrum.rst | 36 +++--- .../examples/three-gpp-channel-example.cc | 74 ++++++++--- .../model/matrix-based-channel-model.h | 13 +- .../model/multi-model-spectrum-channel.cc | 33 ++++- ...d-array-spectrum-propagation-loss-model.cc | 80 ++++++++++++ ...ed-array-spectrum-propagation-loss-model.h | 120 ++++++++++++++++++ .../model/single-model-spectrum-channel.cc | 18 ++- src/spectrum/model/spectrum-channel.cc | 19 +++ src/spectrum/model/spectrum-channel.h | 20 +++ src/spectrum/model/spectrum-phy.cc | 19 +++ src/spectrum/model/spectrum-phy.h | 44 +++++++ src/spectrum/model/three-gpp-channel-model.cc | 5 +- src/spectrum/model/three-gpp-channel-model.h | 2 +- ...ree-gpp-spectrum-propagation-loss-model.cc | 35 ++--- ...hree-gpp-spectrum-propagation-loss-model.h | 21 ++- .../test/three-gpp-channel-test-suite.cc | 66 +++++++--- src/spectrum/wscript | 2 + 21 files changed, 565 insertions(+), 120 deletions(-) create mode 100644 src/spectrum/model/phased-array-spectrum-propagation-loss-model.cc create mode 100644 src/spectrum/model/phased-array-spectrum-propagation-loss-model.h diff --git a/CHANGES.html b/CHANGES.html index 3928c8df4..1b800e4c9 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -56,11 +56,15 @@ us a note on ns-developers mailing list.

Changes to existing API: