From 4938daa22b0d1404a48cf421ec343cc8e5022315 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 10 May 2017 20:13:55 +0200 Subject: [PATCH] fixed rssi sensor is in dbm. get rsrp from port 0 only --- srslte/examples/cell_measurement.c | 6 +++--- srslte/lib/ch_estimation/chest_dl.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/srslte/examples/cell_measurement.c b/srslte/examples/cell_measurement.c index 8c9d95fe3..a88303f48 100644 --- a/srslte/examples/cell_measurement.c +++ b/srslte/examples/cell_measurement.c @@ -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)); diff --git a/srslte/lib/ch_estimation/chest_dl.c b/srslte/lib/ch_estimation/chest_dl.c index f198344f0..5368c706f 100644 --- a/srslte/lib/ch_estimation/chest_dl.c +++ b/srslte/lib/ch_estimation/chest_dl.c @@ -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;ilast_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; }