5G-LENA nr-v3.0-33-g7aea1e4
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-spectrum-value-helper.h
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
3// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4//
5// SPDX-License-Identifier: GPL-2.0-only
6
7#ifndef NR_SPECTRUM_VALUE_HELPER_H
8#define NR_SPECTRUM_VALUE_HELPER_H
9
10#include <ns3/spectrum-value.h>
11
12#include <vector>
13
14namespace ns3
15{
16
23{
24 public:
25 enum PowerAllocationType
26 {
27 UNIFORM_POWER_ALLOCATION_USED,
28 UNIFORM_POWER_ALLOCATION_BW
29 };
30
31 static const uint8_t SUBCARRIERS_PER_RB = 12;
32
40 static Ptr<const SpectrumModel> GetSpectrumModel(uint32_t numRbs,
41 double centerFrequency,
42 double subcarrierSpacing);
43
53 static Ptr<SpectrumValue> CreateTxPowerSpectralDensity(double powerTx,
54 const std::vector<int>& rbIndexVector,
55 const Ptr<const SpectrumModel>& txSm,
56 enum PowerAllocationType allocationType);
57
65 static Ptr<SpectrumValue> CreateNoisePowerSpectralDensity(
66 double noiseFigure,
67 const Ptr<const SpectrumModel>& spectrumModel);
68
75 static uint64_t GetEffectiveBandwidth(double bandwidth, uint8_t numerology);
76
77 protected:
85 static Ptr<SpectrumValue> CreateTxPsdOverActiveRbs(
86 double powerTx,
87 const std::vector<int>& activeRbs,
88 const Ptr<const SpectrumModel>& spectrumModel);
89
96 static Ptr<SpectrumValue> CreateTxPsdOverAllRbs(double powerTx,
97 const std::vector<int>& activeRbs,
98 const Ptr<const SpectrumModel>& spectrumModel);
99};
100
101} // namespace ns3
102
103#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