Skip to content

Commit 6f758fa

Browse files
ddriescodebot
authored andcommitted
ru_ofh: set subcarrier_rms_backoff_dB default behaviour
1 parent 5adff39 commit 6f758fa

File tree

5 files changed

+35
-13
lines changed

5 files changed

+35
-13
lines changed

apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_config.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ struct ru_ofh_scaling_config {
4949
///
5050
/// \f$ $$P_{BW2}\text{ [dBFS]}=P_{BW1}\text{ [dBFS]} - 10\log_{10}{\bigg(\frac{BW2}{BW1}\bigg)}\f$
5151
///
52+
/// If no value is specified, then the bandwidth is normalized based on the number of subcarriers, i.e.,
53+
/// the back-off is set to \f$10\log_{10}(12 N_{RB})}\f$.
54+
///
5255
/// \warning Check the RU documentation before settings this parameter, as incorrect values may damage the RU.
53-
float subcarrier_rms_backoff_dB = 30.0f;
56+
std::optional<float> subcarrier_rms_backoff_dB;
5457
};
5558

5659
/// Configuration parameters related to the scaling of the IQ symbols in the DL OFH resource grid (legacy version).

apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_config_cli11_schema.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,22 @@ static void configure_cli11_ru_ofh_base_cell_args(CLI::App& app, ru_ofh_unit_bas
194194
return "";
195195
});
196196

197-
app.add_option_function<float>(
197+
app.add_option_function<std::string>(
198198
"--subcarrier_rms_backoff_dB",
199-
[&config](float value) {
199+
[&config](std::string value) {
200200
if (!std::holds_alternative<ru_ofh_scaling_config>(config.iq_scaling_config)) {
201201
config.iq_scaling_config.emplace<ru_ofh_scaling_config>();
202202
}
203-
std::get<ru_ofh_scaling_config>(config.iq_scaling_config).subcarrier_rms_backoff_dB = value;
203+
// By default, subcarrier backoff is set to 'auto', i.e., normalize bandwidth based on number of
204+
// subcarriers. If another value is specified, it is parsed.
205+
if (value != "auto") {
206+
// It is safe to convert the value without try-catch because it has been already checked.
207+
float backoff = std::stof(value);
208+
std::get<ru_ofh_scaling_config>(config.iq_scaling_config).subcarrier_rms_backoff_dB = backoff;
209+
}
204210
},
205211
"Power back-off attenuation applied to all subcarriers with respect to the RU reference level")
206-
->check(CLI::Range(0.0f, std::numeric_limits<float>::infinity()))
212+
->check(CLI::Range(0.0f, std::numeric_limits<float>::infinity()) | CLI::IsMember({"auto"}))
207213
->check([&config](const std::string& value) -> std::string {
208214
if (std::holds_alternative<ru_ofh_legacy_scaling_config>(config.iq_scaling_config)) {
209215
return "IQ scaling and RU subcarrier back-off cannot be set at the same time";
@@ -282,8 +288,8 @@ static void configure_cli11_ru_ofh_base_cell_args(CLI::App& app, ru_ofh_unit_bas
282288
"RU IQ scaling parameter cannot be used if RU reference level and subcarrier RMS back-off are set\n");
283289
}
284290

285-
if (ref_level_count != backoff_count) {
286-
report_error("RU reference level and subcarrier RMS back-off must be set together\n");
291+
if (backoff_count > 0 && ref_level_count == 0) {
292+
report_error("RU reference level is required if subcarrier RMS back-off is set\n");
287293
}
288294
};
289295

apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_config_translator.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,16 @@ static void generate_config(ru_ofh_configuration& out
147147
legacy_scaling_config->iq_scaling / std::sqrt(static_cast<float>(nof_prbs * NOF_SUBCARRIERS_PER_RB));
148148
} else if (const auto* scaling_config = std::get_if<ru_ofh_scaling_config>(&ofh_cell_cfg.cell.iq_scaling_config)) {
149149
// Take the RU reference level, apply the configured subcarrier back-off and convert the result into a linear
150-
// scaling factor. Do not apply any bandwidth normalization.
150+
// scaling factor. If no subcarrier back-off is configured, apply a bandwidth power normalization factor.
151+
unsigned nof_prbs =
152+
get_max_Nprb(bs_channel_bandwidth_to_MHz(sector_cfg.bw), sector_cfg.scs, frequency_range::FR1);
153+
float subcarrier_rms_backoff_dB = convert_power_to_dB(nof_prbs * NOF_SUBCARRIERS_PER_RB);
154+
// If no value of subcarrier backoff is defined, the default bandwidth normalization is used.
155+
if (scaling_config->subcarrier_rms_backoff_dB) {
156+
subcarrier_rms_backoff_dB = *scaling_config->subcarrier_rms_backoff_dB;
157+
}
151158
sector_cfg.iq_scaling =
152-
convert_dB_to_amplitude(scaling_config->ru_reference_level_dBFS - scaling_config->subcarrier_rms_backoff_dB);
159+
convert_dB_to_amplitude(scaling_config->ru_reference_level_dBFS - subcarrier_rms_backoff_dB);
153160
} else {
154161
report_fatal_error(
155162
"Either the iq_scaling or the RU reference level and subarrier RMS backoff must be configured.");

apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_config_validator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ static bool validate_scaling_params(
4343
return false;
4444
}
4545

46-
if (!backoff_range.contains(scaling_params->subcarrier_rms_backoff_dB)) {
46+
if (scaling_params->subcarrier_rms_backoff_dB &&
47+
!backoff_range.contains(*scaling_params->subcarrier_rms_backoff_dB)) {
4748
fmt::print("Subcarrier back-off, i.e., {} dB lies outside of the valid range {}\n",
48-
scaling_params->subcarrier_rms_backoff_dB,
49+
*scaling_params->subcarrier_rms_backoff_dB,
4950
backoff_range);
5051
return false;
5152
}

apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_config_yaml_writer.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,13 @@ static YAML::Node build_ru_ofh_cell_section(const ru_ofh_unit_cell_config& confi
9999
node["enable_ul_static_compr_hdr"] = config.cell.is_uplink_static_comp_hdr_enabled;
100100
node["enable_dl_static_compr_hdr"] = config.cell.is_downlink_static_comp_hdr_enabled;
101101
if (const auto* scaling_params = std::get_if<ru_ofh_scaling_config>(&config.cell.iq_scaling_config)) {
102-
node["ru_reference_level_dBFS"] = scaling_params->ru_reference_level_dBFS;
103-
node["subcarrier_rms_backoff_dB"] = scaling_params->subcarrier_rms_backoff_dB;
102+
node["ru_reference_level_dBFS"] = scaling_params->ru_reference_level_dBFS;
103+
104+
if (scaling_params->subcarrier_rms_backoff_dB) {
105+
node["subcarrier_rms_backoff_dB"] = *scaling_params->subcarrier_rms_backoff_dB;
106+
} else {
107+
node["subcarrier_rms_backoff_dB"] = "auto";
108+
}
104109
} else if (const auto* legacy_scaling_params =
105110
std::get_if<ru_ofh_legacy_scaling_config>(&config.cell.iq_scaling_config)) {
106111
node["iq_scaling"] = legacy_scaling_params->iq_scaling;

0 commit comments

Comments
 (0)