From 33c35d575d5df2f76f6242b6993db555ecaf4c62 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 20 Dec 2017 13:47:49 +0100 Subject: [PATCH] Save last PHICH correlation --- lib/include/srslte/phy/ue/ue_dl.h | 4 +++- lib/src/phy/ue/ue_dl.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/phy/ue/ue_dl.h b/lib/include/srslte/phy/ue/ue_dl.h index 02341c08d..6974a0b99 100644 --- a/lib/include/srslte/phy/ue/ue_dl.h +++ b/lib/include/srslte/phy/ue/ue_dl.h @@ -126,7 +126,9 @@ typedef struct SRSLTE_API { srslte_dci_msg_t pending_ul_dci_msg; uint16_t pending_ul_dci_rnti; - float sample_offset; + float sample_offset; + + float last_phich_corr; }srslte_ue_dl_t; /* This function shall be called just after the initial synchronization */ diff --git a/lib/src/phy/ue/ue_dl.c b/lib/src/phy/ue/ue_dl.c index 4183016e0..348d0bdb6 100644 --- a/lib/src/phy/ue/ue_dl.c +++ b/lib/src/phy/ue/ue_dl.c @@ -973,6 +973,7 @@ bool srslte_ue_dl_decode_phich(srslte_ue_dl_t *q, uint32_t sf_idx, uint32_t n_pr srslte_phich_ngroups(&q->phich), srslte_phich_nsf(&q->phich)); if (!srslte_phich_decode(&q->phich, q->sf_symbols_m, q->ce_m, 0, ngroup, nseq, sf_idx, &ack_bit, &distance)) { + q->last_phich_corr = distance; INFO("Decoded PHICH %d with distance %f\n", ack_bit, distance); } else { fprintf(stderr, "Error decoding PHICH\n");