commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r3404 - gnuradio/branches/developers/michaelld/wip/gr-


From: michaelld
Subject: [Commit-gnuradio] r3404 - gnuradio/branches/developers/michaelld/wip/gr-error-correcting-codes/src/lib/libecc
Date: Thu, 24 Aug 2006 13:03:49 -0600 (MDT)

Author: michaelld
Date: 2006-08-24 13:03:49 -0600 (Thu, 24 Aug 2006)
New Revision: 3404

Modified:
   
gnuradio/branches/developers/michaelld/wip/gr-error-correcting-codes/src/lib/libecc/decoder_viterbi.cc
   
gnuradio/branches/developers/michaelld/wip/gr-error-correcting-codes/src/lib/libecc/decoder_viterbi.h
Log:
Starting methods to determine the # of inputs required for a desired #
of outputs, and vice versa, for the viterbi decoders.



Modified: 
gnuradio/branches/developers/michaelld/wip/gr-error-correcting-codes/src/lib/libecc/decoder_viterbi.cc
===================================================================
--- 
gnuradio/branches/developers/michaelld/wip/gr-error-correcting-codes/src/lib/libecc/decoder_viterbi.cc
      2006-08-24 18:50:19 UTC (rev 3403)
+++ 
gnuradio/branches/developers/michaelld/wip/gr-error-correcting-codes/src/lib/libecc/decoder_viterbi.cc
      2006-08-24 19:03:49 UTC (rev 3404)
@@ -42,7 +42,7 @@
 (const encoder_convolutional* encoder,
  u_int8_t sample_precision,
  bool full_or_partial,
- u_int32_t n_bits_before_decode)
+ u_int32_t n_inputs_before_decode)
 {
   // make sure that the encoder is "valid"
 
@@ -87,10 +87,10 @@
     size_t total_block_size_bits = d_block_size_bits;
     if (d_do_termination == true)
       total_block_size_bits += d_n_bits_to_term;
-    if (n_bits_before_decode >= total_block_size_bits) {
+    if (n_inputs_before_decode >= total_block_size_bits) {
       std::cout << "decoder_viterbi:: Warning: Provided # of bit-time "
        "inputs to process before decoding one bit (" <<
-       n_bits_before_decode << ") is larger than the total block size "
+       n_inputs_before_decode << ") is larger than the total block size "
        "including any termination bits (" << total_block_size_bits <<
        ").  Reverting to full block decoding.\n";
     }
@@ -99,16 +99,16 @@
 
   d_do_full_or_partial = full_or_partial;
 
-  if ((n_bits_before_decode == 0) &
+  if ((n_inputs_before_decode == 0) &
       (d_do_full_or_partial == G_LIBECC_DECODE_PARTIAL)) {
 
     // set the number of bits to 5.3 constraint lengths, rounded up
-    n_bits_before_decode =
+    n_inputs_before_decode =
       (size_t) ceilf (((float) 5.3) *
                      (((float) d_trellis->total_n_delays ()) + 1));
   }
 
-  d_n_bits_before_decode = n_bits_before_decode;
+  d_n_inputs_before_decode = n_inputs_before_decode;
 
   if (d_do_full_or_partial == G_LIBECC_DECODE_FULL) {
     // full block decoding checks
@@ -144,7 +144,7 @@
     // set the total number of encoder-output bits per stream for full
     // block processing, this is the block size + any termination bits
 
-    d_total_n_inputs_per_stream = d_n_bits_before_decode;
+    d_total_n_inputs_per_stream = d_n_inputs_before_decode;
 
     // create the state trellis; for partial, use the total # of
     // time-bits to decode + 1: each set of inputs is represented by a
@@ -172,7 +172,7 @@
       "do_full_or_partial   = " <<
       ((d_do_full_or_partial == G_LIBECC_DECODE_FULL) ?
        "full" : "partial") << "\n" <<
-      "n_bits_before_decode = " << d_n_bits_before_decode << "\n"
+      "n_inputs_before_decode = " << d_n_inputs_before_decode << "\n"
       "total_n_nodes_to_alloc    = " << d_total_n_nodes_to_alloc << "\n"
       "total_n_inputs_per_stream = " << d_total_n_inputs_per_stream << "\n"
       "n_state_trellis_time_bits = " << d_n_state_trellis_time_bits << "\n";
@@ -201,21 +201,21 @@
 
     // stream decoding: generally 1:1, excluding those first few bits
 
-    if (d_total_n_dec_bits < d_n_bits_before_decode) {
+    if (d_total_n_dec_bits < d_n_inputs_before_decode) {
 
-      // still in the first d_n_bits_before_decode input items;
+      // still in the first d_n_inputs_before_decode input items;
 
-      if ((d_total_n_dec_bits + n_output_bits) < d_n_bits_before_decode) {
+      if ((d_total_n_dec_bits + n_output_bits) < d_n_inputs_before_decode) {
 
-       // request is still within the first d_n_bits_before_decode;
+       // request is still within the first d_n_inputs_before_decode;
 
-               n_input_items += (d_n_bits_before_decode -
+               n_input_items += (d_n_inputs_before_decode -
                          (d_total_n_dec_bits + n_output_bits));
       } else {
 
-       // request is outside the first d_n_bits_before_decode;
+       // request is outside the first d_n_inputs_before_decode;
 
-       n_input_items += (d_n_bits_before_decode - d_total_n_dec_bits);
+       n_input_items += (d_n_inputs_before_decode - d_total_n_dec_bits);
       }
     }
   } else {
@@ -224,7 +224,9 @@
 
     if (d_do_full_or_partial == G_LIBECC_DECODE_PARTIAL) {
 
-      // for partial, depends on many properties
+      // for partial, depends on the block length, the number of
+      // inputs before decoding a single bit, and termination.  It's
+      // complicated.
 
     } else {
 
@@ -349,10 +351,11 @@
 #endif
 }
 
+// for instantiation of the 2 most common templates, for inclusion in
+// the library.  Add other instantiations here.
+
 template
 class decoder_viterbi<float>;
-// ::decode_private();
 
 template
 class decoder_viterbi<unsigned long>;
-//::decode_private();

Modified: 
gnuradio/branches/developers/michaelld/wip/gr-error-correcting-codes/src/lib/libecc/decoder_viterbi.h
===================================================================
--- 
gnuradio/branches/developers/michaelld/wip/gr-error-correcting-codes/src/lib/libecc/decoder_viterbi.h
       2006-08-24 18:50:19 UTC (rev 3403)
+++ 
gnuradio/branches/developers/michaelld/wip/gr-error-correcting-codes/src/lib/libecc/decoder_viterbi.h
       2006-08-24 19:03:49 UTC (rev 3404)
@@ -74,7 +74,7 @@
   //    output time-bit.  Requires less memory than full block
   //    decoding, but also more bookkeeping for each output bit.
   //
-  // n_bits_before_decode: For partial decoding only; will be ignored
+  // n_inputs_before_decode: For partial decoding only; will be ignored
   // for full block decoding.  The number of time-metrics (code output
   // bits) to process before deciding on an output bit.
   //    0: use 5.3 constriant-length bits
@@ -83,7 +83,7 @@
   decoder_viterbi (const encoder_convolutional* encoder,
                   u_int8_t sample_precision = 10,
                   bool full_or_partial = G_LIBECC_DECODE_PARTIAL,
-                  u_int32_t n_bits_before_decode = 0);
+                  u_int32_t n_inputs_before_decode = 0);
 
   virtual ~decoder_viterbi () {};
 
@@ -164,7 +164,7 @@
   size_t d_n_states, d_n_input_combinations, d_n_bits_to_term;
   size_t d_states_ndx, d_total_n_nodes_to_alloc, d_n_dec_bits;
   size_t d_n_code_outputs, d_n_code_inputs;
-  size_t d_n_state_trellis_time_bits, d_n_bits_before_decode;
+  size_t d_n_state_trellis_time_bits, d_n_inputs_before_decode;
   bool d_do_termination, d_do_streaming, d_do_full_or_partial;
 
   // for termination, need to keep around the current and next term





reply via email to

[Prev in Thread] Current Thread [Next in Thread]