From 097005684aab2b42c95f5b92d1bdcc605df123d2 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Fri, 16 Feb 2018 12:05:45 +0100 Subject: [PATCH] Logs to test snr drop issue --- srsue/hdr/phy/phch_worker.h | 3 +++ srsue/src/phy/phch_recv.cc | 5 +++-- srsue/src/phy/phch_worker.cc | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/srsue/hdr/phy/phch_worker.h b/srsue/hdr/phy/phch_worker.h index c154ff514..78389ccf7 100644 --- a/srsue/hdr/phy/phch_worker.h +++ b/srsue/hdr/phy/phch_worker.h @@ -70,6 +70,9 @@ public: void start_plot(); float get_ref_cfo(); + float get_snr(); + float get_rsrp(); + float get_noise(); float get_cfo(); float get_ul_cfo(); diff --git a/srsue/src/phy/phch_recv.cc b/srsue/src/phy/phch_recv.cc index bf09f5f34..80c972266 100644 --- a/srsue/src/phy/phch_recv.cc +++ b/srsue/src/phy/phch_recv.cc @@ -675,10 +675,11 @@ void phch_recv::run_thread() case 1: if (last_worker) { - Debug("SF: cfo_tot=%7.1f Hz, ref=%f Hz, pss=%f Hz\n", + Info("SF: cfo_tot=%7.1f Hz, ref=%f Hz, pss=%f Hz, snr_sf=%.2f dB, rsrp=%.2f dB, noise=%.2f dB\n", srslte_ue_sync_get_cfo(&ue_sync), 15000*last_worker->get_ref_cfo(), - 15000*ue_sync.strack.cfo_pss_mean); + 15000*ue_sync.strack.cfo_pss_mean, + last_worker->get_snr(), last_worker->get_rsrp(), last_worker->get_noise()); } last_worker = worker; diff --git a/srsue/src/phy/phch_worker.cc b/srsue/src/phy/phch_worker.cc index f7e1381f8..e6fb7f35a 100644 --- a/srsue/src/phy/phch_worker.cc +++ b/srsue/src/phy/phch_worker.cc @@ -203,6 +203,22 @@ float phch_worker::get_ref_cfo() return srslte_chest_dl_get_cfo(&ue_dl.chest); } +float phch_worker::get_snr() +{ + return 10*log10(srslte_chest_dl_get_snr(&ue_dl.chest)); +} + +float phch_worker::get_rsrp() +{ + return 10*log10(srslte_chest_dl_get_rsrp(&ue_dl.chest)); +} + +float phch_worker::get_noise() +{ + return 10*log10(srslte_chest_dl_get_noise_estimate(&ue_dl.chest)); +} + + float phch_worker::get_cfo() { return cfo;