progressing ofdm_demod, need to add raw/coded BER counters and confirm perf the same...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 13 Apr 2018 06:51:09 +0000 (06:51 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 13 Apr 2018 06:51:09 +0000 (06:51 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3477 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/ofdm_demod.c

index 40d4b1c6943cdfd53b82c93b37a09d070ca324fc..959e6a31779962165805628acf4530278dea16f3 100644 (file)
@@ -204,28 +204,35 @@ int main(int argc, char *argv[])
                 int    iter;
                 char   out_char[CODED_BITSPERFRAME];
                 int    parityCheckCount;
-        
-        
-                fprintf(stderr, "\n");
+                
                 for(i=0; i<CODED_BITSPERFRAME; i++) {
                     llr[i] = -bit_likelihood[i];
-                    if (i <5) {
-                        fprintf(stderr, "%d symb: %f %f a: %f llr %f\n", i,
-                                ldpc_codeword_symbols[i].real, ldpc_codeword_symbols[i].imag,
-                                ldpc_codeword_symbol_amps[i], llr[i]);
+                }
+
+                int ldpc_en = 1;
+                if (ldpc_en) {
+                    /* run LDPC decoder and output decoded bits */
+                    /* TODO
+                       [ ] how to test uncoded modem, maybe use LDPC encoded frame?
+                       [ ] log unsucessfully decoded frames, outout them anyway?
+                     */
+                    
+                    iter = run_ldpc_decoder(&ldpc, out_char, llr, &parityCheckCount);
+                    #ifdef TODO
+                    if (testframes) {
+                        /* measure raw and coded BER */
+                        Terrs += Nerrs;
+                        Tbits += Nbitsperframe;
+                    }
+                    
+                    if (frame_count >= NDISCARD) {
+                        Terrs2 += Nerrs;
+                        Tbits2 += Nbitsperframe;
                     }
+                    #endif
                 }
                 
-                fprintf(stderr, "\n");
-        
-                iter = run_ldpc_decoder(&ldpc, out_char, llr, &parityCheckCount);
-                
                 fprintf(stderr, "iter: %d parityCheckCount: %d\n", iter, parityCheckCount);
-                  /*
-                  for(i=0; i<CODED_BITSPERFRAME; i++) {
-                  fprintf(stderr, "%d ", out_char[i]);
-                  }
-                  */
 
                 fwrite(llr, sizeof(double), CODED_BITSPERFRAME, fout);