IT++ Logo
error_counters.h
Go to the documentation of this file.
1 
30 #ifndef ERROR_COUNTERS_H
31 #define ERROR_COUNTERS_H
32 
33 #include <itpp/base/vec.h>
34 #include <itpp/itexports.h>
35 
36 
37 namespace itpp
38 {
39 
67 class ITPP_EXPORT BERC
68 {
69 public:
80  BERC(int indelay = 0, int inignorefirst = 0, int inignorelast = 0);
82  void count(const bvec &in1, const bvec &in2);
85  void count(const bool x);
88  void estimate_delay(const bvec &in1, const bvec &in2, int mindelay = -100,
89  int maxdelay = 100);
91  void clear() { errors = 0; corrects = 0; }
93  void report() const;
95  int get_delay() const { return delay; }
97  double get_errors() const { return errors; }
99  double get_corrects() const { return corrects; }
101  double get_total_bits() const { return (errors + corrects); }
103  double get_errorrate() const { return (errors / (corrects + errors)); }
114  static double count_errors(const bvec &in1, const bvec &in2,
115  int indelay = 0, int inignorefirst = 0,
116  int inignorelast = 0);
117 
118 private:
119  int delay;
120  int ignorefirst;
121  int ignorelast;
122  double errors;
123  double corrects;
124 };
125 
131 class ITPP_EXPORT BLERC
132 {
133 public:
135  BLERC(void);
137  BLERC(int blocksize);
139  void set_blocksize(int inblocksize, bool clear = true);
141  void count(const bvec &in1, const bvec &in2);
144  void count(const bool x);
146  void clear() { errors = 0; corrects = 0; }
148  double get_errors() const { return errors; }
150  double get_corrects() const { return corrects; }
152  double get_total_blocks() const { return (errors + corrects); }
154  double get_errorrate() const { return (errors / (corrects + errors)); }
155 
156  //protected:
157 private:
158  bool setup_done;
159  int blocksize;
160  double errors;
161  double corrects;
162  bool CORR;
163 };
164 
165 } // namespace itpp
166 
167 #endif // #ifndef ERROR_COUNTERS_H
SourceForge Logo

Generated on Sat Jul 6 2013 10:54:22 for IT++ by Doxygen 1.8.2