diff --git a/srslte/examples/cell_measurement.c b/srslte/examples/cell_measurement.c index 086ec7660..78c9001f3 100644 --- a/srslte/examples/cell_measurement.c +++ b/srslte/examples/cell_measurement.c @@ -155,13 +155,21 @@ int main(int argc, char **argv) { exit(-1); } - printf("Opening UHD device...\n"); - if (cuhd_open(prog_args.uhd_args, &uhd)) { - fprintf(stderr, "Error opening uhd\n"); - return -1; + if (prog_args.uhd_gain > 0) { + printf("Opening UHD device...\n"); + if (cuhd_open(prog_args.uhd_args, &uhd)) { + fprintf(stderr, "Error opening uhd\n"); + exit(-1); + } + cuhd_set_rx_gain(uhd, prog_args.uhd_gain); + } else { + printf("Opening UHD device with threaded RX Gain control ...\n"); + if (cuhd_open_th(prog_args.uhd_args, &uhd, false)) { + fprintf(stderr, "Error opening uhd\n"); + exit(-1); + } + cuhd_set_rx_gain(uhd, 50); } - /* Set receiver gain */ - cuhd_set_rx_gain(uhd, prog_args.uhd_gain); /* set receiver frequency */ cuhd_set_rx_freq(uhd, (double) prog_args.uhd_freq); @@ -289,7 +297,12 @@ int main(int argc, char **argv) { rssi_utra = SRSLTE_VEC_CMA(srslte_chest_dl_get_rssi(&chest),rssi_utra,nframes); rsrq = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrq(&chest),rsrq,0.05); rsrp = SRSLTE_VEC_EMA(srslte_chest_dl_get_rsrp(&chest),rsrp,0.05); - snr = SRSLTE_VEC_EMA(srslte_chest_dl_get_noise_estimate(&chest),snr,0.05); + snr = SRSLTE_VEC_EMA(srslte_chest_dl_get_snr(&chest),snr,0.05); + // Adjust with USRP gain + rssi += cuhd_get_rx_gain(uhd); + rssi_utra += cuhd_get_rx_gain(uhd); + rsrp += cuhd_get_rx_gain(uhd); + nframes++; } diff --git a/srslte/lib/phch/test/pucch_test.c b/srslte/lib/phch/test/pucch_test.c index 7dd54f6c1..a9ccd4534 100644 --- a/srslte/lib/phch/test/pucch_test.c +++ b/srslte/lib/phch/test/pucch_test.c @@ -122,16 +122,10 @@ int main(int argc, char **argv) { for (format=0;format<=SRSLTE_PUCCH_FORMAT_2B;format++) { for (uint32_t d=1;d<=3;d++) { for (uint32_t ncs=0;ncs<8;ncs+=d) { - for (uint32_t n_pucch=1;n_pucch<130;n_pucch++) { - - format=SRSLTE_PUCCH_FORMAT_2; - uint32_t d=2; - uint32_t ncs=0; - uint32_t n_pucch=0; - + for (uint32_t n_pucch=1;n_pucch<130;n_pucch+=50) { + struct timeval t[3]; - pucch_cfg.delta_pucch_shift = d; bool group_hopping_en = false; pucch_cfg.N_cs = ncs;