Commit d2c6d665 authored by rmagueta's avatar rmagueta

SRS Tracer improvements

parent 8aac9606
......@@ -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;
......
......@@ -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;i<Prx;i++){
gNB->nr_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));
}
}
......
......@@ -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; i<fp->nb_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) {
......
......@@ -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)
......
......@@ -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
......@@ -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;
......
......@@ -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;
}
......
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