Commit af42c109 authored by Florian Kaltenberger's avatar Florian Kaltenberger

added visualization of PDCCH channel estimate to phy_scope_UE.

parent 7cb58c9a
...@@ -498,10 +498,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -498,10 +498,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
float **rxsig_t_dB; float **rxsig_t_dB;
float *time; float *time;
float *corr; float *corr;
/*
int16_t **chest_t; int16_t **chest_t;
int16_t **chest_f; int16_t **chest_f;
*/
int16_t *pdsch_llr; int16_t *pdsch_llr;
int16_t *pdsch_comp; int16_t *pdsch_comp;
//int16_t *pdsch_mag; //int16_t *pdsch_mag;
...@@ -519,10 +517,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -519,10 +517,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
int coded_bits_per_codeword = num_re*Qm; int coded_bits_per_codeword = num_re*Qm;
int symbol, first_symbol,nb_re; int symbol, first_symbol,nb_re;
int nb_rb_pdsch =50; int nb_rb_pdsch =50;
float ymax=1;
float **chest_t_abs;
float Re,Im;
float *chest_f_abs;
float *freq;
static int overlay = 0;
/* /*
float Re,Im,ymax=1;
float **chest_t_abs, *chest_f_abs;
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
int frame = phy_vars_ue->proc.proc_rxtx[0].frame_rx; int frame = phy_vars_ue->proc.proc_rxtx[0].frame_rx;
int mcs = 0; int mcs = 0;
unsigned char harq_pid = 0; unsigned char harq_pid = 0;
...@@ -565,15 +566,15 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -565,15 +566,15 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
*/ */
I = (float*) calloc(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_slot*2,sizeof(float)); I = (float*) calloc(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_slot*2,sizeof(float));
Q = (float*) calloc(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_slot*2,sizeof(float)); Q = (float*) calloc(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_slot*2,sizeof(float));
/*
chest_t_abs = (float**) malloc(nb_antennas_rx*sizeof(float*)); chest_t_abs = (float**) malloc(nb_antennas_rx*sizeof(float*));
for (arx=0; arx<nb_antennas_rx; arx++) { for (arx=0; arx<nb_antennas_rx; arx++) {
chest_t_abs[arx] = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float)); chest_t_abs[arx] = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
} }
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float)); chest_f_abs = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
*/ freq = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // init to zero llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // init to zero
bit = malloc(coded_bits_per_codeword*sizeof(float)); bit = malloc(coded_bits_per_codeword*sizeof(float));
...@@ -589,10 +590,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -589,10 +590,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
time = calloc(samples_per_frame,sizeof(float)); time = calloc(samples_per_frame,sizeof(float));
corr = calloc(samples_per_frame,sizeof(float)); corr = calloc(samples_per_frame,sizeof(float));
/*
chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id]; chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id];
chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id]; chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id];
*/
pbch_llr = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->llr; pbch_llr = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->llr;
pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]; pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0];
...@@ -639,18 +639,26 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -639,18 +639,26 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data(form->chest_t,time,corr,samples_per_frame,"","",""); fl_set_xyplot_data(form->chest_t,time,corr,samples_per_frame,"","","");
else else
fl_add_xyplot_overlay(form->chest_t,ind,time,corr,samples_per_frame,rx_antenna_colors[ind]); fl_add_xyplot_overlay(form->chest_t,ind,time,corr,samples_per_frame,rx_antenna_colors[ind]);
overlay = 1;
} }
} }
} }
else {
/* if (overlay) { //there was a previous overlay
// Channel Impulse Response (still repeated format) fl_clear_xyplot(form->chest_t);
overlay = 0;
}
// Channel Impulse Response
if (chest_t != NULL) { if (chest_t != NULL) {
ymax = 0; ymax = 0;
if (chest_t[0] !=NULL) { if (chest_t[0] !=NULL) {
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) { for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
chest_t_abs[0][i] = (float) (chest_t[0][4*i]*chest_t[0][4*i]+chest_t[0][4*i+1]*chest_t[0][4*i+1]); chest_t_abs[0][i] = (float) (chest_t[0][2*i]*chest_t[0][2*i]+chest_t[0][2*i+1]*chest_t[0][2*i+1]);
time[i] = (float) i;
if (chest_t_abs[0][i] > ymax) if (chest_t_abs[0][i] > ymax)
ymax = chest_t_abs[0][i]; ymax = chest_t_abs[0][i];
...@@ -658,7 +666,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -658,7 +666,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data(form->chest_t,time,chest_t_abs[0],(frame_parms->ofdm_symbol_size>>3),"","",""); fl_set_xyplot_data(form->chest_t,time,chest_t_abs[0],(frame_parms->ofdm_symbol_size>>3),"","","");
} }
/*
for (arx=1; arx<nb_antennas_rx; arx++) { for (arx=1; arx<nb_antennas_rx; arx++) {
if (chest_t[arx] !=NULL) { if (chest_t[arx] !=NULL) {
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) { for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
...@@ -672,11 +680,12 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -672,11 +680,12 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_overlay_type(form->chest_t,arx,FL_DASHED_XYPLOT); fl_set_xyplot_overlay_type(form->chest_t,arx,FL_DASHED_XYPLOT);
} }
} }
*/
// Avoid flickering effect // Avoid flickering effect
// fl_get_xyplot_ybounds(form->chest_t,&ymin,&ymax); // Does not always work... // fl_get_xyplot_ybounds(form->chest_t,&ymin,&ymax); // Does not always work...
fl_set_xyplot_ybounds(form->chest_t,0,(double) ymax); fl_set_xyplot_ybounds(form->chest_t,0,(double) ymax);
} }
}
// Channel Frequency Response (includes 5 complex sample for filter) // Channel Frequency Response (includes 5 complex sample for filter)
if (chest_f != NULL) { if (chest_f != NULL) {
...@@ -685,7 +694,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -685,7 +694,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
for (atx=0; atx<nb_antennas_tx; atx++) { for (atx=0; atx<nb_antennas_tx; atx++) {
for (arx=0; arx<nb_antennas_rx; arx++) { for (arx=0; arx<nb_antennas_rx; arx++) {
if (chest_f[(atx<<1)+arx] != NULL) { if (chest_f[(atx<<1)+arx] != NULL) {
for (k=0; k<nsymb_ce; k++) { for (k=0; k<frame_parms->ofdm_symbol_size; k++) {
freq[ind] = (float)ind; freq[ind] = (float)ind;
Re = (float)(chest_f[(atx<<1)+arx][(2*k)]); Re = (float)(chest_f[(atx<<1)+arx][(2*k)]);
Im = (float)(chest_f[(atx<<1)+arx][(2*k)+1]); Im = (float)(chest_f[(atx<<1)+arx][(2*k)+1]);
...@@ -698,12 +707,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -698,12 +707,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
} }
// tx antenna 0 // tx antenna 0
fl_set_xyplot_xbounds(form->chest_f,0,nb_antennas_rx*nb_antennas_tx*nsymb_ce); //fl_set_xyplot_xbounds(form->chest_f,0,nb_antennas_rx*nb_antennas_tx*nsymb_ce);
//fl_set_xyplot_xtics(form->chest_f,nb_antennas_rx*nb_antennas_tx*frame_parms->symbols_per_tti,2); //fl_set_xyplot_xtics(form->chest_f,nb_antennas_rx*nb_antennas_tx*frame_parms->symbols_per_tti,2);
// fl_set_xyplot_xtics(form->chest_f,nb_antennas_rx*nb_antennas_tx*2,2); // fl_set_xyplot_xtics(form->chest_f,nb_antennas_rx*nb_antennas_tx*2,2);
fl_set_xyplot_xgrid(form->chest_f,FL_GRID_MAJOR); //fl_set_xyplot_xgrid(form->chest_f,FL_GRID_MAJOR);
fl_set_xyplot_data(form->chest_f,freq,chest_f_abs,nsymb_ce,"","",""); fl_set_xyplot_data(form->chest_f,freq,chest_f_abs,frame_parms->ofdm_symbol_size,"","","");
/*
for (arx=1; arx<nb_antennas_rx; arx++) { for (arx=1; arx<nb_antennas_rx; arx++) {
fl_add_xyplot_overlay(form->chest_f,1,&freq[arx*nsymb_ce],&chest_f_abs[arx*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]); fl_add_xyplot_overlay(form->chest_f,1,&freq[arx*nsymb_ce],&chest_f_abs[arx*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]);
} }
...@@ -722,8 +732,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -722,8 +732,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_add_xyplot_overlay(form->chest_f,atx,&freq[atx*nsymb_ce],&chest_f_abs[atx*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]); fl_add_xyplot_overlay(form->chest_f,atx,&freq[atx*nsymb_ce],&chest_f_abs[atx*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]);
} }
} }
}
*/ */
}
// PBCH LLRs // PBCH LLRs
if (pbch_llr != NULL) { if (pbch_llr != NULL) {
...@@ -735,9 +745,6 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -735,9 +745,6 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
fl_set_xyplot_data(form->pbch_llr,bit_pbch,llr_pbch,864,"","",""); fl_set_xyplot_data(form->pbch_llr,bit_pbch,llr_pbch,864,"","","");
} }
if (phy_vars_ue->is_synchronized==1)
first_symbol=5;
else
first_symbol=1; first_symbol=1;
// PBCH I/Q of MF Output // PBCH I/Q of MF Output
......
...@@ -602,7 +602,7 @@ static void *UE_thread_synch(void *arg) { ...@@ -602,7 +602,7 @@ static void *UE_thread_synch(void *arg) {
phy_scope_UE(form_ue[0], phy_scope_UE(form_ue[0],
PHY_vars_UE_g[0][0], PHY_vars_UE_g[0][0],
0,0,7); 0,0,1);
} }
#endif #endif
......
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