Change variable name
This commit is contained in:
@@ -91,7 +91,7 @@ static void set_current_ue(gui *g, gnb_data *e, int ue)
|
|||||||
sprintf(s, "GNB_PHY_PUCCH_PUSCH_IQ [UE %d]", ue);
|
sprintf(s, "GNB_PHY_PUCCH_PUSCH_IQ [UE %d]", ue);
|
||||||
xy_plot_set_title(g, e->e->pucch_pusch_iq_plot, s);
|
xy_plot_set_title(g, e->e->pucch_pusch_iq_plot, s);
|
||||||
|
|
||||||
sprintf(s, "UL estimated channel [UE %d]", ue);
|
sprintf(s, "UL channel estimation in frequency domain [UE %d]", ue);
|
||||||
xy_plot_set_title(g, e->e->ul_estimate_ue_xy_plot, s);
|
xy_plot_set_title(g, e->e->ul_estimate_ue_xy_plot, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -201,11 +201,11 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
|||||||
gNB->nr_srs_info[id]->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
|
gNB->nr_srs_info[id]->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
|
||||||
gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||||
gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||||
gNB->nr_srs_info[id]->srs_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*));
|
||||||
for (i=0;i<Prx;i++){
|
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_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_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t));
|
||||||
gNB->nr_srs_info[id]->srs_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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -328,11 +328,11 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
|||||||
ue->nr_srs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
|
ue->nr_srs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
|
||||||
ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||||
ue->nr_srs_info->srs_ls_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
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 = (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 *) );
|
||||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
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_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_ls_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
|
||||||
ue->nr_srs_info->srs_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) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
|
|||||||
@@ -1110,7 +1110,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
nr_srs_info_t *nr_srs_info,
|
nr_srs_info_t *nr_srs_info,
|
||||||
int32_t *srs_generated_signal,
|
int32_t *srs_generated_signal,
|
||||||
int32_t **srs_received_signal,
|
int32_t **srs_received_signal,
|
||||||
int32_t **srs_estimated_channel,
|
int32_t **srs_estimated_channel_freq,
|
||||||
uint32_t *noise_power) {
|
uint32_t *noise_power) {
|
||||||
|
|
||||||
if(nr_srs_info->n_symbs==0) {
|
if(nr_srs_info->n_symbs==0) {
|
||||||
@@ -1130,9 +1130,9 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) {
|
for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) {
|
||||||
|
|
||||||
memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t));
|
memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t));
|
||||||
memset(srs_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));
|
||||||
|
|
||||||
int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[0]];
|
int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[0]];
|
||||||
|
|
||||||
for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) {
|
for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) {
|
||||||
|
|
||||||
@@ -1160,38 +1160,38 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
if(sc_idx == 0) {
|
if(sc_idx == 0) {
|
||||||
multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8);
|
multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8);
|
||||||
} else if(nr_srs_info->subcarrier_idx[sc_idx]<nr_srs_info->subcarrier_idx[sc_idx-1]) {
|
} else if(nr_srs_info->subcarrier_idx[sc_idx]<nr_srs_info->subcarrier_idx[sc_idx-1]) {
|
||||||
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx+2]] - 8;
|
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx+2]] - 8;
|
||||||
multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8);
|
multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8);
|
||||||
} else if( (sc_idx < (nr_srs_info->n_symbs-1) && nr_srs_info->subcarrier_idx[sc_idx+1]<nr_srs_info->subcarrier_idx[sc_idx]) || (sc_idx == (nr_srs_info->n_symbs-1))) {
|
} else if( (sc_idx < (nr_srs_info->n_symbs-1) && nr_srs_info->subcarrier_idx[sc_idx+1]<nr_srs_info->subcarrier_idx[sc_idx]) || (sc_idx == (nr_srs_info->n_symbs-1))) {
|
||||||
multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8);
|
multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8);
|
||||||
srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
||||||
} else if(sc_idx%2 == 1) {
|
} else if(sc_idx%2 == 1) {
|
||||||
multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8);
|
multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8);
|
||||||
} else if(sc_idx%2 == 0) {
|
} else if(sc_idx%2 == 0) {
|
||||||
multadd_real_vector_complex_scalar(filt8_mm0, ls_estimated, srs_estimated_channel16, 8);
|
multadd_real_vector_complex_scalar(filt8_mm0, ls_estimated, srs_estimated_channel16, 8);
|
||||||
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(sc_idx>0) {
|
if(sc_idx>0) {
|
||||||
multadd_real_vector_complex_scalar(filt8_dcr0_h, ls_estimated, srs_estimated_channel16, 8);
|
multadd_real_vector_complex_scalar(filt8_dcr0_h, ls_estimated, srs_estimated_channel16, 8);
|
||||||
if(nr_srs_info->subcarrier_idx[sc_idx]<nr_srs_info->subcarrier_idx[sc_idx-1]) {
|
if(nr_srs_info->subcarrier_idx[sc_idx]<nr_srs_info->subcarrier_idx[sc_idx-1]) {
|
||||||
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx+1]] - 8;
|
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx+1]] - 8;
|
||||||
} else {
|
} else {
|
||||||
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
||||||
}
|
}
|
||||||
srs_estimated_channel16[0] = 0;
|
srs_estimated_channel16[0] = 0;
|
||||||
srs_estimated_channel16[1] = 0;
|
srs_estimated_channel16[1] = 0;
|
||||||
}
|
}
|
||||||
multadd_real_vector_complex_scalar(filt8_dcl0_h, ls_estimated, srs_estimated_channel16, 8);
|
multadd_real_vector_complex_scalar(filt8_dcl0_h, ls_estimated, srs_estimated_channel16, 8);
|
||||||
if(sc_idx == (nr_srs_info->n_symbs-1)) {
|
if(sc_idx == (nr_srs_info->n_symbs-1)) {
|
||||||
srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
||||||
srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+2] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+2] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
||||||
srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+3] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+3] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
noise_real[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF));
|
noise_real[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF));
|
||||||
noise_imag[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF));
|
noise_imag[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF));
|
||||||
|
|
||||||
#ifdef SRS_DEBUG
|
#ifdef SRS_DEBUG
|
||||||
uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12;
|
uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12;
|
||||||
@@ -1239,8 +1239,8 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
subcarrier_log+r,
|
subcarrier_log+r,
|
||||||
(int16_t)(srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]&0xFFFF),
|
(int16_t)(srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]&0xFFFF),
|
||||||
(int16_t)((srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF),
|
(int16_t)((srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF),
|
||||||
(int16_t)(srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]&0xFFFF),
|
(int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]&0xFFFF),
|
||||||
(int16_t)((srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF),
|
(int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF),
|
||||||
noise_real[ant*nr_srs_info->n_symbs+sc_idx],
|
noise_real[ant*nr_srs_info->n_symbs+sc_idx],
|
||||||
noise_imag[ant*nr_srs_info->n_symbs+sc_idx]);
|
noise_imag[ant*nr_srs_info->n_symbs+sc_idx]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,6 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
nr_srs_info_t *nr_srs_info,
|
nr_srs_info_t *nr_srs_info,
|
||||||
int32_t *srs_generated_signal,
|
int32_t *srs_generated_signal,
|
||||||
int32_t **srs_received_signal,
|
int32_t **srs_received_signal,
|
||||||
int32_t **srs_estimated_channel,
|
int32_t **srs_estimated_channel_freq,
|
||||||
uint32_t *noise_power);
|
uint32_t *noise_power);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ typedef struct {
|
|||||||
int32_t *srs_generated_signal;
|
int32_t *srs_generated_signal;
|
||||||
int32_t **srs_received_signal;
|
int32_t **srs_received_signal;
|
||||||
int32_t **srs_ls_estimated_channel;
|
int32_t **srs_ls_estimated_channel;
|
||||||
int32_t **srs_estimated_channel;
|
int32_t **srs_estimated_channel_freq;
|
||||||
uint32_t *noise_power;
|
uint32_t *noise_power;
|
||||||
} nr_srs_info_t;
|
} nr_srs_info_t;
|
||||||
|
|
||||||
|
|||||||
@@ -809,11 +809,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
|||||||
gNB->nr_srs_info[i],
|
gNB->nr_srs_info[i],
|
||||||
gNB->nr_srs_info[i]->srs_generated_signal,
|
gNB->nr_srs_info[i]->srs_generated_signal,
|
||||||
gNB->nr_srs_info[i]->srs_received_signal,
|
gNB->nr_srs_info[i]->srs_received_signal,
|
||||||
gNB->nr_srs_info[i]->srs_estimated_channel,
|
gNB->nr_srs_info[i]->srs_estimated_channel_freq,
|
||||||
gNB->nr_srs_info[i]->noise_power);
|
gNB->nr_srs_info[i]->noise_power);
|
||||||
|
|
||||||
T(T_GNB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0),
|
T(T_GNB_PHY_UL_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[0], 100 * 4));
|
T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0], 100 * 4));
|
||||||
|
|
||||||
srs->active = 0;
|
srs->active = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user