Skip to content

Commit 8e59cbe

Browse files
andrepuschmanncodebot
authored andcommitted
phy: move n_ta_offset struct out of PHY under generic ran
this will allow usage in band_helper without depending on lower PHY
1 parent 3463090 commit 8e59cbe

File tree

7 files changed

+54
-40
lines changed

7 files changed

+54
-40
lines changed

apps/examples/du/du_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static radio_configuration::over_the_wire_format otw_format = radio_configuratio
7676
static radio_configuration::clock_sources clock_src = {};
7777
static sampling_rate srate = sampling_rate::from_MHz(61.44);
7878
static int time_alignmemt_calibration = 0;
79-
static const lower_phy_ta_offset ta_offset = lower_phy_ta_offset::n0;
79+
static const n_ta_offset ta_offset = n_ta_offset::n0;
8080
static double tx_gain = 60.0;
8181
static double rx_gain = 70.0;
8282

apps/examples/phy/radio_ssb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ lower_phy_configuration create_lower_phy_configuration(float
345345
phy_config.max_processing_delay_slots = max_processing_delay_slots;
346346
phy_config.ul_to_dl_subframe_offset = ul_to_dl_subframe_offset;
347347
phy_config.time_alignment_calibration = 0;
348-
phy_config.ta_offset = lower_phy_ta_offset::n0;
348+
phy_config.ta_offset = n_ta_offset::n0;
349349
phy_config.tx_scale = tx_scale;
350350
phy_config.cp = cp;
351351
phy_config.dft_window_offset = 0.5F;

apps/gnb/gnb_appconfig_translators.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ lower_phy_configuration srsran::generate_ru_config(const gnb_appconfig& config)
233233

234234
out_cfg.srate = sampling_rate::from_MHz(config.rf_driver_cfg.srate_MHz);
235235

236-
out_cfg.ta_offset = lower_phy_ta_offset::n0;
237-
238-
// Apply time alignment calibration.
236+
out_cfg.ta_offset = n_ta_offset::n0;
239237
if (config.rf_driver_cfg.time_alignment_calibration.has_value()) {
240238
// Selects the user specific value.
241239
out_cfg.time_alignment_calibration = config.rf_driver_cfg.time_alignment_calibration.value();

include/srsran/phy/lower/lower_phy_configuration.h

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "srsran/phy/lower/sampling_rate.h"
2121
#include "srsran/phy/support/resource_grid_pool.h"
2222
#include "srsran/ran/cyclic_prefix.h"
23+
#include "srsran/ran/n_ta_offset.h"
2324
#include "srsran/ran/subcarrier_spacing.h"
2425
#include "srsran/support/executors/task_executor.h"
2526

@@ -45,24 +46,6 @@ struct lower_phy_sector_description {
4546
std::vector<lower_phy_sector_port_mapping> port_mapping;
4647
};
4748

48-
/// \brief Time advance offset - parameter \f$N_{TA,offset}\f$ in TS38.211 Section 4.3.3.
49-
///
50-
/// This value must be selected from the parameter \e n-TimingAdvanceOffset (TS38.331 Section 6.3.2, Information Element
51-
/// \e ServingCellConfigCommon) if it is present. Otherwise, it is given by TS38.133 Section 7.1.2 depending on the
52-
/// duplex mode of the cell and the frequency range.
53-
///
54-
/// The values are given in units of \f$T_c\f$ (see TS38.211 Section 4.1).
55-
enum class lower_phy_ta_offset {
56-
/// For FR1 FDD band with LTE-NR coexistence case.
57-
n0 = 0,
58-
/// For FR1 FDD band without LTE-NR coexistence case or for FR1 TDD band without LTE-NR coexistence case.
59-
n25600 = 25600,
60-
/// For FR2.
61-
n13792 = 13792,
62-
/// For FR1 TDD band with LTE-NR coexistence case.
63-
n39936 = 39936
64-
};
65-
6649
/// Lower physical layer configuration.
6750
struct lower_phy_configuration {
6851
/// Indicates the log level.
@@ -87,7 +70,7 @@ struct lower_phy_configuration {
8770
/// Sampling rate.
8871
sampling_rate srate;
8972
/// Time alignment offset.
90-
lower_phy_ta_offset ta_offset;
73+
n_ta_offset ta_offset;
9174
/// \brief Time alignment calibration in number of samples.
9275
///
9376
/// Models the reception and transmission time misalignment inherent to the RF device. This time adjustment is

include/srsran/ran/n_ta_offset.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
*
3+
* Copyright 2021-2023 Software Radio Systems Limited
4+
*
5+
* By using this file, you agree to the terms and conditions set
6+
* forth in the LICENSE file which can be found at the top level of
7+
* the distribution.
8+
*
9+
*/
10+
11+
#pragma once
12+
13+
namespace srsran {
14+
15+
/// \brief Time advance offset - parameter \f$N_{TA,offset}\f$ in TS38.211 Section 4.3.3.
16+
///
17+
/// This value must be selected from the parameter \e n-TimingAdvanceOffset (TS38.331 Section 6.3.2, Information Element
18+
/// \e ServingCellConfigCommon) if it is present. Otherwise, it is given by TS38.133 Section 7.1.2 depending on the
19+
/// duplex mode of the cell and the frequency range.
20+
///
21+
/// The values are given in units of \f$T_c\f$ (see TS38.211 Section 4.1).
22+
enum class n_ta_offset {
23+
/// For FR1 FDD band with LTE-NR coexistence case.
24+
n0 = 0,
25+
/// For FR1 FDD band without LTE-NR coexistence case or for FR1 TDD band without LTE-NR coexistence case.
26+
n25600 = 25600,
27+
/// For FR2.
28+
n13792 = 13792,
29+
/// For FR1 TDD band with LTE-NR coexistence case.
30+
n39936 = 39936
31+
};
32+
33+
} // namespace srsran

lib/phy/lower/lower_phy_impl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ class lower_phy_impl : public lower_phy,
194194
/// maps to \f$N_{\textup{TA, offset}}\f$.
195195
/// \param[in] srate Sampling rate.
196196
/// \return The reception-to-transmission delay as a number of samples.
197-
static inline unsigned get_rx_to_tx_delay(unsigned ul_to_dl_subframe_offset,
198-
int time_alignment_calibration,
199-
lower_phy_ta_offset ta_offset,
200-
sampling_rate srate)
197+
static inline unsigned get_rx_to_tx_delay(unsigned ul_to_dl_subframe_offset,
198+
int time_alignment_calibration,
199+
n_ta_offset ta_offset,
200+
sampling_rate srate)
201201
{
202202
// Calculate time between the UL signal reception and the transmission.
203203
phy_time_unit ul_to_dl_delay = phy_time_unit::from_seconds(0.001 * static_cast<double>(ul_to_dl_subframe_offset));

tests/unittests/phy/lower/lower_phy_test.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020

2121
using namespace srsran;
2222

23-
static sampling_rate srate = sampling_rate::from_MHz(61.44);
24-
static subcarrier_spacing scs = subcarrier_spacing::kHz15;
25-
static unsigned max_processing_delay_slots = 4;
26-
static unsigned ul_to_dl_subframe_offset = 1;
27-
static int time_alignment_calibration = 0;
28-
static lower_phy_ta_offset ta_offset = lower_phy_ta_offset::n0;
29-
static float tx_scale = 1.0F;
30-
static cyclic_prefix cp = cyclic_prefix::NORMAL;
31-
static unsigned bandwidth_rb = 52;
32-
static double dl_freq_hz = 2.65e9;
33-
static double ul_freq_hz = 2.55e9;
34-
static std::string log_level = "debug";
23+
static sampling_rate srate = sampling_rate::from_MHz(61.44);
24+
static subcarrier_spacing scs = subcarrier_spacing::kHz15;
25+
static unsigned max_processing_delay_slots = 4;
26+
static unsigned ul_to_dl_subframe_offset = 1;
27+
static int time_alignment_calibration = 0;
28+
static n_ta_offset ta_offset = n_ta_offset::n0;
29+
static float tx_scale = 1.0F;
30+
static cyclic_prefix cp = cyclic_prefix::NORMAL;
31+
static unsigned bandwidth_rb = 52;
32+
static double dl_freq_hz = 2.65e9;
33+
static double ul_freq_hz = 2.55e9;
34+
static std::string log_level = "debug";
3535

3636
static std::shared_ptr<ofdm_modulator_factory_spy> modulator_factory = nullptr;
3737
static std::shared_ptr<ofdm_demodulator_factory_spy> demodulator_factory = nullptr;

0 commit comments

Comments
 (0)