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
37namespace itpp
38{
39
67class ITPP_EXPORT BERC
68{
69public:
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
118private:
119 int delay;
120 int ignorefirst;
121 int ignorelast;
122 double errors;
123 double corrects;
124};
125
131class ITPP_EXPORT BLERC
132{
133public:
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:
157private:
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
Bit Error Rate Counter (BERC) Class.
double get_corrects() const
Returns the counted number of corectly received bits.
void clear()
Clears the bit error counter.
double get_errors() const
Returns the counted number of bit errors.
double get_errorrate() const
Returns the estimated bit error rate.
int get_delay() const
Return the delay, assumed or estimated, between in1 and in2.
double get_total_bits() const
Returns the total number of bits processed.
Class for counting block error rates.
double get_errorrate() const
Returns the block error rate.
double get_errors() const
Returns the number of block errors.
void clear()
Clear the block error counter.
double get_corrects() const
Returns the number of correct blocks.
double get_total_blocks() const
Returns the total number of block processed.
itpp namespace
Definition: itmex.h:37
Templated Vector Class Definitions.
SourceForge Logo

Generated on Tue Jan 24 2023 00:00:00 for IT++ by Doxygen 1.9.6