aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2016-10-30 20:30:32 +0100
committerSylvain Munaut <tnt@246tNt.com>2019-08-31 08:15:37 +0200
commit90526bca2ebdc9709d50fb94ee41662980643b36 (patch)
tree1fa71b42adeb8561bef8d5a194587baf8c0bcb69
parent8d51afb9392a66da74588e26121882d283453a6b (diff)
gmr1_rx: FCCH SNR computation improvement
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--src/gmr1_rx.c20
1 files 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
- );
-
- e_fcch = burst_energy(win);
-
- win_map(win, cd->bcch,
- base_align + mtoa[i] + toa + (5 + 117) * cd->sps,
- (117 - 10) * cd->sps
+ base_align + mtoa[i] + toa,
+ fcch_type->len * 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) {