IT++ Logo Newcom Logo

error_counters.h

Go to the documentation of this file.
00001 
00034 #ifndef ERROR_COUNTERS_H
00035 #define ERROR_COUNTERS_H
00036 
00037 #include <itpp/base/vec.h>
00038 
00039 
00040 namespace itpp {
00041 
00069   class BERC {
00070   public:
00081     BERC(int indelay = 0, int inignorefirst = 0, int inignorelast = 0);
00083     void count(const bvec &in1, const bvec &in2);
00086     void estimate_delay(const bvec &in1, const bvec &in2, int mindelay = -100,
00087                         int maxdelay = 100);
00089     void clear() { errors = 0; corrects = 0; }
00091     void report();
00093     int get_delay() { return delay; }
00095     double get_errors() { return errors; }
00097     double get_corrects() { return corrects; }
00099     double get_errorrate() { return (errors / (corrects + errors)); }
00110     static double count_errors(const bvec &in1, const bvec &in2, 
00111                                int indelay = 0, int inignorefirst = 0, 
00112                                int inignorelast = 0);
00113 
00114   private:
00115     int delay;
00116     int ignorefirst;
00117     int ignorelast;
00118     double errors;
00119     double corrects;
00120   };
00121 
00127   class BLERC {
00128   public:
00130     BLERC(void);
00132     BLERC(int blocksize);
00134     void set_blocksize(int inblocksize, bool clear = true);
00136     void count(const bvec &in1, const bvec &in2);
00138     void clear() { errors = 0; corrects = 0; }
00140     double get_errors() { return errors; }
00142     double get_corrects() { return corrects; }
00144     double get_errorrate() { return (errors / (corrects + errors)); }
00145 
00146     //protected:
00147   private:
00148     bool setup_done;
00149     int blocksize;
00150     double errors;
00151     double corrects;
00152     bool CORR;
00153   };
00154 
00155 } // namespace itpp
00156 
00157 #endif // #ifndef ERROR_COUNTERS_H
SourceForge Logo

Generated on Sat Aug 25 23:40:26 2007 for IT++ by Doxygen 1.5.2