EbNo est doing something sorta sensible, fixed occasional overrun bug
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 24 Jan 2016 03:45:21 +0000 (03:45 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 24 Jan 2016 03:45:21 +0000 (03:45 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2649 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/fsk_horus_stream.m

index 8247185ec9b50afa6f76a7033fb92a8011a49801..e52052cf83d41f818c318911703205e612dfcf0d 100755 (executable)
@@ -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));