From 90526bca2ebdc9709d50fb94ee41662980643b36 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Sun, 30 Oct 2016 20:30:32 +0100 Subject: [PATCH] gmr1_rx: FCCH SNR computation improvement Signed-off-by: Sylvain Munaut --- src/gmr1_rx.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/gmr1_rx.c b/src/gmr1_rx.c index 716bd63..a62b3a1 100644 --- a/src/gmr1_rx.c +++ b/src/gmr1_rx.c @@ -678,22 +678,16 @@ fcch_multi_process(struct chan_desc *cd, fcch_multi_cb_t cb) return rv; } - /* Compute SNR (comparing energy with neighboring CICH) */ + /* Compute SNR */ win_map(win, cd->bcch, - base_align + mtoa[i] + toa + 5 * cd->sps, - (117 - 10) * cd->sps + base_align + mtoa[i] + toa, + fcch_type->len * cd->sps ); - e_fcch = burst_energy(win); - - win_map(win, cd->bcch, - base_align + mtoa[i] + toa + (5 + 117) * cd->sps, - (117 - 10) * cd->sps - ); - - e_cich = burst_energy(win); - - snr = e_fcch / e_cich; + rv = gmr1_fcch_snr(fcch_type, win, cd->sps, -(cd->freq_err + freq_err), &snr); + if (rv) { + fprintf(stderr, "[!] Error during FCCH SNR estimation (%d)\n", rv); + } /* Check against strongest */ if (i==0) {