From a428eaa3e74da559d02ad7d52cc85efc9c9d55e6 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Sun, 24 Jan 2016 03:45:21 +0000 Subject: [PATCH] EbNo est doing something sorta sensible, fixed occasional overrun bug git-svn-id: https://svn.code.sf.net/p/freetel/code@2649 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/octave/fsk_horus_stream.m | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/codec2-dev/octave/fsk_horus_stream.m b/codec2-dev/octave/fsk_horus_stream.m index 8247185e..e52052cf 100755 --- a/codec2-dev/octave/fsk_horus_stream.m +++ b/codec2-dev/octave/fsk_horus_stream.m @@ -157,10 +157,17 @@ while c if uw_loc != -1 packet_found = 1; - if (uw_loc + states.binary.max_packet_len+7) < nbits - - pin = uw_loc; - for i=1:45 + if (uw_loc + states.binary.max_packet_len) < nbits + + pin = uw_loc; + nbytes = states.binary.max_packet_len/8; + for i=1:nbytes + if (pin+7) > nbits + pin + nbits + uw_loc + states.binary.max_packet_len + end rx_bytes(i) = rx_bits_buf(pin:pin+7) * (2.^(7:-1:0))'; pin += 8; %printf("%d 0x%02x\n", i, rx_bytes(i)); -- 2.25.1