00001 00031 #ifndef ERROR_COUNTERS_H 00032 #define ERROR_COUNTERS_H 00033 00034 #include <itpp/base/vec.h> 00035 00036 00037 namespace itpp 00038 { 00039 00067 class BERC 00068 { 00069 public: 00080 BERC(int indelay = 0, int inignorefirst = 0, int inignorelast = 0); 00082 void count(const bvec &in1, const bvec &in2); 00085 void estimate_delay(const bvec &in1, const bvec &in2, int mindelay = -100, 00086 int maxdelay = 100); 00088 void clear() { errors = 0; corrects = 0; } 00090 void report() const; 00092 int get_delay() const { return delay; } 00094 double get_errors() const { return errors; } 00096 double get_corrects() const { return corrects; } 00098 double get_total_bits() const { return (errors + corrects); } 00100 double get_errorrate() const { return (errors / (corrects + errors)); } 00111 static double count_errors(const bvec &in1, const bvec &in2, 00112 int indelay = 0, int inignorefirst = 0, 00113 int inignorelast = 0); 00114 00115 private: 00116 int delay; 00117 int ignorefirst; 00118 int ignorelast; 00119 double errors; 00120 double corrects; 00121 }; 00122 00128 class BLERC 00129 { 00130 public: 00132 BLERC(void); 00134 BLERC(int blocksize); 00136 void set_blocksize(int inblocksize, bool clear = true); 00138 void count(const bvec &in1, const bvec &in2); 00140 void clear() { errors = 0; corrects = 0; } 00142 double get_errors() const { return errors; } 00144 double get_corrects() const { return corrects; } 00146 double get_total_blocks() const { return (errors + corrects); } 00148 double get_errorrate() const { return (errors / (corrects + errors)); } 00149 00150 //protected: 00151 private: 00152 bool setup_done; 00153 int blocksize; 00154 double errors; 00155 double corrects; 00156 bool CORR; 00157 }; 00158 00159 } // namespace itpp 00160 00161 #endif // #ifndef ERROR_COUNTERS_H
Generated on Thu Apr 23 20:06:41 2009 for IT++ by Doxygen 1.5.8