Corrected cell_measurement RSSI/RSRP with USRP RX gain. Added AGC to cell_measurement.

This commit is contained in:
ismagom 2015-09-10 11:06:57 +02:00
parent 7cfe77e565
commit 2b34a3cb10
2 changed files with 22 additions and 15 deletions

View File

@ -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++;
}

View File

@ -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;