Skip to content

Commit 4c323cf

Browse files
tomhendersonGabrielcarvfer
authored andcommitted
spectrum: Remove CalcRxPowerSpectralDensity() overload reading array state
Assisted-by: Claude Fable 5
1 parent 76dcea9 commit 4c323cf

9 files changed

Lines changed: 52 additions & 72 deletions

‎CHANGES.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ This file is a best-effort approach to solving this issue; we will do our best b
4141
* (network) `Buffer::Deserialize`, `ByteTagList::Deserialize`, `PacketMetadata::Deserialize`, `PacketTagList::Deserialize` and `Packet::Deserialize` functions return now the number of deserialized bytes instead of just `1` for a successful deserialization.
4242
* (sixlowpan) The `SixLowPanNetDevice` attributes `MeshUnderJitter` and `MeshCacheLength` moved to the mesh-under forwarding policy: use `SixLowPanSimpleFlooding::MeshUnderJitter` and `SixLowPanMeshUnderRouting::MeshCacheLength`, reachable through the device's `MeshUnderRouting` attribute (e.g., `MeshUnderRouting/MeshUnderJitter` in a `Config` path). The old device attributes are deprecated and forward to the current policy.
4343
* (internet) the `Ipv4InterfaceAddress` functions related to the setup of a secondary address have been removed. This includes `SetPrimary`, `SetSecondary`, and `IsSecondary`. If users have a need for this feature in the future, please document the need by opening a Work Item on ns-3-dev tracker.
44+
* (spectrum) The `PhasedArraySpectrumPropagationLossModel::CalcRxPowerSpectralDensity()` now requires the beamforming vectors of the two phased arrays to be passed as parameters (pass the vectors in effect when the signal was transmitted and received, respectively); the variant that read them from the arrays was removed without deprecation.
4445
* (spectrum) The private virtual `PhasedArraySpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity()` and, in `ThreeGppSpectrumPropagationLossModel`, `SionnaRtSpectrumPropagationLossModel` and `TwoRaySpectrumPropagationLossModel`, the protected `GetLongTerm()`, `CalcLongTerm()`, `CalculateLongTermComponent()` and `CalcBeamformingGain()` methods now require the beamforming vectors as parameters. Subclasses must update their overrides; no deprecation is provided.
4546

4647
### Changes to build system

‎examples/channel-models/three-gpp-v2v-channel-example.cc‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,14 @@ ComputeSnr(const ComputeSnrParams& params)
9494
double propagationGainLinear = std::pow(10.0, (propagationGainDb) / 10.0);
9595
*(params.txParams->psd) *= propagationGainLinear;
9696
// apply the fast fading and the beamforming gain
97-
auto rxParams = m_spectrumLossModel->CalcRxPowerSpectralDensity(params.txParams,
98-
params.txMob,
99-
params.rxMob,
100-
params.txAntenna,
101-
params.rxAntenna);
97+
auto rxParams =
98+
m_spectrumLossModel->CalcRxPowerSpectralDensity(params.txParams,
99+
params.txMob,
100+
params.rxMob,
101+
params.txAntenna,
102+
params.rxAntenna,
103+
params.txAntenna->GetBeamformingVector(),
104+
params.rxAntenna->GetBeamformingVector());
102105
Ptr<SpectrumValue> rxPsd = rxParams->psd;
103106
NS_LOG_DEBUG("Average rx power " << 10 * log10(Sum(*rxPsd) * 180e3) << " dB");
104107

‎src/spectrum/doc/spectrum.rst‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -771,13 +771,14 @@ received PSD and the frequency domain 3D spectrum channel matrix.
771771
Procedure used to compute the PSD of the received signal and the frequency domain 3D
772772
spectrum channel matrix:
773773

774-
1. Retrieve the beamforming vectors
775-
To account for the beamforming, ``ThreeGppSpectrumPropagationLossModel`` has to
776-
retrieve the beamforming vectors of the transmitting and receiving antennas.
777-
The method ``DoCalcRxPowerSpectralDensity`` uses the antenna objects
778-
that are passed as parameters for both the transmitting and receiving devices,
779-
and calls the method GetBeamformingVector to retrieve the beamforming vectors
780-
of these antenna objects.
774+
1. Obtain the beamforming vectors
775+
To account for the beamforming, ``ThreeGppSpectrumPropagationLossModel`` needs
776+
the beamforming vectors of the transmitting and receiving antennas.
777+
The method ``DoCalcRxPowerSpectralDensity`` receives them as parameters,
778+
together with the antenna objects of both devices; it does not read the
779+
vectors from the antenna objects itself, so the caller decides which vectors
780+
apply (``MultiModelSpectrumChannel`` passes the transmitter's vector captured
781+
when the transmission started).
781782

782783
2. Retrieve the channel matrix and the channel params
783784
The ``ThreeGppSpectrumPropagationLossModel`` relies on the ``ThreeGppChannelModel`` class

‎src/spectrum/examples/sionna-rt-channel-example.cc‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,14 @@ ComputeSnr(const ComputeSnrParams& params)
197197
NS_ASSERT_MSG(params.rxAntenna, "params.rxAntenna is nullptr!");
198198

199199
// apply the fast fading and the beamforming gain
200-
auto rxParams = m_spectrumLossModel->CalcRxPowerSpectralDensity(txParams,
201-
params.txMob,
202-
params.rxMob,
203-
params.txAntenna,
204-
params.rxAntenna);
200+
auto rxParams =
201+
m_spectrumLossModel->CalcRxPowerSpectralDensity(txParams,
202+
params.txMob,
203+
params.rxMob,
204+
params.txAntenna,
205+
params.rxAntenna,
206+
params.txAntenna->GetBeamformingVector(),
207+
params.rxAntenna->GetBeamformingVector());
205208
auto rxPsd = rxParams->psd;
206209
double rxPowDb = 10 * log10(Sum(*rxPsd) * 180e3);
207210
double snrDb = 10 * log10(Sum(*rxPsd) / Sum(*noisePsd));

‎src/spectrum/examples/three-gpp-channel-consistency-example.cc‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,14 @@ ComputeSnr(const ComputeSnrParams& params)
166166
double propagationGainLinear = std::pow(10.0, (propagationGainDb) / 10.0);
167167
*(params.txParams->psd) *= propagationGainLinear;
168168
// apply the fast fading and the beamforming gain
169-
auto rxParams = m_spectrumLossModel->CalcRxPowerSpectralDensity(params.txParams,
170-
params.txMob,
171-
params.rxMob,
172-
params.txAntenna,
173-
params.rxAntenna);
169+
auto rxParams =
170+
m_spectrumLossModel->CalcRxPowerSpectralDensity(params.txParams,
171+
params.txMob,
172+
params.rxMob,
173+
params.txAntenna,
174+
params.rxAntenna,
175+
params.txAntenna->GetBeamformingVector(),
176+
params.rxAntenna->GetBeamformingVector());
174177
Ptr<SpectrumValue> rxPsd = rxParams->psd;
175178
// create the noise psd
176179
// taken from lte-spectrum-value-helper

‎src/spectrum/examples/three-gpp-channel-example.cc‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,14 @@ ComputeSnr(const ComputeSnrParams& params)
265265
sign = +1.0;
266266
DoBeamforming(params.rxMob, params.rxAntenna, params.txMob, sign);
267267
// apply the fast fading and the beamforming gain
268-
auto rxParams = m_spectrumLossModel->CalcRxPowerSpectralDensity(txParams,
269-
params.txMob,
270-
params.rxMob,
271-
params.txAntenna,
272-
params.rxAntenna);
268+
auto rxParams =
269+
m_spectrumLossModel->CalcRxPowerSpectralDensity(txParams,
270+
params.txMob,
271+
params.rxMob,
272+
params.txAntenna,
273+
params.rxAntenna,
274+
params.txAntenna->GetBeamformingVector(),
275+
params.rxAntenna->GetBeamformingVector());
273276
auto rxPsdSteering = rxParams->psd;
274277
NS_LOG_DEBUG("Average rx power " << 10 * log10(Sum(*rxPsdSteering) * 180e3) << " dB");
275278
NS_LOG_DEBUG("Average SNR " << 10 * log10(Sum(*rxPsdSteering) / Sum(*noisePsd)) << " dB");
@@ -289,7 +292,9 @@ ComputeSnr(const ComputeSnrParams& params)
289292
params.txMob,
290293
params.rxMob,
291294
params.txAntenna,
292-
params.rxAntenna);
295+
params.rxAntenna,
296+
params.txAntenna->GetBeamformingVector(),
297+
params.rxAntenna->GetBeamformingVector());
293298
294299
auto rxPsdMatchedFilterComb = rxParamsMatchedFilterComb->psd;
295300
NS_LOG_DEBUG("Average rx power when using matched filter combining "

‎src/spectrum/examples/three-gpp-ntn-channel-example.cc‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,14 @@ ComputeSnr(ComputeSnrParams& params)
267267
ConstCast<AntennaModel, const AntennaModel>(params.txAntenna->GetAntennaElement());
268268

269269
// apply the fast fading and the beamforming gain
270-
rxSsp = m_spectrumLossModel->CalcRxPowerSpectralDensity(rxSsp,
271-
params.txMob,
272-
params.rxMob,
273-
params.txAntenna,
274-
params.rxAntenna);
270+
rxSsp =
271+
m_spectrumLossModel->CalcRxPowerSpectralDensity(rxSsp,
272+
params.txMob,
273+
params.rxMob,
274+
params.txAntenna,
275+
params.rxAntenna,
276+
params.txAntenna->GetBeamformingVector(),
277+
params.rxAntenna->GetBeamformingVector());
275278
NS_LOG_DEBUG("Average rx power " << 10 * log10(Sum(*rxSsp->psd) * params.bandwidth) << " dB");
276279

277280
// compute the SNR

‎src/spectrum/model/phased-array-spectrum-propagation-loss-model.cc‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,6 @@ PhasedArraySpectrumPropagationLossModel::GetNext() const
5555
return m_next;
5656
}
5757

58-
Ptr<SpectrumSignalParameters>
59-
PhasedArraySpectrumPropagationLossModel::CalcRxPowerSpectralDensity(
60-
Ptr<const SpectrumSignalParameters> params,
61-
Ptr<const MobilityModel> a,
62-
Ptr<const MobilityModel> b,
63-
Ptr<const PhasedArrayModel> aPhasedArrayModel,
64-
Ptr<const PhasedArrayModel> bPhasedArrayModel) const
65-
{
66-
return CalcRxPowerSpectralDensity(params,
67-
a,
68-
b,
69-
aPhasedArrayModel,
70-
bPhasedArrayModel,
71-
aPhasedArrayModel->GetBeamformingVector(),
72-
bPhasedArrayModel->GetBeamformingVector());
73-
}
74-
7558
Ptr<SpectrumSignalParameters>
7659
PhasedArraySpectrumPropagationLossModel::CalcRxPowerSpectralDensity(
7760
Ptr<const SpectrumSignalParameters> params,

‎src/spectrum/model/phased-array-spectrum-propagation-loss-model.h‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,6 @@ class PhasedArraySpectrumPropagationLossModel : public Object
5757
*/
5858
Ptr<PhasedArraySpectrumPropagationLossModel> GetNext() const;
5959

60-
/**
61-
* Calculate the received PSD using the beamforming vectors currently set on the
62-
* phased antenna arrays of the sender and of the receiver.
63-
*
64-
* @param txPsd the spectrum signal parameters.
65-
* @param a sender mobility
66-
* @param b receiver mobility
67-
* @param aPhasedArrayModel the instance of the phased antenna array of the sender
68-
* @param bPhasedArrayModel the instance of the phased antenna array of the receiver
69-
*
70-
* @return SpectrumSignalParameters in which is updated the PSD to contain
71-
* a set of values Vs frequency representing the received
72-
* power in the same units used for the txPower parameter,
73-
* and additional chanSpectrumMatrix is computed to support MIMO systems.
74-
*/
75-
Ptr<SpectrumSignalParameters> CalcRxPowerSpectralDensity(
76-
Ptr<const SpectrumSignalParameters> txPsd,
77-
Ptr<const MobilityModel> a,
78-
Ptr<const MobilityModel> b,
79-
Ptr<const PhasedArrayModel> aPhasedArrayModel,
80-
Ptr<const PhasedArrayModel> bPhasedArrayModel) const;
81-
8260
/**
8361
* Calculate the received PSD using the given beamforming vectors, which need not be
8462
* the ones currently set on the phased antenna arrays. The arrays provide the

0 commit comments

Comments
 (0)