5G-LENA nr-v3.1-69-g2dd513a7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-spectrum-value-helper.h
1// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef NR_SPECTRUM_VALUE_HELPER_H
6#define NR_SPECTRUM_VALUE_HELPER_H
7
8#include <ns3/spectrum-value.h>
9
10#include <vector>
11
12namespace ns3
13{
14
21{
22 public:
23 enum PowerAllocationType
24 {
25 UNIFORM_POWER_ALLOCATION_USED,
26 UNIFORM_POWER_ALLOCATION_BW
27 };
28
29 static const uint8_t SUBCARRIERS_PER_RB = 12;
30
38 static Ptr<const SpectrumModel> GetSpectrumModel(uint32_t numRbs,
39 double centerFrequency,
40 double subcarrierSpacing);
41
51 static Ptr<SpectrumValue> CreateTxPowerSpectralDensity(double powerTx,
52 const std::vector<int>& rbIndexVector,
53 const Ptr<const SpectrumModel>& txSm,
54 enum PowerAllocationType allocationType);
55
63 static Ptr<SpectrumValue> CreateNoisePowerSpectralDensity(
64 double noiseFigure,
65 const Ptr<const SpectrumModel>& spectrumModel);
66
73 static uint64_t GetEffectiveBandwidth(double bandwidth, uint8_t numerology);
74
75 protected:
83 static Ptr<SpectrumValue> CreateTxPsdOverActiveRbs(
84 double powerTx,
85 const std::vector<int>& activeRbs,
86 const Ptr<const SpectrumModel>& spectrumModel);
87
94 static Ptr<SpectrumValue> CreateTxPsdOverAllRbs(double powerTx,
95 const std::vector<int>& activeRbs,
96 const Ptr<const SpectrumModel>& spectrumModel);
97
101 static void DeleteSpectrumValues();
102};
103
104} // namespace ns3
105
106#endif /* NR_SPECTRUM_VALUE_HELPER_H */
This class provides a set of useful functions when working with spectrum model for NR.
static Ptr< SpectrumValue > CreateTxPsdOverAllRbs(double powerTx, const std::vector< int > &activeRbs, const Ptr< const SpectrumModel > &spectrumModel)
Create SpectrumValue that will represent transmit power spectral density, and the total transmit powe...
static Ptr< const SpectrumModel > GetSpectrumModel(uint32_t numRbs, double centerFrequency, double subcarrierSpacing)
Creates or obtains from a global map a spectrum model with a given number of RBs, center frequency an...
static Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(double noiseFigure, const Ptr< const SpectrumModel > &spectrumModel)
Create a SpectrumValue that models the power spectral density of AWGN.
static uint64_t GetEffectiveBandwidth(double bandwidth, uint8_t numerology)
Returns the effective bandwidth for the total system bandwidth.
static Ptr< SpectrumValue > CreateTxPsdOverActiveRbs(double powerTx, const std::vector< int > &activeRbs, const Ptr< const SpectrumModel > &spectrumModel)
Create SpectrumValue that will represent transmit power spectral density, and the total transmit powe...
static Ptr< SpectrumValue > CreateTxPowerSpectralDensity(double powerTx, const std::vector< int > &rbIndexVector, const Ptr< const SpectrumModel > &txSm, enum PowerAllocationType allocationType)
Create SpectrumValue that will represent transmit power spectral density, and assuming that all RBs a...
static const uint8_t SUBCARRIERS_PER_RB
subcarriers per resource block