use specific paramters for apply_nr_rotation_symbol_RX() instead of global frame parms

Signed-off-by: Laurent THOMAS <laurent.thomas@open-cells.com>
This commit is contained in:
Laurent THOMAS
2026-05-05 21:04:06 +02:00
committed by Robert Schmidt
parent 911f069709
commit b7cba9d266
3 changed files with 36 additions and 29 deletions

View File

@@ -172,13 +172,17 @@ static void rx_func(processingData_L1_t *info)
if (gNB->phase_comp) {
//apply the rx signal rotation here
int soffset = (slot_rx % RU_RX_SLOT_DEPTH) * gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size;
for (int aa = 0; aa < gNB->frame_parms.nb_antennas_tx; aa++) {
const uint max_symb = (gNB->frame_parms.Ncp == NR_EXTENDED) ? 12 : 14;
const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
for (int aa = 0; aa < fp->nb_antennas_rx; aa++) {
const uint max_symb = fp->Ncp == NR_EXTENDED ? 12 : 14;
for (int sym = 0; sym < max_symb; sym++)
apply_nr_rotation_symbol_RX(&gNB->frame_parms,
gNB->common_vars.rxdataF[aa] + soffset + sym * gNB->frame_parms.ofdm_symbol_size,
gNB->frame_parms.symbol_rotation[1],
gNB->frame_parms.N_RB_UL,
apply_nr_rotation_symbol_RX(fp->symbols_per_slot,
fp->slots_per_subframe,
fp->timeshift_symbol_rotation,
fp->first_carrier_offset,
gNB->common_vars.rxdataF[aa] + soffset + sym * fp->ofdm_symbol_size,
fp->symbol_rotation[1],
fp->N_RB_UL,
slot_rx,
sym);
}

View File

@@ -110,7 +110,10 @@ void init_timeshift_rotation(const int ofdm_symbol_size,
const uint ofdm_offset_divisor,
c16_t *timeshift_symbol_rotation);
void apply_nr_rotation_symbol_RX(const NR_DL_FRAME_PARMS *frame_parms,
void apply_nr_rotation_symbol_RX(const int symbols_per_slot,
const int slots_per_subframe,
const c16_t *timeshift_symbol_rotation,
const int first_carrier_offset,
c16_t *rxdataF,
const c16_t *rot,
int nb_rb,

View File

@@ -31,7 +31,10 @@ void nr_symbol_fep(const NR_DL_FRAME_PARMS *frame_parms,
if (dft_stats) stop_meas(dft_stats);
const bool is_sl = (link_type == link_type_sl);
apply_nr_rotation_symbol_RX(frame_parms,
apply_nr_rotation_symbol_RX(frame_parms->symbols_per_slot,
frame_parms->slots_per_subframe,
frame_parms->timeshift_symbol_rotation,
frame_parms->first_carrier_offset,
rxdataF[aa],
frame_parms->symbol_rotation[link_type],
is_sl ? frame_parms->N_RB_SL : frame_parms->N_RB_DL,
@@ -159,45 +162,39 @@ int nr_symbol_fep_ul(const NR_DL_FRAME_PARMS *fp,
return 0;
}
void apply_nr_rotation_symbol_RX(const NR_DL_FRAME_PARMS *frame_parms,
void apply_nr_rotation_symbol_RX(const int symbols_per_slot,
const int slots_per_subframe,
const c16_t *shift_rot,
const int first_carrier_offset,
c16_t *rxdataF,
const c16_t *rot,
int nb_rb,
int slot,
int symbol)
{
const int symb_offset = (slot % frame_parms->slots_per_subframe) * frame_parms->symbols_per_slot;
const int symb_offset = (slot % slots_per_subframe) * symbols_per_slot;
c16_t rot2 = rot[symbol + symb_offset];
rot2.i = -rot2.i;
LOG_D(PHY, "slot %d, symb_offset %d rotating by %d.%d\n", slot, symb_offset, rot2.r, rot2.i);
const c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
c16_t *this_symbol = rxdataF;
if (nb_rb & 1) {
rotate_cpx_vector(this_symbol, &rot2, this_symbol, (nb_rb + 1) * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
&rot2,
this_symbol + frame_parms->first_carrier_offset - 6,
(nb_rb + 1) * 6,
15);
rotate_cpx_vector(this_symbol + first_carrier_offset - 6, &rot2, this_symbol + first_carrier_offset - 6, (nb_rb + 1) * 6, 15);
mult_cpx_vector(this_symbol, shift_rot, this_symbol, (nb_rb + 1) * 6, 15);
mult_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
shift_rot + frame_parms->first_carrier_offset - 6,
this_symbol + frame_parms->first_carrier_offset - 6,
mult_cpx_vector(this_symbol + first_carrier_offset - 6,
shift_rot + first_carrier_offset - 6,
this_symbol + first_carrier_offset - 6,
(nb_rb + 1) * 6,
15);
} else {
rotate_cpx_vector(this_symbol, &rot2, this_symbol, nb_rb * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
&rot2,
this_symbol + frame_parms->first_carrier_offset,
nb_rb * 6,
15);
rotate_cpx_vector(this_symbol + first_carrier_offset, &rot2, this_symbol + first_carrier_offset, nb_rb * 6, 15);
mult_cpx_vector(this_symbol, shift_rot, this_symbol, nb_rb * 6, 15);
mult_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
shift_rot + frame_parms->first_carrier_offset,
this_symbol + frame_parms->first_carrier_offset,
mult_cpx_vector(this_symbol + first_carrier_offset,
shift_rot + first_carrier_offset,
this_symbol + first_carrier_offset,
nb_rb * 6,
15);
}
@@ -216,7 +213,10 @@ void nr_ofdm_demod_and_rx_rotation(c16_t **rxdata,
for (uint8_t symbol = 0; symbol < fp->symbols_per_slot; symbol++) {
if (was_symbol_used[symbol] == true) {
nr_symbol_fep_ul(fp, &rxdata[aa][0], &rxdataF[aa][slot_offsetF + symbol * fp->ofdm_symbol_size], symbol, slot, 0);
apply_nr_rotation_symbol_RX(fp,
apply_nr_rotation_symbol_RX(fp->symbols_per_slot,
fp->slots_per_subframe,
fp->timeshift_symbol_rotation,
fp->first_carrier_offset,
&rxdataF[aa][slot_offsetF + symbol * fp->ofdm_symbol_size],
fp->symbol_rotation[linktype],
fp->N_RB_UL,