IT++ Logo

error_counters.h

Go to the documentation of this file.
00001 
00031 #ifndef ERROR_COUNTERS_H
00032 #define ERROR_COUNTERS_H
00033 
00034 #include <itpp/base/vec.h>
00035 
00036 
00037 namespace itpp {
00038 
00066   class BERC {
00067   public:
00078     BERC(int indelay = 0, int inignorefirst = 0, int inignorelast = 0);
00080     void count(const bvec &in1, const bvec &in2);
00083     void estimate_delay(const bvec &in1, const bvec &in2, int mindelay = -100,
00084       int maxdelay = 100);
00086     void clear() { errors = 0; corrects = 0; }
00088     void report();
00090     int get_delay() { return delay; }
00092     double get_errors() { return errors; }
00094     double get_corrects() { return corrects; }
00096     double get_total_bits() { return (errors+corrects); }
00098     double get_errorrate() { return (errors / (corrects + errors)); }
00109     static double count_errors(const bvec &in1, const bvec &in2,
00110              int indelay = 0, int inignorefirst = 0,
00111              int inignorelast = 0);
00112 
00113   private:
00114     int delay;
00115     int ignorefirst;
00116     int ignorelast;
00117     double errors;
00118     double corrects;
00119   };
00120 
00126   class BLERC {
00127   public:
00129     BLERC(void);
00131     BLERC(int blocksize);
00133     void set_blocksize(int inblocksize, bool clear = true);
00135     void count(const bvec &in1, const bvec &in2);
00137     void clear() { errors = 0; corrects = 0; }
00139     double get_errors() { return errors; }
00141     double get_corrects() { return corrects; }
00143     double get_total_blocks() { return (errors+corrects); }
00145     double get_errorrate() { return (errors / (corrects + errors)); }
00146 
00147     //protected:
00148   private:
00149     bool setup_done;
00150     int blocksize;
00151     double errors;
00152     double corrects;
00153     bool CORR;
00154   };
00155 
00156 } // namespace itpp
00157 
00158 #endif // #ifndef ERROR_COUNTERS_H
SourceForge Logo

Generated on Sun Sep 14 18:52:35 2008 for IT++ by Doxygen 1.5.6