diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2013-03-16 10:08:04 +0100 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2013-07-06 13:14:56 +0200 |
commit | 7be04d6567fcaeb46b8f4efce58a35e0e031011a (patch) | |
tree | 8ff61b51bb6d0ca4827d0333c7e7157be612baaa /src/gmr1_rx.c | |
parent | 0ddd95716576bf897164496e59a829bf9601eee6 (diff) |
gmr1_rx: Don't count the borders when computing energy
Since the 'burst' vector often include some margin, the center
will be more representative of the real average energy.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'src/gmr1_rx.c')
-rw-r--r-- | src/gmr1_rx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gmr1_rx.c b/src/gmr1_rx.c index 56a3dda..fb138e2 100644 --- a/src/gmr1_rx.c +++ b/src/gmr1_rx.c @@ -170,7 +170,8 @@ burst_energy(struct osmo_cxvec *burst) { int i; float e = 0.0f; - for (i=0; i<burst->len; i++) + int b = (burst->len >> 5); /* exclude the borders */ + for (i=b; i<burst->len-b; i++) e += osmo_normsqf(burst->data[i]); e /= burst->len; return e; |