|
|
@ -64,12 +64,18 @@ sem_t plot_sem;
|
|
|
|
uint32_t plot_sf_idx=0;
|
|
|
|
uint32_t plot_sf_idx=0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define PLOT_CHEST_ARGUMENT
|
|
|
|
|
|
|
|
#define PRINT_CHANGE_SCHEDULIGN
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
/**********************************************************************
|
|
|
|
* Program arguments processing
|
|
|
|
* Program arguments processing
|
|
|
|
***********************************************************************/
|
|
|
|
***********************************************************************/
|
|
|
|
typedef struct {
|
|
|
|
typedef struct {
|
|
|
|
int nof_subframes;
|
|
|
|
int nof_subframes;
|
|
|
|
bool disable_plots;
|
|
|
|
bool disable_plots;
|
|
|
|
|
|
|
|
bool disable_plots_except_constellation;
|
|
|
|
|
|
|
|
bool disable_cfo;
|
|
|
|
|
|
|
|
uint32_t time_offset;
|
|
|
|
int force_N_id_2;
|
|
|
|
int force_N_id_2;
|
|
|
|
uint16_t rnti;
|
|
|
|
uint16_t rnti;
|
|
|
|
char *input_file_name;
|
|
|
|
char *input_file_name;
|
|
|
@ -87,10 +93,14 @@ typedef struct {
|
|
|
|
}prog_args_t;
|
|
|
|
}prog_args_t;
|
|
|
|
|
|
|
|
|
|
|
|
void args_default(prog_args_t *args) {
|
|
|
|
void args_default(prog_args_t *args) {
|
|
|
|
|
|
|
|
args->disable_plots = false;
|
|
|
|
|
|
|
|
args->disable_plots_except_constellation = false;
|
|
|
|
args->nof_subframes = -1;
|
|
|
|
args->nof_subframes = -1;
|
|
|
|
args->rnti = SRSLTE_SIRNTI;
|
|
|
|
args->rnti = SRSLTE_SIRNTI;
|
|
|
|
args->force_N_id_2 = -1; // Pick the best
|
|
|
|
args->force_N_id_2 = -1; // Pick the best
|
|
|
|
args->input_file_name = NULL;
|
|
|
|
args->input_file_name = NULL;
|
|
|
|
|
|
|
|
args->disable_cfo = false;
|
|
|
|
|
|
|
|
args->time_offset = 0;
|
|
|
|
args->file_nof_prb = 6;
|
|
|
|
args->file_nof_prb = 6;
|
|
|
|
args->file_nof_ports = 1;
|
|
|
|
args->file_nof_ports = 1;
|
|
|
|
args->file_cell_id = 0;
|
|
|
|
args->file_cell_id = 0;
|
|
|
@ -105,7 +115,7 @@ void args_default(prog_args_t *args) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void usage(prog_args_t *args, char *prog) {
|
|
|
|
void usage(prog_args_t *args, char *prog) {
|
|
|
|
printf("Usage: %s [agpPcildnruv] -f rx_frequency (in Hz) | -i input_file\n", prog);
|
|
|
|
printf("Usage: %s [agpPcildDnruv] -f rx_frequency (in Hz) | -i input_file\n", prog);
|
|
|
|
#ifndef DISABLE_UHD
|
|
|
|
#ifndef DISABLE_UHD
|
|
|
|
printf("\t-a UHD args [Default %s]\n", args->uhd_args);
|
|
|
|
printf("\t-a UHD args [Default %s]\n", args->uhd_args);
|
|
|
|
printf("\t-g UHD fix RX gain [Default AGC]\n");
|
|
|
|
printf("\t-g UHD fix RX gain [Default AGC]\n");
|
|
|
@ -117,10 +127,13 @@ void usage(prog_args_t *args, char *prog) {
|
|
|
|
printf("\t-p nof_prb for input file [Default %d]\n", args->file_nof_prb);
|
|
|
|
printf("\t-p nof_prb for input file [Default %d]\n", args->file_nof_prb);
|
|
|
|
printf("\t-P nof_ports for input file [Default %d]\n", args->file_nof_ports);
|
|
|
|
printf("\t-P nof_ports for input file [Default %d]\n", args->file_nof_ports);
|
|
|
|
printf("\t-c cell_id for input file [Default %d]\n", args->file_cell_id);
|
|
|
|
printf("\t-c cell_id for input file [Default %d]\n", args->file_cell_id);
|
|
|
|
printf("\t-r RNTI [Default 0x%x]\n",args->rnti);
|
|
|
|
printf("\t-r RNTI in Hex [Default 0x%x]\n",args->rnti);
|
|
|
|
printf("\t-l Force N_id_2 [Default best]\n");
|
|
|
|
printf("\t-l Force N_id_2 [Default best]\n");
|
|
|
|
|
|
|
|
printf("\t-C Disable CFO correction [Default %s]\n", args->disable_cfo?"Disabled":"Enabled");
|
|
|
|
|
|
|
|
printf("\t-t Add time offset [Default %d]\n", args->time_offset);
|
|
|
|
#ifndef DISABLE_GRAPHICS
|
|
|
|
#ifndef DISABLE_GRAPHICS
|
|
|
|
printf("\t-d disable plots [Default enabled]\n");
|
|
|
|
printf("\t-d disable plots [Default enabled]\n");
|
|
|
|
|
|
|
|
printf("\t-D disable all but constellation plots [Default enabled]\n");
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
printf("\t plots are disabled. Graphics library not available\n");
|
|
|
|
printf("\t plots are disabled. Graphics library not available\n");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -135,7 +148,7 @@ void usage(prog_args_t *args, char *prog) {
|
|
|
|
void parse_args(prog_args_t *args, int argc, char **argv) {
|
|
|
|
void parse_args(prog_args_t *args, int argc, char **argv) {
|
|
|
|
int opt;
|
|
|
|
int opt;
|
|
|
|
args_default(args);
|
|
|
|
args_default(args);
|
|
|
|
while ((opt = getopt(argc, argv, "aoglipPcdnvrfuUsS")) != -1) {
|
|
|
|
while ((opt = getopt(argc, argv, "aoglipPcCtdDnvrfuUsS")) != -1) {
|
|
|
|
switch (opt) {
|
|
|
|
switch (opt) {
|
|
|
|
case 'i':
|
|
|
|
case 'i':
|
|
|
|
args->input_file_name = argv[optind];
|
|
|
|
args->input_file_name = argv[optind];
|
|
|
@ -155,6 +168,12 @@ void parse_args(prog_args_t *args, int argc, char **argv) {
|
|
|
|
case 'g':
|
|
|
|
case 'g':
|
|
|
|
args->uhd_gain = atof(argv[optind]);
|
|
|
|
args->uhd_gain = atof(argv[optind]);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'C':
|
|
|
|
|
|
|
|
args->disable_cfo = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 't':
|
|
|
|
|
|
|
|
args->time_offset = atoi(argv[optind]);
|
|
|
|
|
|
|
|
break;
|
|
|
|
case 'o':
|
|
|
|
case 'o':
|
|
|
|
args->uhd_freq_offset = atof(argv[optind]);
|
|
|
|
args->uhd_freq_offset = atof(argv[optind]);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -165,7 +184,7 @@ void parse_args(prog_args_t *args, int argc, char **argv) {
|
|
|
|
args->nof_subframes = atoi(argv[optind]);
|
|
|
|
args->nof_subframes = atoi(argv[optind]);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'r':
|
|
|
|
case 'r':
|
|
|
|
args->rnti = atoi(argv[optind]);
|
|
|
|
args->rnti = strtol(argv[optind], NULL, 16);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'l':
|
|
|
|
case 'l':
|
|
|
|
args->force_N_id_2 = atoi(argv[optind]);
|
|
|
|
args->force_N_id_2 = atoi(argv[optind]);
|
|
|
@ -185,6 +204,9 @@ void parse_args(prog_args_t *args, int argc, char **argv) {
|
|
|
|
case 'd':
|
|
|
|
case 'd':
|
|
|
|
args->disable_plots = true;
|
|
|
|
args->disable_plots = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'D':
|
|
|
|
|
|
|
|
args->disable_plots_except_constellation = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
case 'v':
|
|
|
|
case 'v':
|
|
|
|
srslte_verbose++;
|
|
|
|
srslte_verbose++;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -373,7 +395,7 @@ int main(int argc, char **argv) {
|
|
|
|
// Variables for measurements
|
|
|
|
// Variables for measurements
|
|
|
|
uint32_t nframes=0;
|
|
|
|
uint32_t nframes=0;
|
|
|
|
float rsrp=0.0, rsrq=0.0, snr=0.0;
|
|
|
|
float rsrp=0.0, rsrq=0.0, snr=0.0;
|
|
|
|
bool decode_pdsch;
|
|
|
|
bool decode_pdsch = false;
|
|
|
|
int pdcch_tx=0;
|
|
|
|
int pdcch_tx=0;
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef DISABLE_UHD
|
|
|
|
#ifndef DISABLE_UHD
|
|
|
@ -381,6 +403,19 @@ int main(int argc, char **argv) {
|
|
|
|
srslte_ue_sync_start_agc(&ue_sync, cuhd_set_rx_gain_th, cell_detect_config.init_agc);
|
|
|
|
srslte_ue_sync_start_agc(&ue_sync, cuhd_set_rx_gain_th, cell_detect_config.init_agc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef PRINT_CHANGE_SCHEDULIGN
|
|
|
|
|
|
|
|
srslte_ra_dl_dci_t old_dl_dci;
|
|
|
|
|
|
|
|
bzero(&old_dl_dci, sizeof(srslte_ra_dl_dci_t));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ue_sync.correct_cfo = !prog_args.disable_cfo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Set high priority */
|
|
|
|
|
|
|
|
struct sched_param param;
|
|
|
|
|
|
|
|
param.sched_priority = sched_get_priority_max(SCHED_FIFO);
|
|
|
|
|
|
|
|
if (sched_setscheduler(pthread_self(), SCHED_FIFO, ¶m)) {
|
|
|
|
|
|
|
|
perror("setscheduler");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
INFO("\nEntering main loop...\n\n", 0);
|
|
|
|
INFO("\nEntering main loop...\n\n", 0);
|
|
|
|
/* Main loop */
|
|
|
|
/* Main loop */
|
|
|
@ -412,9 +447,13 @@ int main(int argc, char **argv) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DECODE_PDSCH:
|
|
|
|
case DECODE_PDSCH:
|
|
|
|
if (prog_args.rnti != SRSLTE_SIRNTI) {
|
|
|
|
if (prog_args.rnti != SRSLTE_SIRNTI) {
|
|
|
|
decode_pdsch = true;
|
|
|
|
if (srslte_ue_sync_get_sfidx(&ue_sync) != 5 && srslte_ue_sync_get_sfidx(&ue_sync) != 0) {
|
|
|
|
|
|
|
|
decode_pdsch = true;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
decode_pdsch = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
/* We are looking for SIB1 Blocks, search only in appropiate places */
|
|
|
|
/* We are looking for SIB1 Blocks, 2search only in appropiate places */
|
|
|
|
if ((srslte_ue_sync_get_sfidx(&ue_sync) == 5 && (sfn%2)==0)) {
|
|
|
|
if ((srslte_ue_sync_get_sfidx(&ue_sync) == 5 && (sfn%2)==0)) {
|
|
|
|
decode_pdsch = true;
|
|
|
|
decode_pdsch = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -423,9 +462,9 @@ int main(int argc, char **argv) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (decode_pdsch) {
|
|
|
|
if (decode_pdsch) {
|
|
|
|
if (prog_args.rnti != SRSLTE_SIRNTI) {
|
|
|
|
if (prog_args.rnti != SRSLTE_SIRNTI) {
|
|
|
|
n = srslte_ue_dl_decode(&ue_dl, sf_buffer, data_packed, srslte_ue_sync_get_sfidx(&ue_sync));
|
|
|
|
n = srslte_ue_dl_decode(&ue_dl, &sf_buffer[prog_args.time_offset], data_packed, srslte_ue_sync_get_sfidx(&ue_sync));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
n = srslte_ue_dl_decode_rnti_rv(&ue_dl, sf_buffer, data_packed, srslte_ue_sync_get_sfidx(&ue_sync),
|
|
|
|
n = srslte_ue_dl_decode_rnti_rv(&ue_dl, &sf_buffer[prog_args.time_offset], data_packed, srslte_ue_sync_get_sfidx(&ue_sync),
|
|
|
|
SRSLTE_SIRNTI, ((int) ceilf((float)3*(((sfn)/2)%4)/2))%4);
|
|
|
|
SRSLTE_SIRNTI, ((int) ceilf((float)3*(((sfn)/2)%4)/2))%4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (n < 0) {
|
|
|
|
if (n < 0) {
|
|
|
@ -436,7 +475,22 @@ int main(int argc, char **argv) {
|
|
|
|
srslte_bit_unpack_vector(data_packed, data, n);
|
|
|
|
srslte_bit_unpack_vector(data_packed, data, n);
|
|
|
|
srslte_netsink_write(&net_sink, data, 1+(n-1)/8);
|
|
|
|
srslte_netsink_write(&net_sink, data, 1+(n-1)/8);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef PRINT_CHANGE_SCHEDULIGN
|
|
|
|
|
|
|
|
if (ue_dl.dl_dci.mcs_idx != old_dl_dci.mcs_idx ||
|
|
|
|
|
|
|
|
ue_dl.dl_dci.alloc_type != old_dl_dci.alloc_type ||
|
|
|
|
|
|
|
|
ue_dl.dl_dci.type2_alloc.riv != ue_dl.dl_dci.type2_alloc.riv)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
memcpy(&old_dl_dci, &ue_dl.dl_dci, sizeof(srslte_ra_dl_dci_t));
|
|
|
|
|
|
|
|
fflush(stdout);printf("\nCFI:\t%d\n", ue_dl.cfi);
|
|
|
|
|
|
|
|
printf("Format: %s\n", srslte_dci_format_string(ue_dl.dci_format));
|
|
|
|
|
|
|
|
srslte_ra_pdsch_fprint(stdout, &old_dl_dci, cell.nof_prb);
|
|
|
|
|
|
|
|
srslte_ra_dl_grant_fprint(stdout, &ue_dl.pdsch_cfg.grant);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nof_trials++;
|
|
|
|
nof_trials++;
|
|
|
|
|
|
|
|
|
|
|
|
rsrq = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrq(&ue_dl.chest), rsrq, 0.05);
|
|
|
|
rsrq = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrq(&ue_dl.chest), rsrq, 0.05);
|
|
|
@ -507,8 +561,10 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef DISABLE_GRAPHICS
|
|
|
|
#ifndef DISABLE_GRAPHICS
|
|
|
|
if (!prog_args.disable_plots) {
|
|
|
|
if (!prog_args.disable_plots) {
|
|
|
|
plot_sf_idx = srslte_ue_sync_get_sfidx(&ue_sync);
|
|
|
|
if ((sfn%10) == 0 && decode_pdsch) {
|
|
|
|
sem_post(&plot_sem);
|
|
|
|
plot_sf_idx = srslte_ue_sync_get_sfidx(&ue_sync);
|
|
|
|
|
|
|
|
sem_post(&plot_sem);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
} else if (ret == 0) {
|
|
|
|
} else if (ret == 0) {
|
|
|
@ -555,7 +611,7 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//plot_waterfall_t poutfft;
|
|
|
|
//plot_waterfall_t poutfft;
|
|
|
|
plot_real_t p_sync, pce;
|
|
|
|
plot_real_t p_sync, pce, pce_arg;
|
|
|
|
plot_scatter_t pscatequal, pscatequal_pdcch;
|
|
|
|
plot_scatter_t pscatequal, pscatequal_pdcch;
|
|
|
|
|
|
|
|
|
|
|
|
float tmp_plot[SRSLTE_SLOT_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)];
|
|
|
|
float tmp_plot[SRSLTE_SLOT_LEN_RE(SRSLTE_MAX_PRB, SRSLTE_CP_NORM)];
|
|
|
@ -566,38 +622,82 @@ void *plot_thread_run(void *arg) {
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
uint32_t nof_re = SRSLTE_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp);
|
|
|
|
uint32_t nof_re = SRSLTE_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sdrgui_init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//plot_waterfall_init(&poutfft, SRSLTE_NRE * ue_dl.cell.nof_prb, 1000);
|
|
|
|
|
|
|
|
//plot_waterfall_setTitle(&poutfft, "Output FFT - Magnitude");
|
|
|
|
|
|
|
|
//plot_waterfall_setPlotYAxisScale(&poutfft, -40, 40);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!prog_args.disable_plots_except_constellation) {
|
|
|
|
|
|
|
|
plot_real_init(&pce);
|
|
|
|
|
|
|
|
plot_real_setTitle(&pce, "Channel Response - Magnitude");
|
|
|
|
|
|
|
|
plot_real_setLabels(&pce, "Index", "dB");
|
|
|
|
|
|
|
|
plot_real_setYAxisScale(&pce, -40, 40);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef PLOT_CHEST_ARGUMENT
|
|
|
|
|
|
|
|
plot_real_init(&pce_arg);
|
|
|
|
|
|
|
|
plot_real_setTitle(&pce_arg, "Channel Response - Argument");
|
|
|
|
|
|
|
|
plot_real_setLabels(&pce_arg, "Index", "rad");
|
|
|
|
|
|
|
|
plot_real_setYAxisScale(&pce_arg, -1.1*M_PI, 1.1*M_PI);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot_real_init(&p_sync);
|
|
|
|
|
|
|
|
plot_real_setTitle(&p_sync, "PSS Cross-Corr abs value");
|
|
|
|
|
|
|
|
plot_real_setYAxisScale(&p_sync, 0, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot_scatter_init(&pscatequal_pdcch);
|
|
|
|
|
|
|
|
plot_scatter_setTitle(&pscatequal_pdcch, "PDCCH - Equalized Symbols");
|
|
|
|
|
|
|
|
plot_scatter_setXAxisScale(&pscatequal_pdcch, -4, 4);
|
|
|
|
|
|
|
|
plot_scatter_setYAxisScale(&pscatequal_pdcch, -4, 4);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot_scatter_init(&pscatequal);
|
|
|
|
|
|
|
|
plot_scatter_setTitle(&pscatequal, "PDSCH - Equalized Symbols");
|
|
|
|
|
|
|
|
plot_scatter_setXAxisScale(&pscatequal, -4, 4);
|
|
|
|
|
|
|
|
plot_scatter_setYAxisScale(&pscatequal, -4, 4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while(1) {
|
|
|
|
while(1) {
|
|
|
|
sem_wait(&plot_sem);
|
|
|
|
sem_wait(&plot_sem);
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t nof_symbols = ue_dl.pdsch_cfg.grant.nof_re;
|
|
|
|
uint32_t nof_symbols = ue_dl.pdsch_cfg.grant.nof_re;
|
|
|
|
for (i = 0; i < nof_re; i++) {
|
|
|
|
if (!prog_args.disable_plots_except_constellation) {
|
|
|
|
tmp_plot[i] = 20 * log10f(cabsf(ue_dl.sf_symbols[i]));
|
|
|
|
for (i = 0; i < nof_re; i++) {
|
|
|
|
if (isinf(tmp_plot[i])) {
|
|
|
|
tmp_plot[i] = 20 * log10f(cabsf(ue_dl.sf_symbols[i]));
|
|
|
|
tmp_plot[i] = -80;
|
|
|
|
if (isinf(tmp_plot[i])) {
|
|
|
|
|
|
|
|
tmp_plot[i] = -80;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i = 0; i < SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0); i++) {
|
|
|
|
for (i = 0; i < SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0); i++) {
|
|
|
|
tmp_plot2[i] = 20 * log10f(cabsf(ue_dl.chest.pilot_estimates_average[0][i]));
|
|
|
|
tmp_plot2[i] = 20 * log10f(cabsf(ue_dl.chest.pilot_estimates_average[0][i]));
|
|
|
|
if (isinf(tmp_plot2[i])) {
|
|
|
|
if (isinf(tmp_plot2[i])) {
|
|
|
|
tmp_plot2[i] = -80;
|
|
|
|
tmp_plot2[i] = -80;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//for (i=0;i<SRSLTE_CP_NSYMB(ue_dl.cell.cp);i++) {
|
|
|
|
plot_real_setNewData(&pce, tmp_plot2, SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0));
|
|
|
|
// plot_waterfall_appendNewData(&poutfft, &tmp_plot[i*SRSLTE_NRE*ue_dl.cell.nof_prb], SRSLTE_NRE*ue_dl.cell.nof_prb);
|
|
|
|
if (!prog_args.input_file_name) {
|
|
|
|
//}
|
|
|
|
int max = srslte_vec_max_fi(ue_sync.strack.pss.conv_output_avg, ue_sync.strack.pss.frame_size+ue_sync.strack.pss.fft_size-1);
|
|
|
|
plot_real_setNewData(&pce, tmp_plot2, SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0));
|
|
|
|
srslte_vec_sc_prod_fff(ue_sync.strack.pss.conv_output_avg,
|
|
|
|
if (!prog_args.input_file_name) {
|
|
|
|
1/ue_sync.strack.pss.conv_output_avg[max],
|
|
|
|
int max = srslte_vec_max_fi(ue_sync.strack.pss.conv_output_avg, ue_sync.strack.pss.frame_size+ue_sync.strack.pss.fft_size-1);
|
|
|
|
tmp_plot2,
|
|
|
|
srslte_vec_sc_prod_fff(ue_sync.strack.pss.conv_output_avg,
|
|
|
|
ue_sync.strack.pss.frame_size+ue_sync.strack.pss.fft_size-1);
|
|
|
|
1/ue_sync.strack.pss.conv_output_avg[max],
|
|
|
|
plot_real_setNewData(&p_sync, tmp_plot2, ue_sync.strack.pss.frame_size);
|
|
|
|
tmp_plot2,
|
|
|
|
|
|
|
|
ue_sync.strack.pss.frame_size+ue_sync.strack.pss.fft_size-1);
|
|
|
|
}
|
|
|
|
plot_real_setNewData(&p_sync, tmp_plot2, ue_sync.strack.pss.frame_size);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef PLOT_CHEST_ARGUMENT
|
|
|
|
|
|
|
|
for (i = 0; i < SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0); i++) {
|
|
|
|
|
|
|
|
tmp_plot2[i] = cargf(ue_dl.chest.pilot_estimates_average[0][i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
plot_real_setNewData(&pce_arg, tmp_plot2, SRSLTE_REFSIGNAL_NUM_SF(ue_dl.cell.nof_prb,0));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot_scatter_setNewData(&pscatequal_pdcch, ue_dl.pdcch.d, 36*ue_dl.pdcch.nof_cce/2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
plot_scatter_setNewData(&pscatequal, ue_dl.pdsch.d, nof_symbols);
|
|
|
|
plot_scatter_setNewData(&pscatequal, ue_dl.pdsch.d, nof_symbols/2);
|
|
|
|
plot_scatter_setNewData(&pscatequal_pdcch, ue_dl.pdcch.d, 36*ue_dl.pdcch.nof_cce);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (plot_sf_idx == 1) {
|
|
|
|
if (plot_sf_idx == 1) {
|
|
|
|
if (prog_args.net_port_signal > 0) {
|
|
|
|
if (prog_args.net_port_signal > 0) {
|
|
|
@ -613,36 +713,17 @@ void *plot_thread_run(void *arg) {
|
|
|
|
|
|
|
|
|
|
|
|
void init_plots() {
|
|
|
|
void init_plots() {
|
|
|
|
|
|
|
|
|
|
|
|
sdrgui_init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//plot_waterfall_init(&poutfft, SRSLTE_NRE * ue_dl.cell.nof_prb, 1000);
|
|
|
|
|
|
|
|
//plot_waterfall_setTitle(&poutfft, "Output FFT - Magnitude");
|
|
|
|
|
|
|
|
//plot_waterfall_setPlotYAxisScale(&poutfft, -40, 40);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot_real_init(&pce);
|
|
|
|
|
|
|
|
plot_real_setTitle(&pce, "Channel Response - Magnitude");
|
|
|
|
|
|
|
|
plot_real_setLabels(&pce, "Index", "dB");
|
|
|
|
|
|
|
|
plot_real_setYAxisScale(&pce, -40, 40);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot_real_init(&p_sync);
|
|
|
|
|
|
|
|
plot_real_setTitle(&p_sync, "PSS Cross-Corr abs value");
|
|
|
|
|
|
|
|
plot_real_setYAxisScale(&p_sync, 0, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot_scatter_init(&pscatequal);
|
|
|
|
|
|
|
|
plot_scatter_setTitle(&pscatequal, "PDSCH - Equalized Symbols");
|
|
|
|
|
|
|
|
plot_scatter_setXAxisScale(&pscatequal, -4, 4);
|
|
|
|
|
|
|
|
plot_scatter_setYAxisScale(&pscatequal, -4, 4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot_scatter_init(&pscatequal_pdcch);
|
|
|
|
|
|
|
|
plot_scatter_setTitle(&pscatequal_pdcch, "PDCCH - Equalized Symbols");
|
|
|
|
|
|
|
|
plot_scatter_setXAxisScale(&pscatequal_pdcch, -4, 4);
|
|
|
|
|
|
|
|
plot_scatter_setYAxisScale(&pscatequal_pdcch, -4, 4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sem_init(&plot_sem, 0, 0)) {
|
|
|
|
if (sem_init(&plot_sem, 0, 0)) {
|
|
|
|
perror("sem_init");
|
|
|
|
perror("sem_init");
|
|
|
|
exit(-1);
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pthread_attr_t attr;
|
|
|
|
|
|
|
|
struct sched_param param;
|
|
|
|
|
|
|
|
param.sched_priority = 0;
|
|
|
|
|
|
|
|
pthread_attr_init(&attr);
|
|
|
|
|
|
|
|
pthread_attr_setschedpolicy(&attr, SCHED_OTHER);
|
|
|
|
|
|
|
|
pthread_attr_setschedparam(&attr, ¶m);
|
|
|
|
if (pthread_create(&plot_thread, NULL, plot_thread_run, NULL)) {
|
|
|
|
if (pthread_create(&plot_thread, NULL, plot_thread_run, NULL)) {
|
|
|
|
perror("pthread_create");
|
|
|
|
perror("pthread_create");
|
|
|
|
exit(-1);
|
|
|
|
exit(-1);
|
|
|
|