47 errors(0), corrects(0) {}
52 - ignorefirst - ignorelast;
56 if (
in1(
i + ignorefirst) ==
in2(
i + ignorefirst + delay)) {
66 if (
in1(
i + ignorefirst - delay) ==
in2(
i + ignorefirst)) {
109 std::cout.setf(std::ios::fixed);
110 std::cout << std::endl
111 <<
"==================================" << std::endl
112 <<
" Bit Error Counter Report " << std::endl
113 <<
"==================================" << std::endl
114 <<
" Ignore First = " << ignorefirst << std::endl
115 <<
" Ignore Last = " << ignorelast << std::endl
116 <<
" Delay = " << delay << std::endl
117 <<
" Number of counted bits = " << std::setprecision(0)
118 << (errors + corrects) << std::endl
119 <<
" Number of errors = " << std::setprecision(0)
120 << errors << std::endl
121 <<
"==================================" << std::endl
122 <<
" Error rate = " << std::setprecision(8)
123 << (errors / (errors + corrects)) << std::endl
124 <<
"==================================" << std::endl << std::endl;
162 errors(0), corrects(0) {}
178 "BLERC::count(): Block size has to be setup before counting errors.");
181 "BLERC::count(): Block size must not be longer than input vectors.");
185 for (
int j = 0;
j < blocksize;
j++) {
186 if (
in1(
i * blocksize +
j) !=
in2(
i * blocksize +
j)) {
Array< T > mid(int pos, int n) const
Get n elements of the array starting from pos.
int length() const
Returns the number of data elements in the array object.
void report() const
Writes an error report.
void count(const bvec &in1, const bvec &in2)
Cumulative error counter.
void estimate_delay(const bvec &in1, const bvec &in2, int mindelay=-100, int maxdelay=100)
Run this member function if the delay between in1 and in2 is unknown.
static double count_errors(const bvec &in1, const bvec &in2, int indelay=0, int inignorefirst=0, int inignorelast=0)
static function to allow simple and fast count of bit-errors
BERC(int indelay=0, int inignorefirst=0, int inignorelast=0)
Constructor for the berc class.
void set_blocksize(int inblocksize, bool clear=true)
Set the block size.
void clear()
Clear the block error counter.
BLERC(void)
Class constructor.
void count(const bvec &in1, const bvec &in2)
Calculate the number of block errors between in1 and in2.
Definitions of converters between different vector and matrix types.
Definitions of Bit Error Rate Counter (BERC) and BLock Error Rate Counter (BLERC) classes.
#define it_assert(t, s)
Abort if t is not true.
T sum(const Vec< T > &v)
Sum of all elements in the vector.
Various functions on vectors and matrices - header file.
vec to_vec(const Vec< T > &v)
Converts a Vec<T> to vec.
Mat< Num_T > elem_mult(const Mat< Num_T > &m1, const Mat< Num_T > &m2)
Element wise multiplication of two matrices.