Commit f5022585 authored by Laurent THOMAS's avatar Laurent THOMAS

format astyle only

parent 68a81f65
...@@ -184,8 +184,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -184,8 +184,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
chest_f_abs = (float *) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float)); chest_f_abs = (float *) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,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));
rxsig_t = (int16_t **) phy_vars_enb->RU_list[0]->common.rxdata;
rxsig_t = (int16_t**) phy_vars_enb->RU_list[0]->common.rxdata;
chest_t = (int16_t **) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates; chest_t = (int16_t **) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates;
chest_f = (int16_t **) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates; chest_f = (int16_t **) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates;
pusch_llr = (int16_t *) phy_vars_enb->pusch_vars[UE_id]->llr; pusch_llr = (int16_t *) phy_vars_enb->pusch_vars[UE_id]->llr;
......
...@@ -32,8 +32,7 @@ float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; ...@@ -32,8 +32,7 @@ float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_ue_max[NUMBER_OF_UE_MAX] = {0}; float tput_ue_max[NUMBER_OF_UE_MAX] = {0};
static void ia_receiver_on_off( FL_OBJECT *button, long arg) static void ia_receiver_on_off( FL_OBJECT *button, long arg) {
{
if (fl_get_button(button)) { if (fl_get_button(button)) {
fl_set_object_label(button, "IA Receiver ON"); fl_set_object_label(button, "IA Receiver ON");
// PHY_vars_UE_g[0][0]->use_ia_receiver = 1; // PHY_vars_UE_g[0][0]->use_ia_receiver = 1;
...@@ -45,8 +44,7 @@ static void ia_receiver_on_off( FL_OBJECT *button, long arg) ...@@ -45,8 +44,7 @@ static void ia_receiver_on_off( FL_OBJECT *button, long arg)
} }
} }
static void dl_traffic_on_off( FL_OBJECT *button, long arg) static void dl_traffic_on_off( FL_OBJECT *button, long arg) {
{
if (fl_get_button(button)) { if (fl_get_button(button)) {
fl_set_object_label(button, "DL Traffic ON"); fl_set_object_label(button, "DL Traffic ON");
otg_enabled = 1; otg_enabled = 1;
...@@ -58,9 +56,7 @@ static void dl_traffic_on_off( FL_OBJECT *button, long arg) ...@@ -58,9 +56,7 @@ static void dl_traffic_on_off( FL_OBJECT *button, long arg)
} }
} }
static void sic_receiver_on_off( FL_OBJECT *button, long arg) static void sic_receiver_on_off( FL_OBJECT *button, long arg) {
{
if (fl_get_button(button)) { if (fl_get_button(button)) {
fl_set_object_label(button, "SIC Receiver ON"); fl_set_object_label(button, "SIC Receiver ON");
use_sic_receiver = 1; use_sic_receiver = 1;
...@@ -72,8 +68,7 @@ static void sic_receiver_on_off( FL_OBJECT *button, long arg) ...@@ -72,8 +68,7 @@ static void sic_receiver_on_off( FL_OBJECT *button, long arg)
} }
} }
FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) {
{
FL_OBJECT *obj; FL_OBJECT *obj;
FD_lte_phy_scope_enb *fdui = fl_malloc( sizeof *fdui ); FD_lte_phy_scope_enb *fdui = fl_malloc( sizeof *fdui );
// Define form // Define form
...@@ -145,8 +140,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) ...@@ -145,8 +140,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
void phy_scope_eNB(FD_lte_phy_scope_enb *form, void phy_scope_eNB(FD_lte_phy_scope_enb *form,
PHY_VARS_eNB *phy_vars_enb, PHY_VARS_eNB *phy_vars_enb,
int UE_id) int UE_id) {
{
int eNB_id = 0; int eNB_id = 0;
int i,i2,arx,atx,ind,k; int i,i2,arx,atx,ind,k;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->frame_parms;
...@@ -176,24 +170,27 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -176,24 +170,27 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
int coded_bits_per_codeword = 0; int coded_bits_per_codeword = 0;
uint8_t harq_pid; // in TDD config 3 it is sf-2, i.e., can be 0,1,2 uint8_t harq_pid; // in TDD config 3 it is sf-2, i.e., can be 0,1,2
int mcs = 0; int mcs = 0;
// choose max MCS to compute coded_bits_per_codeword // choose max MCS to compute coded_bits_per_codeword
if (phy_vars_enb->ulsch[UE_id]!=NULL) { if (phy_vars_enb->ulsch[UE_id]!=NULL) {
for (harq_pid=0; harq_pid<3; harq_pid++) { for (harq_pid=0; harq_pid<3; harq_pid++) {
mcs = cmax(phy_vars_enb->ulsch[UE_id]->harq_processes[harq_pid]->mcs,mcs); mcs = cmax(phy_vars_enb->ulsch[UE_id]->harq_processes[harq_pid]->mcs,mcs);
} }
} }
coded_bits_per_codeword = frame_parms->N_RB_UL*12*get_Qm(mcs)*frame_parms->symbols_per_tti; coded_bits_per_codeword = frame_parms->N_RB_UL*12*get_Qm(mcs)*frame_parms->symbols_per_tti;
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float)); chest_f_abs = (float *) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,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));
rxsig_t = (int16_t**) phy_vars_enb->common_vars.rxdata[eNB_id]; rxsig_t = (int16_t **) phy_vars_enb->common_vars.rxdata[eNB_id];
chest_t = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id]; chest_t = (int16_t **) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id];
chest_f = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates[eNB_id]; chest_f = (int16_t **) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates[eNB_id];
pusch_llr = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->llr; pusch_llr = (int16_t *) phy_vars_enb->pusch_vars[UE_id]->llr;
pusch_comp = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[eNB_id][0]; pusch_comp = (int16_t *) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[eNB_id][0];
pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id]; pucch1_comp = (int32_t *) phy_vars_enb->pucch1_stats[UE_id];
pucch1_thres = (int32_t*) phy_vars_enb->pucch1_stats_thres[UE_id]; pucch1_thres = (int32_t *) phy_vars_enb->pucch1_stats_thres[UE_id];
pucch1ab_comp = (int32_t*) phy_vars_enb->pucch1ab_stats[UE_id]; pucch1ab_comp = (int32_t *) phy_vars_enb->pucch1ab_stats[UE_id];
// Received signal in time domain of receive antenna 0 // Received signal in time domain of receive antenna 0
if (rxsig_t != NULL) { if (rxsig_t != NULL) {
if (rxsig_t[0] != NULL) { if (rxsig_t[0] != NULL) {
...@@ -201,48 +198,61 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -201,48 +198,61 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
rxsig_t_dB[0][i] = 10*log10(1.0+(float) ((rxsig_t[0][2*i])*(rxsig_t[0][2*i])+(rxsig_t[0][2*i+1])*(rxsig_t[0][2*i+1]))); rxsig_t_dB[0][i] = 10*log10(1.0+(float) ((rxsig_t[0][2*i])*(rxsig_t[0][2*i])+(rxsig_t[0][2*i+1])*(rxsig_t[0][2*i+1])));
time[i] = (float) i; time[i] = (float) i;
} }
fl_set_xyplot_data(form->rxsig_t,time,rxsig_t_dB[0],FRAME_LENGTH_COMPLEX_SAMPLES,"","",""); fl_set_xyplot_data(form->rxsig_t,time,rxsig_t_dB[0],FRAME_LENGTH_COMPLEX_SAMPLES,"","","");
} }
for (arx=1; arx<nb_antennas_rx; arx++) { for (arx=1; arx<nb_antennas_rx; arx++) {
if (rxsig_t[arx] != NULL) { if (rxsig_t[arx] != NULL) {
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) { for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
rxsig_t_dB[arx][i] = 10*log10(1.0+(float) ((rxsig_t[arx][2*i])*(rxsig_t[arx][2*i])+(rxsig_t[arx][2*i+1])*(rxsig_t[arx][2*i+1]))); rxsig_t_dB[arx][i] = 10*log10(1.0+(float) ((rxsig_t[arx][2*i])*(rxsig_t[arx][2*i])+(rxsig_t[arx][2*i+1])*(rxsig_t[arx][2*i+1])));
} }
fl_add_xyplot_overlay(form->rxsig_t,arx,time,rxsig_t_dB[arx],FRAME_LENGTH_COMPLEX_SAMPLES,rx_antenna_colors[arx]); fl_add_xyplot_overlay(form->rxsig_t,arx,time,rxsig_t_dB[arx],FRAME_LENGTH_COMPLEX_SAMPLES,rx_antenna_colors[arx]);
} }
} }
} }
// Channel Impulse Response // 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); i++) { for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size; i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1)); time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1])); chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
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];
} }
fl_set_xyplot_data(form->chest_t,time2,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","",""); fl_set_xyplot_data(form->chest_t,time2,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
} }
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++) {
chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1])); chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
if (chest_t_abs[arx][i] > ymax) if (chest_t_abs[arx][i] > ymax)
ymax = chest_t_abs[arx][i]; ymax = chest_t_abs[arx][i];
} }
fl_add_xyplot_overlay(form->chest_t,arx,time,chest_t_abs[arx],(frame_parms->ofdm_symbol_size>>3),rx_antenna_colors[arx]); fl_add_xyplot_overlay(form->chest_t,arx,time,chest_t_abs[arx],(frame_parms->ofdm_symbol_size>>3),rx_antenna_colors[arx]);
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); // fl_get_xyplot_ybounds(form->chest_t,&ymin,&ymax);
fl_set_xyplot_ybounds(form->chest_t,0,ymax); fl_set_xyplot_ybounds(form->chest_t,0,ymax);
} }
// Channel Frequency Response // Channel Frequency Response
if (chest_f != NULL) { if (chest_f != NULL) {
ind = 0; ind = 0;
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) {
...@@ -256,14 +266,17 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -256,14 +266,17 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *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,3); fl_set_xyplot_xtics(form->chest_f,nb_antennas_rx*nb_antennas_tx*frame_parms->symbols_per_tti,3);
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,nsymb_ce,"","","");
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]);
} }
// other tx antennas // other tx antennas
if (nb_antennas_tx > 1) { if (nb_antennas_tx > 1) {
if (nb_antennas_rx > 1) { if (nb_antennas_rx > 1) {
...@@ -279,17 +292,21 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -279,17 +292,21 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
} }
} }
} }
// PUSCH LLRs // PUSCH LLRs
if (pusch_llr != NULL) { if (pusch_llr != NULL) {
for (i=0; i<coded_bits_per_codeword; i++) { for (i=0; i<coded_bits_per_codeword; i++) {
llr[i] = (float) pusch_llr[i]; llr[i] = (float) pusch_llr[i];
bit[i] = (float) i; bit[i] = (float) i;
} }
fl_set_xyplot_data(form->pusch_llr,bit,llr,coded_bits_per_codeword,"","",""); fl_set_xyplot_data(form->pusch_llr,bit,llr,coded_bits_per_codeword,"","","");
} }
// PUSCH I/Q of MF Output // PUSCH I/Q of MF Output
if (pusch_comp!=NULL) { if (pusch_comp!=NULL) {
ind=0; ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_UL; i++) { for (i=0; i<12*frame_parms->N_RB_UL; i++) {
I[ind] = pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i]; I[ind] = pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i];
...@@ -297,8 +314,10 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -297,8 +314,10 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
ind++; ind++;
} }
} }
fl_set_xyplot_data(form->pusch_comp,I,Q,ind,"","",""); fl_set_xyplot_data(form->pusch_comp,I,Q,ind,"","","");
} }
// PUSCH I/Q of MF Output // PUSCH I/Q of MF Output
if (pucch1ab_comp!=NULL) { if (pucch1ab_comp!=NULL) {
for (ind=0; ind<10240; ind++) { for (ind=0; ind<10240; ind++) {
...@@ -308,6 +327,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -308,6 +327,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
B_pucch[ind] = ind; B_pucch[ind] = ind;
C_pucch[ind] = (float)pucch1_thres[ind]; C_pucch[ind] = (float)pucch1_thres[ind];
} }
fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","",""); fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","","");
fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","",""); fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","","");
fl_add_xyplot_overlay(form->pucch_comp1,1,B_pucch,C_pucch,1024,FL_RED); fl_add_xyplot_overlay(form->pucch_comp1,1,B_pucch,C_pucch,1024,FL_RED);
...@@ -315,6 +335,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -315,6 +335,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000); fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000);
fl_set_xyplot_ybounds(form->pucch_comp1,0,80); fl_set_xyplot_ybounds(form->pucch_comp1,0,80);
} }
// PUSCH Throughput // PUSCH Throughput
memmove( tput_time_enb[UE_id], &tput_time_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); memmove( tput_time_enb[UE_id], &tput_time_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memmove( tput_enb[UE_id], &tput_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) ); memmove( tput_enb[UE_id], &tput_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
...@@ -329,8 +350,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -329,8 +350,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
free(chest_f_abs); free(chest_f_abs);
} }
FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
{
FL_OBJECT *obj; FL_OBJECT *obj;
FD_lte_phy_scope_ue *fdui = fl_malloc( sizeof *fdui ); FD_lte_phy_scope_ue *fdui = fl_malloc( sizeof *fdui );
// Define form // Define form
...@@ -429,7 +449,6 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) ...@@ -429,7 +449,6 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
fl_set_object_color(fdui->button_0, FL_RED, FL_RED); fl_set_object_color(fdui->button_0, FL_RED, FL_RED);
fl_set_object_callback(fdui->button_0, sic_receiver_on_off, 0 ); fl_set_object_callback(fdui->button_0, sic_receiver_on_off, 0 );
fl_hide_object(fdui->button_0); fl_hide_object(fdui->button_0);
fl_end_form( ); fl_end_form( );
fdui->lte_phy_scope_ue->fdui = fdui; fdui->lte_phy_scope_ue->fdui = fdui;
return fdui; return fdui;
...@@ -439,8 +458,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -439,8 +458,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
PHY_VARS_UE *phy_vars_ue, PHY_VARS_UE *phy_vars_ue,
int eNB_id, int eNB_id,
int UE_id, int UE_id,
uint8_t subframe) uint8_t subframe) {
{
int i,arx,atx,ind,k; int i,arx,atx,ind,k;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms;
int nsymb_ce = frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti; int nsymb_ce = frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti;
...@@ -472,10 +490,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -472,10 +490,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
int mcs1=0; int mcs1=0;
unsigned char harq_pid = 0; unsigned char harq_pid = 0;
int beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0; int beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0;
if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) { if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) {
harq_pid = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->current_harq_pid; harq_pid = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->current_harq_pid;
if (harq_pid>=8) if (harq_pid>=8)
return; return;
mcs0 = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->mcs; mcs0 = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->harq_processes[harq_pid]->mcs;
// Button 0 // Button 0
/* /*
...@@ -485,16 +506,22 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -485,16 +506,22 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
} }
*/ */
} }
fl_show_object(form->button_0); fl_show_object(form->button_0);
if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]!=NULL) { if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]!=NULL) {
harq_pid = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->current_harq_pid; harq_pid = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->current_harq_pid;
if (harq_pid>=8) if (harq_pid>=8)
return; return;
mcs1 = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->mcs; mcs1 = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]->harq_processes[harq_pid]->mcs;
} }
if (phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]!=NULL) { if (phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]!=NULL) {
num_pdcch_symbols = phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->num_pdcch_symbols; num_pdcch_symbols = phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->num_pdcch_symbols;
} }
// coded_bits_per_codeword = frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); // coded_bits_per_codeword = frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) { if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) {
mod0 = get_Qm(mcs0); mod0 = get_Qm(mcs0);
...@@ -511,6 +538,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -511,6 +538,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
coded_bits_per_codeword0 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); coded_bits_per_codeword0 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
mod0=0; mod0=0;
} }
if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]!=NULL) { if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1]!=NULL) {
mod1 = get_Qm(mcs1); mod1 = get_Qm(mcs1);
coded_bits_per_codeword1 = get_G(frame_parms, coded_bits_per_codeword1 = get_G(frame_parms,
...@@ -526,43 +554,46 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -526,43 +554,46 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
coded_bits_per_codeword1 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti); coded_bits_per_codeword1 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
mod1=0; mod1=0;
} }
I = (float*) calloc(nsymb_ce*2,sizeof(float));
Q = (float*) calloc(nsymb_ce*2,sizeof(float)); I = (float *) calloc(nsymb_ce*2,sizeof(float));
chest_t_abs = (float**) malloc(nb_antennas_rx*sizeof(float*)); Q = (float *) calloc(nsymb_ce*2,sizeof(float));
for (arx=0;arx<nb_antennas_rx;arx++) { chest_t_abs = (float **) malloc(nb_antennas_rx*sizeof(float *));
chest_t_abs[arx] = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
for (arx=0; arx<nb_antennas_rx; arx++) {
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(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
//llr0 = (float*) calloc(coded_bits_per_codeword0,sizeof(float)); // Cppcheck returns "invalidFunctionArg" error. //llr0 = (float*) calloc(coded_bits_per_codeword0,sizeof(float)); // Cppcheck returns "invalidFunctionArg" error.
llr0 = (float*) malloc(coded_bits_per_codeword0*sizeof(float)); llr0 = (float *) malloc(coded_bits_per_codeword0*sizeof(float));
memset((void *)llr0, 0,coded_bits_per_codeword0*sizeof(float)); // init to zero memset((void *)llr0, 0,coded_bits_per_codeword0*sizeof(float)); // init to zero
bit0 = malloc(coded_bits_per_codeword0*sizeof(float)); bit0 = malloc(coded_bits_per_codeword0*sizeof(float));
//llr1 = (float*) calloc(coded_bits_per_codeword1,sizeof(float)); // Cppcheck returns "invalidFunctionArg" error. //llr1 = (float*) calloc(coded_bits_per_codeword1,sizeof(float)); // Cppcheck returns "invalidFunctionArg" error.
llr1 = (float*) malloc(coded_bits_per_codeword1*sizeof(float)); llr1 = (float *) malloc(coded_bits_per_codeword1*sizeof(float));
memset((void *)llr1, 0,coded_bits_per_codeword1*sizeof(float)); // init to zero memset((void *)llr1, 0,coded_bits_per_codeword1*sizeof(float)); // init to zero
bit1 = malloc(coded_bits_per_codeword1*sizeof(float)); bit1 = malloc(coded_bits_per_codeword1*sizeof(float));
llr_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero llr_pdcch = (float *) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero
bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); bit_pdcch = (float *) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata; rxsig_t = (int16_t **) phy_vars_ue->common_vars.rxdata;
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 = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr; pbch_llr = (int8_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];
pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr; pdcch_llr = (int8_t *) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr;
pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp[0]; pdcch_comp = (int16_t *) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp[0];
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[0]; // stream 0 pdsch_llr = (int16_t *) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[0]; // stream 0
pdsch_llr1 = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[1]; // stream 1 pdsch_llr1 = (int16_t *) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[1]; // stream 1
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0]; pdsch_comp = (int16_t *) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0];
//pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[0]; //pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[0];
//pdsch_comp1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[1]; //pdsch_comp1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[1];
pdsch_comp1 = (int16_t*) (phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp1[0][0])[0]; pdsch_comp1 = (int16_t *) (phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp1[0][0])[0];
//pdsch_comp1 = (int16_t*) (phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[0][0])[0]; //pdsch_comp1 = (int16_t*) (phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[0][0])[0];
pdsch_mag0 = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0]; pdsch_mag0 = (int16_t *) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0];
pdsch_mag1 = (int16_t*) (phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag1[0][0])[0]; pdsch_mag1 = (int16_t *) (phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag1[0][0])[0];
pdsch_magb0 = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb0[0]; pdsch_magb0 = (int16_t *) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb0[0];
pdsch_magb1 = (int16_t*) (phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb1[0][0])[0]; pdsch_magb1 = (int16_t *) (phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb1[0][0])[0];
fl_freeze_form(form->lte_phy_scope_ue); fl_freeze_form(form->lte_phy_scope_ue);
// Received signal in time domain of receive antenna 0 // Received signal in time domain of receive antenna 0
if (rxsig_t != NULL) { if (rxsig_t != NULL) {
if (rxsig_t[0] != NULL) { if (rxsig_t[0] != NULL) {
...@@ -570,48 +601,61 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -570,48 +601,61 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
rxsig_t_dB[0][i] = 10*log10(1.0+(float) ((rxsig_t[0][2*i])*(rxsig_t[0][2*i])+(rxsig_t[0][2*i+1])*(rxsig_t[0][2*i+1]))); rxsig_t_dB[0][i] = 10*log10(1.0+(float) ((rxsig_t[0][2*i])*(rxsig_t[0][2*i])+(rxsig_t[0][2*i+1])*(rxsig_t[0][2*i+1])));
time[i] = (float) i; time[i] = (float) i;
} }
fl_set_xyplot_data(form->rxsig_t,time,rxsig_t_dB[0],FRAME_LENGTH_COMPLEX_SAMPLES,"","",""); fl_set_xyplot_data(form->rxsig_t,time,rxsig_t_dB[0],FRAME_LENGTH_COMPLEX_SAMPLES,"","","");
} }
for (arx=1;arx<nb_antennas_rx;arx++) {
for (arx=1; arx<nb_antennas_rx; arx++) {
if (rxsig_t[arx] != NULL) { if (rxsig_t[arx] != NULL) {
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) { for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
rxsig_t_dB[arx][i] = 10*log10(1.0+(float) ((rxsig_t[arx][2*i])*(rxsig_t[arx][2*i])+(rxsig_t[arx][2*i+1])*(rxsig_t[arx][2*i+1]))); rxsig_t_dB[arx][i] = 10*log10(1.0+(float) ((rxsig_t[arx][2*i])*(rxsig_t[arx][2*i])+(rxsig_t[arx][2*i+1])*(rxsig_t[arx][2*i+1])));
} }
fl_add_xyplot_overlay(form->rxsig_t,arx,time,rxsig_t_dB[arx],FRAME_LENGTH_COMPLEX_SAMPLES,rx_antenna_colors[arx]); fl_add_xyplot_overlay(form->rxsig_t,arx,time,rxsig_t_dB[arx],FRAME_LENGTH_COMPLEX_SAMPLES,rx_antenna_colors[arx]);
} }
} }
} }
// Channel Impulse Response (still repeated format) // Channel Impulse Response (still repeated format)
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][4*i]*chest_t[0][4*i]+chest_t[0][4*i+1]*chest_t[0][4*i+1]);
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];
} }
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++) {
chest_t_abs[arx][i] = (float) (chest_t[arx][4*i]*chest_t[arx][4*i]+chest_t[arx][4*i+1]*chest_t[arx][4*i+1]); chest_t_abs[arx][i] = (float) (chest_t[arx][4*i]*chest_t[arx][4*i]+chest_t[arx][4*i+1]*chest_t[arx][4*i+1]);
if (chest_t_abs[arx][i] > ymax) if (chest_t_abs[arx][i] > ymax)
ymax = chest_t_abs[arx][i]; ymax = chest_t_abs[arx][i];
} }
fl_add_xyplot_overlay(form->chest_t,arx,time,chest_t_abs[arx],(frame_parms->ofdm_symbol_size>>3),rx_antenna_colors[arx]); fl_add_xyplot_overlay(form->chest_t,arx,time,chest_t_abs[arx],(frame_parms->ofdm_symbol_size>>3),rx_antenna_colors[arx]);
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); // fl_get_xyplot_ybounds(form->chest_t,&ymin,&ymax);
fl_set_xyplot_ybounds(form->chest_t,0,ymax); fl_set_xyplot_ybounds(form->chest_t,0,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) {
ind = 0; ind = 0;
for (atx=0;atx<nb_antennas_tx;atx++) {
for (arx=0;arx<nb_antennas_rx;arx++) { for (atx=0; atx<nb_antennas_tx; atx++) {
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<nsymb_ce; k++) {
freq[ind] = (float)ind; freq[ind] = (float)ind;
...@@ -623,29 +667,34 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -623,29 +667,34 @@ 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,nsymb_ce,"","","");
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]);
} }
// other tx antennas // other tx antennas
if (nb_antennas_tx > 1) { if (nb_antennas_tx > 1) {
if (nb_antennas_rx > 1) { if (nb_antennas_rx > 1) {
for (atx=1;atx<nb_antennas_tx;atx++) { for (atx=1; atx<nb_antennas_tx; atx++) {
for (arx=0;arx<nb_antennas_rx;arx++) { for (arx=0; arx<nb_antennas_rx; arx++) {
fl_add_xyplot_overlay(form->chest_f,(atx<<1)+arx,&freq[((atx<<1)+arx)*nsymb_ce],&chest_f_abs[((atx<<1)+arx)*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]); fl_add_xyplot_overlay(form->chest_f,(atx<<1)+arx,&freq[((atx<<1)+arx)*nsymb_ce],&chest_f_abs[((atx<<1)+arx)*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]);
} }
} }
} else { // 1 rx antenna } else { // 1 rx antenna
atx=1; arx=0; atx=1;
arx=0;
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) {
...@@ -687,12 +736,15 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -687,12 +736,15 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
llr0[i] = (float) pdsch_llr[i]; llr0[i] = (float) pdsch_llr[i];
bit0[i] = (float) i; bit0[i] = (float) i;
} }
fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword0); fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword0);
fl_set_xyplot_data(form->pdsch_llr,bit0,llr0,coded_bits_per_codeword0,"","",""); fl_set_xyplot_data(form->pdsch_llr,bit0,llr0,coded_bits_per_codeword0,"","","");
} }
// PDSCH I/Q of MF Output // PDSCH I/Q of MF Output
if (pdsch_comp!=NULL) { if (pdsch_comp!=NULL) {
ind=0; ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i]; I[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i];
...@@ -700,10 +752,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -700,10 +752,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
ind++; ind++;
} }
} }
fl_set_xyplot_data(form->pdsch_comp,I,Q,ind,"","",""); fl_set_xyplot_data(form->pdsch_comp,I,Q,ind,"","","");
} }
if (pdsch_mag0 != NULL) { if (pdsch_mag0 != NULL) {
ind=0; ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2)); I[ind] = pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
...@@ -711,10 +766,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -711,10 +766,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
ind++; ind++;
} }
} }
fl_add_xyplot_overlay(form->pdsch_comp,1,I,Q,ind,FL_GREEN); fl_add_xyplot_overlay(form->pdsch_comp,1,I,Q,ind,FL_GREEN);
} }
if (pdsch_magb0 != NULL) { if (pdsch_magb0 != NULL) {
ind=0; ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2)); I[ind] = pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
...@@ -722,10 +780,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -722,10 +780,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
ind++; ind++;
} }
} }
fl_add_xyplot_overlay(form->pdsch_comp,2,I,Q,ind,FL_RED); fl_add_xyplot_overlay(form->pdsch_comp,2,I,Q,ind,FL_RED);
} }
if ((pdsch_mag0 != NULL) && (pdsch_magb0 != NULL)) { if ((pdsch_mag0 != NULL) && (pdsch_magb0 != NULL)) {
ind=0; ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = I[ind] =
...@@ -739,20 +800,25 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -739,20 +800,25 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
ind++; ind++;
} }
} }
fl_add_xyplot_overlay(form->pdsch_comp,3,I,Q,ind,FL_BLUE); fl_add_xyplot_overlay(form->pdsch_comp,3,I,Q,ind,FL_BLUE);
} }
// PDSCH LLRs CW1 // PDSCH LLRs CW1
if (pdsch_llr1 != NULL) { if (pdsch_llr1 != NULL) {
for (i=0; i<coded_bits_per_codeword1; i++) { for (i=0; i<coded_bits_per_codeword1; i++) {
llr1[i] = (float) pdsch_llr1[i]; llr1[i] = (float) pdsch_llr1[i];
bit1[i] = (float) i; bit1[i] = (float) i;
} }
fl_set_xyplot_xbounds(form->pdsch_llr1,0,coded_bits_per_codeword1); fl_set_xyplot_xbounds(form->pdsch_llr1,0,coded_bits_per_codeword1);
fl_set_xyplot_data(form->pdsch_llr1,bit1,llr1,coded_bits_per_codeword1,"","",""); fl_set_xyplot_data(form->pdsch_llr1,bit1,llr1,coded_bits_per_codeword1,"","","");
} }
// PDSCH I/Q of MF Output // PDSCH I/Q of MF Output
if (pdsch_comp1!=NULL) { if (pdsch_comp1!=NULL) {
ind=0; ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_comp1[(2*frame_parms->N_RB_DL*12*k)+4*i]; I[ind] = pdsch_comp1[(2*frame_parms->N_RB_DL*12*k)+4*i];
...@@ -760,10 +826,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -760,10 +826,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
ind++; ind++;
} }
} }
fl_set_xyplot_data(form->pdsch_comp1,I,Q,ind,"","",""); fl_set_xyplot_data(form->pdsch_comp1,I,Q,ind,"","","");
} }
if (pdsch_mag1 != NULL) { if (pdsch_mag1 != NULL) {
ind=0; ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2)); I[ind] = pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
...@@ -771,10 +840,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -771,10 +840,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
ind++; ind++;
} }
} }
fl_add_xyplot_overlay(form->pdsch_comp1,1,I,Q,ind,FL_GREEN); fl_add_xyplot_overlay(form->pdsch_comp1,1,I,Q,ind,FL_GREEN);
} }
if (pdsch_magb1 != NULL) { if (pdsch_magb1 != NULL) {
ind=0; ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2)); I[ind] = pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
...@@ -782,10 +854,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -782,10 +854,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
ind++; ind++;
} }
} }
fl_add_xyplot_overlay(form->pdsch_comp1,2,I,Q,ind,FL_RED); fl_add_xyplot_overlay(form->pdsch_comp1,2,I,Q,ind,FL_RED);
} }
if ((pdsch_mag1 != NULL) && (pdsch_magb1 != NULL)) { if ((pdsch_mag1 != NULL) && (pdsch_magb1 != NULL)) {
ind=0; ind=0;
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = I[ind] =
...@@ -799,8 +874,10 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -799,8 +874,10 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
ind++; ind++;
} }
} }
fl_add_xyplot_overlay(form->pdsch_comp1,3,I,Q,ind,FL_BLUE); fl_add_xyplot_overlay(form->pdsch_comp1,3,I,Q,ind,FL_BLUE);
} }
/* /*
// PDSCH Throughput // PDSCH Throughput
memcpy((void*)tput_time_ue[UE_id],(void*)&tput_time_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float)); memcpy((void*)tput_time_ue[UE_id],(void*)&tput_time_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float));
...@@ -824,7 +901,6 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -824,7 +901,6 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
free(bit1); free(bit1);
free(bit_pdcch); free(bit_pdcch);
free(llr_pdcch); free(llr_pdcch);
//This is done to avoid plotting old data when TB0 is disabled, and TB1 is mapped onto CW0 //This is done to avoid plotting old data when TB0 is disabled, and TB1 is mapped onto CW0
/*if (phy_vars_ue->transmission_mode[eNB_id]==3 && phy_vars_ue->transmission_mode[eNB_id]==4){ /*if (phy_vars_ue->transmission_mode[eNB_id]==3 && phy_vars_ue->transmission_mode[eNB_id]==4){
for (int i = 0; i<8; ++i) for (int i = 0; i<8; ++i)
......
...@@ -227,6 +227,7 @@ static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int laye ...@@ -227,6 +227,7 @@ static void oai_xygraph(OAIgraph_t *graph, float *x, float *y, int len, int laye
static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const int datasize, const int divisions, const char *label) { static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const int datasize, const int divisions, const char *label) {
if ( values == NULL ) if ( values == NULL )
return; return;
fl_winset(FL_ObjWin(graph->graph)); fl_winset(FL_ObjWin(graph->graph));
const int samplesPerPixel=datasize/graph->w; const int samplesPerPixel=datasize/graph->w;
int displayPart=graph->waterFallh-ScaleZone; int displayPart=graph->waterFallh-ScaleZone;
......
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