diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index 342c2e8cb2..6629a1efd6 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -188,10 +188,10 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g w = new_xy_plot(g, 490, 200, "", 50); e->ul_freq_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, 0, 100*10, -10, 80); + xy_plot_set_range(g, w, 0, 2048, -10, 80); l = new_framelog(h, database, "GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE", "subframe", "chest_t"); framelog_set_update_only_at_sf9(l, 0); - v = new_view_xy(100*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); + v = new_view_xy(2048, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(l, v); e->ul_freq_estimate_ue_logger = l; @@ -199,10 +199,10 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g w = new_xy_plot(g, 490, 200, "", 50); e->ul_time_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, 0, 100*10, -10, 80); + xy_plot_set_range(g, w, 0, 2048, -10, 80); l = new_framelog(h, database, "GNB_PHY_UL_TIME_CHANNEL_ESTIMATE", "subframe", "chest_t"); framelog_set_update_only_at_sf9(l, 0); - v = new_view_xy(100*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); + v = new_view_xy(2048, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(l, v); e->ul_time_estimate_ue_logger = l; diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 89b76f9131..2c51e3f7a8 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -203,11 +203,13 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_estimated_channel_freq = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_estimated_channel_time = (int32_t **)malloc16(Prx*sizeof(int32_t*)); + gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted = (int32_t **)malloc16(Prx*sizeof(int32_t*)); for (i=0;inr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); } } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 2bd6922302..1219365493 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -330,11 +330,13 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->nr_srs_info->srs_ls_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_estimated_channel_freq = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_estimated_channel_time = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->nr_srs_info->srs_estimated_channel_time_shifted = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); for (i=0; inb_antennas_rx; i++) { ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_estimated_channel_time[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); } if (abstraction_flag == 0) { diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 90d385f50b..1c6e8a54b8 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1093,6 +1093,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t **srs_received_signal, int32_t **srs_estimated_channel_freq, int32_t **srs_estimated_channel_time, + int32_t **srs_estimated_channel_time_shifted, uint32_t *noise_power) { if(nr_srs_info->n_symbs==0) { @@ -1114,6 +1115,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); memset(srs_estimated_channel_freq[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); memset(srs_estimated_channel_time[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + memset(srs_estimated_channel_time_shifted[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[0]]; @@ -1201,6 +1203,14 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, freq2time(gNB->frame_parms.ofdm_symbol_size, (int16_t*) srs_estimated_channel_freq[ant], (int16_t*) srs_estimated_channel_time[ant]); + + memcpy(&srs_estimated_channel_time_shifted[ant][0], + &srs_estimated_channel_time[ant][gNB->frame_parms.ofdm_symbol_size>>1], + (gNB->frame_parms.ofdm_symbol_size>>1)*sizeof(int32_t)); + + memcpy(&srs_estimated_channel_time_shifted[ant][gNB->frame_parms.ofdm_symbol_size>>1], + &srs_estimated_channel_time[ant][0], + (gNB->frame_parms.ofdm_symbol_size>>1)*sizeof(int32_t)); } *noise_power = calc_power(noise_real,frame_parms->nb_antennas_rx*nr_srs_info->n_symbs) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h index bfb1627c0d..a01106adb5 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h @@ -72,5 +72,6 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t **srs_received_signal, int32_t **srs_estimated_channel_freq, int32_t **srs_estimated_channel_time, + int32_t **srs_estimated_channel_time_shifted, uint32_t *noise_power); #endif diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 1fe442b7f5..9d0efd5c6d 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -249,6 +249,7 @@ typedef struct { int32_t **srs_ls_estimated_channel; int32_t **srs_estimated_channel_freq; int32_t **srs_estimated_channel_time; + int32_t **srs_estimated_channel_time_shifted; uint32_t *noise_power; } nr_srs_info_t; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index ad998ac505..cc21dcd09e 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -811,13 +811,14 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->nr_srs_info[i]->srs_received_signal, gNB->nr_srs_info[i]->srs_estimated_channel_freq, gNB->nr_srs_info[i]->srs_estimated_channel_time, + gNB->nr_srs_info[i]->srs_estimated_channel_time_shifted, gNB->nr_srs_info[i]->noise_power); - T(T_GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0), - T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0], 100 * 4)); + T(T_GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(0), T_INT(0), + T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t))); - T(T_GNB_PHY_UL_TIME_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0), - T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_time[0], 100 * 4)); + T(T_GNB_PHY_UL_TIME_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(0), T_INT(0), + T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_time_shifted[0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t))); srs->active = 0; }