Merge remote-tracking branch 'origin/fix_ntn_leo' into integration_2025_w16 (!3387)
fix NTN LEO scenario NR UE: in nr_slot_fep() perform FO compensation in local tmp_dft_in array instead of global rxdata array. This avoids problems if nr_slot_fep() is called more than once for an OFDM symbol.
This commit is contained in:
@@ -51,7 +51,7 @@ gNBs =
|
|||||||
initialDLBWPsubcarrierSpacing = 0;
|
initialDLBWPsubcarrierSpacing = 0;
|
||||||
#pdcch-ConfigCommon
|
#pdcch-ConfigCommon
|
||||||
initialDLBWPcontrolResourceSetZero = 2;
|
initialDLBWPcontrolResourceSetZero = 2;
|
||||||
initialDLBWPsearchSpaceZero = 0;
|
initialDLBWPsearchSpaceZero = 2;
|
||||||
|
|
||||||
#uplinkConfigCommon
|
#uplinkConfigCommon
|
||||||
#frequencyInfoUL
|
#frequencyInfoUL
|
||||||
@@ -151,7 +151,7 @@ gNBs =
|
|||||||
#ext2
|
#ext2
|
||||||
#ntn_Config_r17
|
#ntn_Config_r17
|
||||||
cellSpecificKoffset_r17 = 40;
|
cellSpecificKoffset_r17 = 40;
|
||||||
ta-Common-r17 = 4634000; # 18.87 ms
|
ta-Common-r17 = 4628000; # 18.84 ms
|
||||||
ta-CommonDrift-r17 = -230000; # -46 µs/s
|
ta-CommonDrift-r17 = -230000; # -46 µs/s
|
||||||
positionX-r17 = 0;
|
positionX-r17 = 0;
|
||||||
positionY-r17 = -2166908; # -2816980.4 m
|
positionY-r17 = -2166908; # -2816980.4 m
|
||||||
|
|||||||
@@ -235,15 +235,6 @@ RUs = (
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
THREAD_STRUCT = (
|
|
||||||
{
|
|
||||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
|
||||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
|
||||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
|
||||||
worker_config = "WORKER_DISABLE";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
rfsimulator :
|
rfsimulator :
|
||||||
{
|
{
|
||||||
serveraddr = "server";
|
serveraddr = "server";
|
||||||
@@ -279,6 +270,4 @@ log_config :
|
|||||||
rlc_log_level ="info";
|
rlc_log_level ="info";
|
||||||
pdcp_log_level ="info";
|
pdcp_log_level ="info";
|
||||||
rrc_log_level ="info";
|
rrc_log_level ="info";
|
||||||
ngap_log_level ="debug";
|
|
||||||
f1ap_log_level ="debug";
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ services:
|
|||||||
--time-sync-I 0.1 --ntn-initial-time-drift -46
|
--time-sync-I 0.1 --ntn-initial-time-drift -46
|
||||||
--autonomous-ta --initial-fo 57340 --cont-fo-comp 2
|
--autonomous-ta --initial-fo 57340 --cont-fo-comp 2
|
||||||
--log_config.global_log_options level,nocolor,time
|
--log_config.global_log_options level,nocolor,time
|
||||||
|
--num-ul-actors 1
|
||||||
depends_on:
|
depends_on:
|
||||||
- oai-gnb
|
- oai-gnb
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
+1
-1
@@ -564,7 +564,7 @@ static void RU_write(nr_rxtx_thread_data_t *rxtxD, bool sl_tx_action)
|
|||||||
if (get_nrUE_params()->cont_fo_comp == 2) // different from LO frequency error compensation, Doppler UL pre-compensation has to be negative
|
if (get_nrUE_params()->cont_fo_comp == 2) // different from LO frequency error compensation, Doppler UL pre-compensation has to be negative
|
||||||
ul_freq_offset = -ul_freq_offset;
|
ul_freq_offset = -ul_freq_offset;
|
||||||
for (int i = 0; i < fp->nb_antennas_tx; i++)
|
for (int i = 0; i < fp->nb_antennas_tx; i++)
|
||||||
nr_fo_compensation(ul_freq_offset, fp->samples_per_subframe, writeTimestamp, txp[i], writeBlockSize);
|
nr_fo_compensation(ul_freq_offset, fp->samples_per_subframe, writeTimestamp, txp[i], txp[i], writeBlockSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
int tmp = openair0_write_reorder(&UE->rfdevice, writeTimestamp, txp, writeBlockSize, fp->nb_antennas_tx, flags);
|
int tmp = openair0_write_reorder(&UE->rfdevice, writeTimestamp, txp, writeBlockSize, fp->nb_antennas_tx, flags);
|
||||||
|
|||||||
@@ -28,13 +28,6 @@
|
|||||||
#include "PHY/nr_phy_common/inc/nr_phy_common.h"
|
#include "PHY/nr_phy_common/inc/nr_phy_common.h"
|
||||||
#include <common/utils/LOG/log.h>
|
#include <common/utils/LOG/log.h>
|
||||||
|
|
||||||
//#define DEBUG_FEP
|
|
||||||
|
|
||||||
/*#ifdef LOG_I
|
|
||||||
#undef LOG_I
|
|
||||||
#define LOG_I(A,B...) printf(A)
|
|
||||||
#endif*/
|
|
||||||
|
|
||||||
int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||||
const NR_DL_FRAME_PARMS *frame_parms,
|
const NR_DL_FRAME_PARMS *frame_parms,
|
||||||
unsigned int slot,
|
unsigned int slot,
|
||||||
@@ -44,7 +37,6 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
|||||||
uint32_t sample_offset,
|
uint32_t sample_offset,
|
||||||
c16_t **rxdata)
|
c16_t **rxdata)
|
||||||
{
|
{
|
||||||
|
|
||||||
AssertFatal(symbol < frame_parms->symbols_per_slot, "slot_fep: symbol must be between 0 and %d\n", frame_parms->symbols_per_slot-1);
|
AssertFatal(symbol < frame_parms->symbols_per_slot, "slot_fep: symbol must be between 0 and %d\n", frame_parms->symbols_per_slot-1);
|
||||||
AssertFatal(slot < frame_parms->slots_per_frame, "slot_fep: Ns must be between 0 and %d\n", frame_parms->slots_per_frame - 1);
|
AssertFatal(slot < frame_parms->slots_per_frame, "slot_fep: Ns must be between 0 and %d\n", frame_parms->slots_per_frame - 1);
|
||||||
|
|
||||||
@@ -68,7 +60,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
|||||||
|
|
||||||
dft_size_idx_t dftsize = get_dft(frame_parms->ofdm_symbol_size);
|
dft_size_idx_t dftsize = get_dft(frame_parms->ofdm_symbol_size);
|
||||||
// This is for misalignment issues
|
// This is for misalignment issues
|
||||||
int32_t tmp_dft_in[8192] __attribute__ ((aligned (32)));
|
c16_t tmp_dft_in[frame_parms->ofdm_symbol_size] __attribute__ ((aligned (32)));
|
||||||
|
|
||||||
unsigned int rx_offset = frame_parms->get_samples_slot_timestamp(slot, frame_parms, 0);
|
unsigned int rx_offset = frame_parms->get_samples_slot_timestamp(slot, frame_parms, 0);
|
||||||
unsigned int abs_symbol = slot * frame_parms->symbols_per_slot + symbol;
|
unsigned int abs_symbol = slot * frame_parms->symbols_per_slot + symbol;
|
||||||
@@ -81,16 +73,10 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
|||||||
// use OFDM symbol from within 1/8th of the CP to avoid ISI
|
// use OFDM symbol from within 1/8th of the CP to avoid ISI
|
||||||
rx_offset -= (nb_prefix_samples / frame_parms->ofdm_offset_divisor);
|
rx_offset -= (nb_prefix_samples / frame_parms->ofdm_offset_divisor);
|
||||||
|
|
||||||
#ifdef DEBUG_FEP
|
rx_offset %= total_samples;
|
||||||
// if (ue->frame <100)
|
|
||||||
LOG_D(PHY,"slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, rx_offset %u energy %d\n",
|
|
||||||
Ns, symbol, nb_prefix_samples, nb_prefix_samples0, rx_offset, dB_fixed(signal_energy((int32_t *)&common_vars->rxdata[0][rx_offset],frame_parms->ofdm_symbol_size)));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (unsigned char aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
for (unsigned char aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||||
int16_t *rxdata_ptr = (int16_t *)&rxdata[aa][rx_offset];
|
c16_t *rxdata_ptr = &rxdata[aa][rx_offset];
|
||||||
|
|
||||||
rx_offset %= total_samples;
|
|
||||||
|
|
||||||
// This happens only during initial sync
|
// This happens only during initial sync
|
||||||
if (rx_offset + frame_parms->ofdm_symbol_size > total_samples) {
|
if (rx_offset + frame_parms->ofdm_symbol_size > total_samples) {
|
||||||
@@ -101,17 +87,17 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
|||||||
memcpy((void *)&tmp_dft_in[total_samples - rx_offset],
|
memcpy((void *)&tmp_dft_in[total_samples - rx_offset],
|
||||||
(void *)&rxdata[aa][0],
|
(void *)&rxdata[aa][0],
|
||||||
(frame_parms->ofdm_symbol_size - (total_samples - rx_offset)) * sizeof(int32_t));
|
(frame_parms->ofdm_symbol_size - (total_samples - rx_offset)) * sizeof(int32_t));
|
||||||
rxdata_ptr = (int16_t *)tmp_dft_in;
|
rxdata_ptr = tmp_dft_in;
|
||||||
|
|
||||||
} else if ((rx_offset & 7) != 0) { // if input to dft is not 256-bit aligned
|
} else if ((rx_offset & 7) != 0) { // if input to dft is not 256-bit aligned
|
||||||
memcpy((void *)&tmp_dft_in[0], (void *)&rxdata[aa][rx_offset], frame_parms->ofdm_symbol_size * sizeof(int32_t));
|
memcpy((void *)&tmp_dft_in[0], (void *)&rxdata[aa][rx_offset], frame_parms->ofdm_symbol_size * sizeof(int32_t));
|
||||||
|
rxdata_ptr = tmp_dft_in;
|
||||||
rxdata_ptr = (int16_t *)tmp_dft_in;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ue && ue->cont_fo_comp) {
|
if (ue && ue->cont_fo_comp) {
|
||||||
start_meas_nr_ue_phy(ue, RX_FO_COMPENSATION_STATS);
|
start_meas_nr_ue_phy(ue, RX_FO_COMPENSATION_STATS);
|
||||||
nr_fo_compensation(ue->freq_offset, frame_parms->samples_per_subframe, rx_offset, (c16_t *)rxdata_ptr, frame_parms->ofdm_symbol_size);
|
nr_fo_compensation(ue->freq_offset, frame_parms->samples_per_subframe, rx_offset, rxdata_ptr, tmp_dft_in, frame_parms->ofdm_symbol_size);
|
||||||
|
rxdata_ptr = tmp_dft_in;
|
||||||
stop_meas_nr_ue_phy(ue, RX_FO_COMPENSATION_STATS);
|
stop_meas_nr_ue_phy(ue, RX_FO_COMPENSATION_STATS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +105,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
|||||||
start_meas_nr_ue_phy(ue, RX_DFT_STATS);
|
start_meas_nr_ue_phy(ue, RX_DFT_STATS);
|
||||||
|
|
||||||
dft(dftsize,
|
dft(dftsize,
|
||||||
rxdata_ptr,
|
(int16_t *)rxdata_ptr,
|
||||||
(int16_t *)&rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
(int16_t *)&rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||||
1);
|
1);
|
||||||
|
|
||||||
@@ -129,10 +115,6 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
|||||||
apply_nr_rotation_RX(frame_parms, rxdataF[aa], frame_parms->symbol_rotation[linktype], slot, N_RB, 0, symbol, 1);
|
apply_nr_rotation_RX(frame_parms, rxdataF[aa], frame_parms->symbol_rotation[linktype], slot, N_RB, 0, symbol, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_FEP
|
|
||||||
printf("slot_fep: done\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1081,7 +1081,6 @@ void NFAPI_NR_DMRS_TYPE1_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
c16_t *dl_ch,
|
c16_t *dl_ch,
|
||||||
unsigned short bwp_start_subcarrier,
|
unsigned short bwp_start_subcarrier,
|
||||||
unsigned short nb_rb_pdsch,
|
unsigned short nb_rb_pdsch,
|
||||||
int8_t delta,
|
|
||||||
delay_t *delay,
|
delay_t *delay,
|
||||||
uint32_t *nvar)
|
uint32_t *nvar)
|
||||||
{
|
{
|
||||||
@@ -1094,30 +1093,23 @@ void NFAPI_NR_DMRS_TYPE1_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
int nest_count = 0;
|
int nest_count = 0;
|
||||||
uint64_t noise_amp2 = 0;
|
uint64_t noise_amp2 = 0;
|
||||||
|
|
||||||
for (int pilot_cnt = 0; pilot_cnt < 6 * nb_rb_pdsch; pilot_cnt++) {
|
for (int pilot_cnt = 0; pilot_cnt < 6 * nb_rb_pdsch; pilot_cnt += 2) {
|
||||||
if (pilot_cnt % 2 == 0) {
|
c16_t ch_l = c16mulShift(*pil, rxF[re_offset], 15);
|
||||||
c16_t ch = c16mulShift(*pil, rxF[re_offset], 15);
|
|
||||||
pil++;
|
|
||||||
re_offset = (re_offset + 2) % frame_parms->ofdm_symbol_size;
|
|
||||||
ch = c16maddShift(*pil, rxF[re_offset], ch, 15);
|
|
||||||
ch = c16Shift(ch, 1);
|
|
||||||
pil++;
|
|
||||||
re_offset = (re_offset + 2) % frame_parms->ofdm_symbol_size;
|
|
||||||
for (int k = pilot_cnt << 1; k < (pilot_cnt << 1) + 4; k++) {
|
|
||||||
dl_ls_est[k] = ch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG_PDSCH
|
#ifdef DEBUG_PDSCH
|
||||||
printf("pilot %3d: pil -> (%6d,%6d), rxF -> (%4d,%4d), ch -> (%4d,%4d) \n",
|
printf("pilot %3d: pil -> (%6d,%6d), rxF -> (%4d,%4d), ch -> (%4d,%4d) \n", pilot_cnt, pil->r, pil->i, rxF[re_offset].r, rxF[re_offset].i, ch_l.r, ch_l.i);
|
||||||
pilot_cnt,
|
|
||||||
pil->r,
|
|
||||||
pil->i,
|
|
||||||
rxF[re_offset].r,
|
|
||||||
rxF[re_offset].i,
|
|
||||||
dl_ls_est[pilot_cnt << 1].r,
|
|
||||||
dl_ls_est[pilot_cnt << 1].i);
|
|
||||||
#endif
|
#endif
|
||||||
|
pil++;
|
||||||
|
re_offset = (re_offset + 2) % frame_parms->ofdm_symbol_size;
|
||||||
|
c16_t ch_r = c16mulShift(*pil, rxF[re_offset], 15);
|
||||||
|
#ifdef DEBUG_PDSCH
|
||||||
|
printf("pilot %3d: pil -> (%6d,%6d), rxF -> (%4d,%4d), ch -> (%4d,%4d) \n", pilot_cnt + 1, pil->r, pil->i, rxF[re_offset].r, rxF[re_offset].i, ch_r.r, ch_r.i);
|
||||||
|
#endif
|
||||||
|
c16_t ch = c16addShift(ch_l, ch_r, 1);
|
||||||
|
pil++;
|
||||||
|
re_offset = (re_offset + 2) % frame_parms->ofdm_symbol_size;
|
||||||
|
for (int k = pilot_cnt << 1; k < (pilot_cnt << 1) + 4; k++) {
|
||||||
|
dl_ls_est[k] = ch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c16_t ch_estimates_time[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
|
c16_t ch_estimates_time[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
|
||||||
@@ -1247,8 +1239,6 @@ void NFAPI_NR_DMRS_TYPE2_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
c16_t *dl_ch,
|
c16_t *dl_ch,
|
||||||
unsigned short bwp_start_subcarrier,
|
unsigned short bwp_start_subcarrier,
|
||||||
unsigned short nb_rb_pdsch,
|
unsigned short nb_rb_pdsch,
|
||||||
int8_t delta,
|
|
||||||
unsigned short p,
|
|
||||||
delay_t *delay,
|
delay_t *delay,
|
||||||
uint32_t *nvar)
|
uint32_t *nvar)
|
||||||
{
|
{
|
||||||
@@ -1270,7 +1260,7 @@ void NFAPI_NR_DMRS_TYPE2_linear_interp(NR_DL_FRAME_PARMS *frame_parms,
|
|||||||
re_offset = (re_offset + 1) % frame_parms->ofdm_symbol_size;
|
re_offset = (re_offset + 1) % frame_parms->ofdm_symbol_size;
|
||||||
c16_t ch_r = c16mulShift(*pil, rxF[re_offset], 15);
|
c16_t ch_r = c16mulShift(*pil, rxF[re_offset], 15);
|
||||||
#ifdef DEBUG_PDSCH
|
#ifdef DEBUG_PDSCH
|
||||||
printf("pilot %3d: pil -> (%6d,%6d), rxF -> (%4d,%4d), ch -> (%4d,%4d) \n", pilot_cnt, pil->r, pil->i, rxF[re_offset].r, rxF[re_offset].i, ch_r.r, ch_r.i);
|
printf("pilot %3d: pil -> (%6d,%6d), rxF -> (%4d,%4d), ch -> (%4d,%4d) \n", pilot_cnt + 1, pil->r, pil->i, rxF[re_offset].r, rxF[re_offset].i, ch_r.r, ch_r.i);
|
||||||
#endif
|
#endif
|
||||||
c16_t ch = c16addShift(ch_l, ch_r, 1);
|
c16_t ch = c16addShift(ch_l, ch_r, 1);
|
||||||
for (int k = 3 * pilot_cnt; k < (3 * pilot_cnt) + 6; k++) {
|
for (int k = 3 * pilot_cnt; k < (3 * pilot_cnt) + 6; k++) {
|
||||||
@@ -1427,9 +1417,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
|
|
||||||
#ifdef DEBUG_PDSCH
|
#ifdef DEBUG_PDSCH
|
||||||
printf(
|
printf(
|
||||||
"PDSCH Channel Estimation : gNB_id %d ch_offset %d, symbol_offset %d OFDM size %d, Ncp=%d, Ns=%d, bwp_start_subcarrier=%d "
|
"PDSCH Channel Estimation : ch_offset %d, symbol_offset %d OFDM size %d, Ncp=%d, Ns=%d, bwp_start_subcarrier=%d "
|
||||||
"symbol %d\n",
|
"symbol %d\n",
|
||||||
gNB_id,
|
|
||||||
ch_offset,
|
ch_offset,
|
||||||
symbol_offset,
|
symbol_offset,
|
||||||
fp->ofdm_symbol_size,
|
fp->ofdm_symbol_size,
|
||||||
@@ -1467,7 +1456,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
dl_ch,
|
dl_ch,
|
||||||
bwp_start_subcarrier,
|
bwp_start_subcarrier,
|
||||||
nb_rb_pdsch,
|
nb_rb_pdsch,
|
||||||
delta,
|
|
||||||
&delay,
|
&delay,
|
||||||
nvar);
|
nvar);
|
||||||
|
|
||||||
@@ -1478,8 +1466,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
|||||||
dl_ch,
|
dl_ch,
|
||||||
bwp_start_subcarrier,
|
bwp_start_subcarrier,
|
||||||
nb_rb_pdsch,
|
nb_rb_pdsch,
|
||||||
delta,
|
|
||||||
p,
|
|
||||||
&delay,
|
&delay,
|
||||||
nvar);
|
nvar);
|
||||||
|
|
||||||
|
|||||||
@@ -576,6 +576,25 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
|||||||
*log2_maxh,
|
*log2_maxh,
|
||||||
ue->phy_cpu_stats.cpu_time_stats[DLSCH_CHANNEL_COMPENSATION_STATS].p_time / (cpuf * 1000.0));
|
ue->phy_cpu_stats.cpu_time_stats[DLSCH_CHANNEL_COMPENSATION_STATS].p_time / (cpuf * 1000.0));
|
||||||
}
|
}
|
||||||
|
// Please keep it: useful for debugging
|
||||||
|
#ifdef DEBUG_PDSCH_RX
|
||||||
|
char filename[50];
|
||||||
|
|
||||||
|
snprintf(filename, 50, "rxdataF0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx);
|
||||||
|
write_output(filename, "rxdataF0", &rxdataF[0][symbol * frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1);
|
||||||
|
|
||||||
|
snprintf(filename, 50, "dl_ch_estimates0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx);
|
||||||
|
write_output(filename, "dl_ch_estimates0", &dl_ch_estimates[0][symbol * frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1);
|
||||||
|
|
||||||
|
snprintf(filename, 50, "rxdataF_ext0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx);
|
||||||
|
write_output(filename, "rxdataF_ext0", &rxdataF_ext[0][0], rx_size_symbol, 1, 1);
|
||||||
|
|
||||||
|
snprintf(filename, 50, "dl_ch_estimates_ext0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx);
|
||||||
|
write_output(filename, "dl_ch_estimates_ext0", &dl_ch_estimates_ext[0][0], rx_size_symbol, 1, 1);
|
||||||
|
|
||||||
|
snprintf(filename, 50, "rxdataF_comp00_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx);
|
||||||
|
write_output(filename, "rxdataF_comp00", &rxdataF_comp[0][0][symbol * rx_size_symbol], rx_size_symbol, 1, 1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
start_meas_nr_ue_phy(ue, DLSCH_MRC_MMSE_STATS);
|
start_meas_nr_ue_phy(ue, DLSCH_MRC_MMSE_STATS);
|
||||||
@@ -694,32 +713,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
|||||||
rx_llr_layer_size,
|
rx_llr_layer_size,
|
||||||
layer_llr);
|
layer_llr);
|
||||||
stop_meas_nr_ue_phy(ue, DLSCH_LAYER_DEMAPPING);
|
stop_meas_nr_ue_phy(ue, DLSCH_LAYER_DEMAPPING);
|
||||||
// Please keep it: useful for debugging
|
|
||||||
#ifdef DEBUG_PDSCH_RX
|
|
||||||
char filename[50];
|
|
||||||
uint8_t aa = 0;
|
|
||||||
|
|
||||||
snprintf(filename, 50, "rxdataF0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx);
|
|
||||||
write_output(filename, "rxdataF0", &rxdataF[0][0], NR_SYMBOLS_PER_SLOT*frame_parms->ofdm_symbol_size, 1, 1);
|
|
||||||
|
|
||||||
snprintf(filename, 50, "dl_ch_estimates0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx);
|
|
||||||
write_output(filename, "dl_ch_estimates", &dl_ch_estimates[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->ofdm_symbol_size, 1, 1);
|
|
||||||
|
|
||||||
snprintf(filename, 50, "rxdataF_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx);
|
|
||||||
write_output(filename, "rxdataF_ext", &rxdataF_ext[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1);
|
|
||||||
|
|
||||||
snprintf(filename, 50, "dl_ch_estimates_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx);
|
|
||||||
write_output(filename, "dl_ch_estimates_ext00", &dl_ch_estimates_ext[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1);
|
|
||||||
|
|
||||||
snprintf(filename, 50, "rxdataF_comp0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx);
|
|
||||||
write_output(filename, "rxdataF_comp00", &rxdataF_comp[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1);
|
|
||||||
/*
|
/*
|
||||||
for (int i=0; i < 2; i++){
|
for (int i=0; i < 2; i++){
|
||||||
snprintf(filename, 50, "llr%d_symb_%d_nr_slot_rx_%d.m", i, symbol, nr_slot_rx);
|
snprintf(filename, 50, "llr%d_symb_%d_nr_slot_rx_%d.m", i, symbol, nr_slot_rx);
|
||||||
write_output(filename,"llr", &llr[i][0], (NR_SYMBOLS_PER_SLOT*nb_rb_pdsch*NR_NB_SC_PER_RB*dlsch1_harq->Qm) - 4*(nb_rb_pdsch*4*dlsch1_harq->Qm), 1, 0);
|
write_output(filename,"llr", &llr[i][0], (NR_SYMBOLS_PER_SLOT*nb_rb_pdsch*NR_NB_SC_PER_RB*dlsch1_harq->Qm) - 4*(nb_rb_pdsch*4*dlsch1_harq->Qm), 1, 0);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
#endif
|
|
||||||
if (UEScopeHasTryLock(ue)) {
|
if (UEScopeHasTryLock(ue)) {
|
||||||
metadata mt = {.frame = proc->frame_rx, .slot = proc->nr_slot_rx };
|
metadata mt = {.frame = proc->frame_rx, .slot = proc->nr_slot_rx };
|
||||||
int total_valid_res = 0;
|
int total_valid_res = 0;
|
||||||
|
|||||||
@@ -80,6 +80,6 @@ void nr_256qam_llr(int32_t *rxdataF_comp, int32_t *ch_mag, int32_t *ch_mag2, int
|
|||||||
void freq2time(uint16_t ofdm_symbol_size, int16_t *freq_signal, int16_t *time_signal);
|
void freq2time(uint16_t ofdm_symbol_size, int16_t *freq_signal, int16_t *time_signal);
|
||||||
void nr_est_delay(int ofdm_symbol_size, const c16_t *ls_est, c16_t *ch_estimates_time, delay_t *delay);
|
void nr_est_delay(int ofdm_symbol_size, const c16_t *ls_est, c16_t *ch_estimates_time, delay_t *delay);
|
||||||
unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int total_nb_rb, int nb_rb);
|
unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int total_nb_rb, int nb_rb);
|
||||||
void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, c16_t *rxdata_ptr, int size);
|
void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, const c16_t *rxdata_in, c16_t *rxdata_out, int size);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int total_nb_rb, in
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, c16_t *rxdata_ptr, int size)
|
void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, const c16_t *rxdata_in, c16_t *rxdata_out, int size)
|
||||||
{
|
{
|
||||||
const double phase_inc = -fo_Hz / (samples_per_ms * 1000);
|
const double phase_inc = -fo_Hz / (samples_per_ms * 1000);
|
||||||
double phase = sample_offset * phase_inc;
|
double phase = sample_offset * phase_inc;
|
||||||
@@ -473,12 +473,13 @@ void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, c16
|
|||||||
}
|
}
|
||||||
const c16_t rot_vec = get_sin_cos(CHUNK * phase_inc);
|
const c16_t rot_vec = get_sin_cos(CHUNK * phase_inc);
|
||||||
while (size > CHUNK) {
|
while (size > CHUNK) {
|
||||||
mult_complex_vectors(rxdata_ptr, rot, rxdata_ptr, CHUNK, 14);
|
mult_complex_vectors(rxdata_in, rot, rxdata_out, CHUNK, 14);
|
||||||
rxdata_ptr += CHUNK;
|
|
||||||
rotate_cpx_vector(rot, &rot_vec, rot, CHUNK, 14);
|
rotate_cpx_vector(rot, &rot_vec, rot, CHUNK, 14);
|
||||||
|
rxdata_in += CHUNK;
|
||||||
|
rxdata_out += CHUNK;
|
||||||
size -= CHUNK;
|
size -= CHUNK;
|
||||||
}
|
}
|
||||||
mult_complex_vectors(rxdata_ptr, rot, rxdata_ptr, size, 14);
|
mult_complex_vectors(rxdata_in, rot, rxdata_out, size, 14);
|
||||||
#else
|
#else
|
||||||
// This code path computes the complex rotation values for the complete OFDM symbol using get_sin_cos().
|
// This code path computes the complex rotation values for the complete OFDM symbol using get_sin_cos().
|
||||||
// This is more accurate, but also slower than the code path above.
|
// This is more accurate, but also slower than the code path above.
|
||||||
@@ -487,6 +488,6 @@ void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, c16
|
|||||||
rot[i] = get_sin_cos(phase);
|
rot[i] = get_sin_cos(phase);
|
||||||
phase += phase_inc;
|
phase += phase_inc;
|
||||||
}
|
}
|
||||||
mult_complex_vectors(rxdata_ptr, rot, rxdata_ptr, size, 14);
|
mult_complex_vectors(rxdata_in, rot, rxdata_out, size, 14);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -486,6 +486,7 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
|
|||||||
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
|
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
|
||||||
int G)
|
int G)
|
||||||
{
|
{
|
||||||
|
int frame_rx = proc->frame_rx;
|
||||||
int nr_slot_rx = proc->nr_slot_rx;
|
int nr_slot_rx = proc->nr_slot_rx;
|
||||||
|
|
||||||
// We handle only one CW now
|
// We handle only one CW now
|
||||||
@@ -497,9 +498,10 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
|
|||||||
NR_DL_UE_HARQ_t *dlsch0_harq = &ue->dl_harq_processes[0][harq_pid];
|
NR_DL_UE_HARQ_t *dlsch0_harq = &ue->dl_harq_processes[0][harq_pid];
|
||||||
|
|
||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
"[UE %d] nr_slot_rx %d, harq_pid %d (%d), BWP start %d, rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask "
|
"[UE %d] frame_rx %d, nr_slot_rx %d, harq_pid %d (%d), BWP start %d, rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask "
|
||||||
"%x, Nl %d\n",
|
"%x, Nl %d\n",
|
||||||
ue->Mod_id,
|
ue->Mod_id,
|
||||||
|
frame_rx,
|
||||||
nr_slot_rx,
|
nr_slot_rx,
|
||||||
harq_pid,
|
harq_pid,
|
||||||
dlsch0_harq->status,
|
dlsch0_harq->status,
|
||||||
@@ -559,10 +561,9 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
|
|||||||
nvar += nvar_tmp;
|
nvar += nvar_tmp;
|
||||||
#if 0
|
#if 0
|
||||||
///LOG_M: the channel estimation
|
///LOG_M: the channel estimation
|
||||||
int nr_frame_rx = proc->frame_rx;
|
|
||||||
char filename[100];
|
char filename[100];
|
||||||
for (uint8_t aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
for (uint8_t aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||||
sprintf(filename,"PDSCH_CHANNEL_frame%d_slot%d_sym%d_port%d_rx%d.m", nr_frame_rx, nr_slot_rx, m, nl, aarx);
|
sprintf(filename,"PDSCH_CHANNEL_frame%d_slot%d_sym%d_port%d_rx%d.m", frame_rx, nr_slot_rx, m, nl, aarx);
|
||||||
int **dl_ch_estimates = ue->pdsch_vars[gNB_id]->dl_ch_estimates;
|
int **dl_ch_estimates = ue->pdsch_vars[gNB_id]->dl_ch_estimates;
|
||||||
LOG_M(filename,"channel_F",&dl_ch_estimates[nl*ue->frame_parms.nb_antennas_rx+aarx][ue->frame_parms.ofdm_symbol_size*m],ue->frame_parms.ofdm_symbol_size, 1, 1);
|
LOG_M(filename,"channel_F",&dl_ch_estimates[nl*ue->frame_parms.nb_antennas_rx+aarx][ue->frame_parms.ofdm_symbol_size*m],ue->frame_parms.ofdm_symbol_size, 1, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user