Exemple #1
0
void prof_burst::updateresults(libbase::vector<double>& result,
      const libbase::vector<int>& source, const libbase::vector<int>& decoded) const
   {
   assert(source.size() == get_symbolsperblock());
   assert(decoded.size() == get_symbolsperblock());
   // Update the relevant count for every symbol in error
   // Check the first symbol first
   assert(source(0) != fsm::tail);
   if (source(0) != decoded(0))
      result(0)++;
   // For each remaining symbol
   for (int t = 1; t < get_symbolsperblock(); t++)
      {
      if (source(t - 1) != decoded(t - 1))
         result(3)++;
      assert(source(t) != fsm::tail);
      if (source(t) != decoded(t))
         {
         // Keep separate counts, depending on whether the previous symbol was in error
         if (source(t - 1) != decoded(t - 1))
            result(2)++;
         else
            result(1)++;
         }
      }
   }
Exemple #2
0
/*!
 * \copydoc experiment::result_description()
 * 
 * The description is a string ER_X_Y, where 'X' is the symbol-error
 * count (starting at zero), and 'Y' is the iteration, starting at 1.
 */
std::string commsys_hist_symerr::result_description(int i) const
   {
   assert(i >= 0 && i < count());
   std::ostringstream sout;
   const int x = i % (get_symbolsperblock() + 1);
   const int y = (i / (get_symbolsperblock() + 1)) + 1;
   sout << "ER_" << x << "_" << y;
   return sout.str();
   }
Exemple #3
0
/*!
 * \copydoc experiment::get_multiplicity()
 * 
 * Since results are organized as (symbol,frame) error count, repeated for
 * every iteration, the multiplicity is respectively the number of symbols
 * and the number of frames (=1) per sample.
 */
int commsys_errorrates::get_multiplicity(int i) const
   {
   assert(i >= 0 && i < count());
   if (i % 2 == 0)
      return get_symbolsperblock();
   return 1;
   }
Exemple #4
0
/*!
 * \copydoc experiment::get_multiplicity()
 * 
 * Since results are organized as (symbol_hamming, symbol_levenshtein,frame)
 * error count, repeated for every iteration, the multiplicity is respectively
 * the number of symbols (twice) and the number of frames (=1) per sample.
 *
 * \warning In the case of Levenshtein distance, it is not clear how the
 * multiplicity should be computed.
 */
int commsys_errors_levenshtein::get_multiplicity(int i) const
   {
   assert(i >= 0 && i < count());
   switch(i % 3)
      {
      case 0:
      case 1:
         return get_symbolsperblock();
      case 2:
         return 1;
      }
   return -1; // This should never happen
   }