IT++ Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
35 
36 namespace itpp
37 {
38 
66 class BERC
67 {
68 public:
79  BERC(int indelay = 0, int inignorefirst = 0, int inignorelast = 0);
81  void count(const bvec &in1, const bvec &in2);
84  void estimate_delay(const bvec &in1, const bvec &in2, int mindelay = -100,
85  int maxdelay = 100);
87  void clear() { errors = 0; corrects = 0; }
89  void report() const;
91  int get_delay() const { return delay; }
93  double get_errors() const { return errors; }
95  double get_corrects() const { return corrects; }
97  double get_total_bits() const { return (errors + corrects); }
99  double get_errorrate() const { return (errors / (corrects + errors)); }
110  static double count_errors(const bvec &in1, const bvec &in2,
111  int indelay = 0, int inignorefirst = 0,
112  int inignorelast = 0);
113 
114 private:
115  int delay;
116  int ignorefirst;
117  int ignorelast;
118  double errors;
119  double corrects;
120 };
121 
127 class BLERC
128 {
129 public:
131  BLERC(void);
133  BLERC(int blocksize);
135  void set_blocksize(int inblocksize, bool clear = true);
137  void count(const bvec &in1, const bvec &in2);
139  void clear() { errors = 0; corrects = 0; }
141  double get_errors() const { return errors; }
143  double get_corrects() const { return corrects; }
145  double get_total_blocks() const { return (errors + corrects); }
147  double get_errorrate() const { return (errors / (corrects + errors)); }
148 
149  //protected:
150 private:
151  bool setup_done;
152  int blocksize;
153  double errors;
154  double corrects;
155  bool CORR;
156 };
157 
158 } // namespace itpp
159 
160 #endif // #ifndef ERROR_COUNTERS_H
SourceForge Logo

Generated on Fri Mar 21 2014 17:14:13 for IT++ by Doxygen 1.8.1.2