fixed bug in amplitude estimator that improved LDPC dec perf - Octave code
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 24 Apr 2018 03:37:09 +0000 (03:37 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 24 Apr 2018 03:37:09 +0000 (03:37 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3521 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/ldpc.m
codec2-dev/octave/ofdm_dev.m
codec2-dev/octave/ofdm_ldpc_rx.m
codec2-dev/octave/ofdm_lib.m

index d337394e4ed89ca36d54a67b9a7d2ccf36ef5c52..e05cb0843d1d9a2cd4e43e49d21422c04b147332 100644 (file)
@@ -74,19 +74,15 @@ endfunction
 
 
 function [detected_data paritychecks] = ldpc_dec(code_param, max_iterations, demod_type, decoder_type, r, EsNo, fading)
-    if nargin == 6
-      fading = ones(1, length(r));
-    end
-
     symbol_likelihood = Demod2D( r, code_param.S_matrix, EsNo, fading);
-         
+    
     % initialize the extrinsic decoder input
 
     input_somap_c = zeros(1, code_param.code_bits_per_frame );
     bit_likelihood = Somap( symbol_likelihood, demod_type, input_somap_c );
     
     input_decoder_c = bit_likelihood(1:code_param.code_bits_per_frame);
-
+    
     [x_hat paritychecks] = MpDecode( -input_decoder_c, code_param.H_rows, code_param.H_cols, ...
                               max_iterations, decoder_type, 1, 1);
     [mx mx_ind] = max(paritychecks);
index 109b0a7af35f9ec4385a2773204d46984c1cd025..15f2f88b45d1175ea1b067b0f9713ba51c7d0f6f 100644 (file)
@@ -309,7 +309,7 @@ function [sim_out rx states] = run_sim(sim_in)
 
       lnew = min(Nsam-prx,states.nin);
       rxbuf_in = zeros(1,states.nin);
-
+      
       if lnew
         rxbuf_in(1:lnew) = rx(prx:prx+lnew-1);
       end
@@ -370,7 +370,7 @@ function [sim_out rx states] = run_sim(sim_in)
       st = (f-1)*Nbitsperframe/bps + 1;
       en = st + Nbitsperframe/bps - 1;
       r = rx_np(st:en); fade = rx_amp(st:en);
-
+      fade
       % optional LDPC decode
      
       if ldpc_en
@@ -1084,9 +1084,9 @@ more off;
 
 init_cml('~/cml/');
 
-%run_single 
+run_single 
 %run_curves
 %run_curves_estimators
 %acquisition_histograms(0, 0)
-acquisition_test(Ntests=3, EbNodB=100, foff_hz=0)
+%acquisition_test(Ntests=3, EbNodB=100, foff_hz=0)
 %sync_metrics('freq')
index 19178d63790cdf4970ea45a112637e6e8b6b5343..870c18f288fc7e1b339bbc995eecb294435ec870 100644 (file)
@@ -29,7 +29,7 @@ function ofdm_ldpc_rx(filename, interleave_frames = 1, error_pattern_filename)
   mod_order = 4; bps = 2; modulation = 'QPSK'; mapping = 'gray';
   demod_type = 0; decoder_type = 0; max_iterations = 100;
 
-  EsNo = 10; % TODO: fixme
+  EsNo = 3; % TODO: fixme
   printf("EsNo fixed at %f - need to est from channel\n", EsNo);
   
   init_cml('~/cml/');
@@ -149,7 +149,7 @@ function ofdm_ldpc_rx(filename, interleave_frames = 1, error_pattern_filename)
 
       rx_np_de = gp_deinterleave(rx_np);
       rx_amp_de = gp_deinterleave(rx_amp);
-
+      
       % Interleaver Sync:
       %   Needs to work on any data
       %   Use indication of LDPC convergence, may need to patch CML code for that
index e975ef413761580a58137736c58b91ad38dbf295..6dbbb091b45680064c491357dbe63caf03bb1147 100644 (file)
@@ -454,7 +454,7 @@ function [rx_bits states aphase_est_pilot_log rx_np rx_amp] = ofdm_demod(states,
     aphase_est_pilot_rect += sum(rx_sym(2+Ns+1,cr)*pilots(cr)');
 
     aphase_est_pilot(c) = angle(aphase_est_pilot_rect);
-    aamp_est_pilot(c) = abs(aphase_est_pilot_rect/12);
+    aamp_est_pilot(c) = abs(aphase_est_pilot_rect/6);   % amplitude is estimated over 6 rows of pilots
   end
  
   % correct phase offset using phase estimate, and demodulate