stole 4 bits from UW for txt channel, works OK wonce I tweaked the UW threshold
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 9 Apr 2018 04:13:14 +0000 (04:13 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 9 Apr 2018 04:13:14 +0000 (04:13 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3457 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/ofdm_lib.m

index 27cae0a3c166ab065c34c589d7978da04557fe00..0518a96413fd2ba0239219bd6e84e310760bb25e 100644 (file)
@@ -136,7 +136,8 @@ function states = ofdm_init(bps, Rs, Tcp, Ns, Nc)
   states.Nbitsperframe = (Ns-1)*Nc*bps;
   states.Nrowsperframe = states.Nbitsperframe/(Nc*bps);
   states.Nsamperframe =  (states.Nrowsperframe+1)*(states.M+states.Ncp);
-  states.uw_len = (Ns-1)*bps;
+  states.txt_len = 4;   % reserve 4 bits/frame for auxillary text information
+  states.uw_len = (Ns-1)*bps - states.txt_len;
 
   % generate same pilots each time
 
@@ -558,7 +559,8 @@ function states = sync_state_machine(states, rx_uw)
 
     states.frame_count++;
       
-    % during trial sync we don't tolerate errors so much
+    % during trial sync we don't tolerate errors so much, once we have synced up
+    % we are willing to wait out a fade
       
     if states.frame_count == 3
       next_state = 'synced';
@@ -569,10 +571,11 @@ function states = sync_state_machine(states, rx_uw)
       sync_counter_thresh = 3;
     end
 
-    % freq offset est may be too far out, and has aliases every 1/Ts
+    % freq offset est may be too far out, and has aliases every 1/Ts, so
+    % we use a Unique Word to get a really solid indication of sync.
 
     states.uw_errors = sum(rx_uw);
-    if (states.uw_errors > 3)
+    if (states.uw_errors > 2)
       states.sync_counter++;
       if states.sync_counter == sync_counter_thresh
         next_state = 'searching';