Commit 2c7530e0 authored by Laurent THOMAS's avatar Laurent THOMAS

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

Signed-off-by: default avatarLaurent THOMAS <laurent.thomas@open-cells.com>
parent d4d494d0
...@@ -107,7 +107,7 @@ struct timespec timespec_sub(struct timespec, struct timespec) ...@@ -107,7 +107,7 @@ struct timespec timespec_sub(struct timespec, struct timespec)
return t; return t;
}; };
void perform_symbol_rotation(NR_DL_FRAME_PARMS *fp, double f0, c16_t *symbol_rotation) void perform_symbol_rotation(const int nsymb, const int numerology_index, double f0, c16_t *symbol_rotation)
{ {
return; return;
} }
......
...@@ -568,8 +568,10 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp, ...@@ -568,8 +568,10 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
// ssb_offset_pointa points to the first RE where Sidelink-PSBCH starts // ssb_offset_pointa points to the first RE where Sidelink-PSBCH starts
fp->ssb_start_subcarrier = config->sl_bwp_config.sl_ssb_offset_point_a; fp->ssb_start_subcarrier = config->sl_bwp_config.sl_ssb_offset_point_a;
perform_symbol_rotation(fp->symbols_per_slot * fp->slots_per_frame / 10,
perform_symbol_rotation(fp, fp->sl_CarrierFreq, fp->symbol_rotation[link_type_sl]); fp->numerology_index,
fp->sl_CarrierFreq,
fp->symbol_rotation[link_type_sl]);
init_timeshift_rotation(fp); init_timeshift_rotation(fp);
// Not used for Sidelink // Not used for Sidelink
......
...@@ -573,13 +573,12 @@ void nr_dft(c16_t *z, c16_t *d, uint32_t Msc_PUSCH) ...@@ -573,13 +573,12 @@ void nr_dft(c16_t *z, c16_t *d, uint32_t Msc_PUSCH)
} }
} }
void perform_symbol_rotation(NR_DL_FRAME_PARMS *fp, double f0, c16_t *symbol_rotation) void perform_symbol_rotation(const int nsymb, const int numerology_index, double f0, c16_t *symbol_rotation)
{ {
const int nsymb = fp->symbols_per_slot * fp->slots_per_frame / 10;
const double Tc = (1 / 480e3 / 4096); const double Tc = (1 / 480e3 / 4096);
const double Nu = 2048 * 64 * (1 / (float)(1 << fp->numerology_index)); const double Nu = 2048 * 64 * (1 / (float)(1 << numerology_index));
const double Ncp0 = 16 * 64 + (144 * 64 * (1 / (float)(1 << fp->numerology_index))); const double Ncp0 = 16 * 64 + (144 * 64 * (1 / (float)(1 << numerology_index)));
const double Ncp1 = (144 * 64 * (1 / (float)(1 << fp->numerology_index))); const double Ncp1 = (144 * 64 * (1 / (float)(1 << numerology_index)));
LOG_D(PHY, "Doing symbol rotation calculation for TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb); LOG_D(PHY, "Doing symbol rotation calculation for TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb);
...@@ -590,7 +589,7 @@ void perform_symbol_rotation(NR_DL_FRAME_PARMS *fp, double f0, c16_t *symbol_rot ...@@ -590,7 +589,7 @@ void perform_symbol_rotation(NR_DL_FRAME_PARMS *fp, double f0, c16_t *symbol_rot
for (int l = 0; l < nsymb; l++) { for (int l = 0; l < nsymb; l++) {
double Ncp; double Ncp;
if (l == 0 || l == (7 * (1 << fp->numerology_index))) { if (l == 0 || l == (7 * (1 << numerology_index))) {
Ncp = Ncp0; Ncp = Ncp0;
} else { } else {
Ncp = Ncp1; Ncp = Ncp1;
...@@ -624,8 +623,7 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) ...@@ -624,8 +623,7 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp)
if (f0 == 0) if (f0 == 0)
continue; continue;
c16_t *rot = fp->symbol_rotation[ll]; c16_t *rot = fp->symbol_rotation[ll];
perform_symbol_rotation(fp->symbols_per_slot * fp->slots_per_frame / 10, fp->numerology_index, f0, rot);
perform_symbol_rotation(fp, f0, rot);
} }
} }
......
...@@ -101,8 +101,7 @@ void nr_ofdm_demod_and_rx_rotation(c16_t **rxdata, ...@@ -101,8 +101,7 @@ void nr_ofdm_demod_and_rx_rotation(c16_t **rxdata,
int slot_offsetF, int slot_offsetF,
enum nr_Link linktype, enum nr_Link linktype,
bool was_symbol_used[NR_SYMBOLS_PER_SLOT]); bool was_symbol_used[NR_SYMBOLS_PER_SLOT]);
void perform_symbol_rotation(const int nsymb, const int numerology_index, double f0, c16_t *symbol_rotation);
void perform_symbol_rotation(NR_DL_FRAME_PARMS *fp, double f0, c16_t *symbol_rotation);
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp); void init_symbol_rotation(NR_DL_FRAME_PARMS *fp);
......
...@@ -209,7 +209,10 @@ static void configure_SL_UE(PHY_VARS_NR_UE *UE, int mu, int N_RB, int ssb_offset ...@@ -209,7 +209,10 @@ static void configure_SL_UE(PHY_VARS_NR_UE *UE, int mu, int N_RB, int ssb_offset
sl_init_frame_parameters(UE); sl_init_frame_parameters(UE);
sl_ue_phy_init(UE); sl_ue_phy_init(UE);
perform_symbol_rotation(fp, fp->sl_CarrierFreq, fp->symbol_rotation[link_type_sl]); perform_symbol_rotation(fp->symbols_per_slot * fp->slots_per_frame / 10,
fp->numerology_index,
fp->sl_CarrierFreq,
fp->symbol_rotation[link_type_sl]);
init_timeshift_rotation(fp); init_timeshift_rotation(fp);
LOG_I(PHY, "Dumping Sidelink Frame Parameters\n"); LOG_I(PHY, "Dumping Sidelink Frame Parameters\n");
nr_dump_frame_parms(fp); nr_dump_frame_parms(fp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment