fixed rssi sensor is in dbm. get rsrp from port 0 only

master
Ismael Gomez 8 years ago
parent 783d26b40a
commit 4938daa22b

@ -348,7 +348,7 @@ int main(int argc, char **argv) {
if ((nframes%100) == 0 || rx_gain_offset == 0) {
if (srslte_rf_has_rssi(&rf)) {
rx_gain_offset = 10*log10(rssi)-srslte_rf_get_rssi(&rf);
rx_gain_offset = 10*log10(rssi*1000)-srslte_rf_get_rssi(&rf);
} else {
rx_gain_offset = srslte_rf_get_rx_gain(&rf);
}
@ -357,10 +357,10 @@ int main(int argc, char **argv) {
// Plot and Printf
if ((nframes%10) == 0) {
printf("CFO: %+8.4f kHz, SFO: %+8.4f kHz, RSSI: %5.1f dBm, RSSI/ref-symbol: %+5.1f dBm, "
printf("CFO: %+8.4f kHz, SFO: %+8.4f Hz, RSSI: %5.1f dBm, RSSI/ref-symbol: %+5.1f dBm, "
"RSRP: %+5.1f dBm, RSRQ: %5.1f dB, SNR: %5.1f dB\r",
srslte_ue_sync_get_cfo(&ue_sync)/1000, srslte_ue_sync_get_sfo(&ue_sync),
10*log10(rssi*1000) - rx_gain_offset,
10*log10(rssi*1000) - rx_gain_offset,
10*log10(rssi_utra*1000)- rx_gain_offset,
10*log10(rsrp*1000) - rx_gain_offset,
10*log10(rsrq), 10*log10(snr));

@ -418,10 +418,10 @@ float srslte_chest_dl_get_rsrq(srslte_chest_dl_t *q) {
}
float srslte_chest_dl_get_rsrp(srslte_chest_dl_t *q) {
// return sum of power received from all tx ports
// Note: use only port 0 but average across antennas
float n = 0;
for (int i=0;i<q->last_nof_antennas;i++) {
n += srslte_vec_acc_ff(q->rsrp[i], q->cell.nof_ports);
n += q->rsrp[i][0];
}
return n/q->last_nof_antennas;
}

Loading…
Cancel
Save