IT++ Logo
Public Member Functions | Static Public Member Functions | List of all members
itpp::BERC Class Reference

Bit Error Rate Counter (BERC) Class. More...

#include <itpp/comm/error_counters.h>

Public Member Functions

 BERC (int indelay=0, int inignorefirst=0, int inignorelast=0)
 Constructor for the berc class.
 
void count (const bvec &in1, const bvec &in2)
 Cumulative error counter.
 
void count (const bool x)
 Variant of the cumulative error counter. Counts a bit error if x is true, and a correct bit otherwise.
 
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.
 
void clear ()
 Clears the bit error counter.
 
void report () const
 Writes an error report.
 
int get_delay () const
 Return the delay, assumed or estimated, between in1 and in2.
 
double get_errors () const
 Returns the counted number of bit errors.
 
double get_corrects () const
 Returns the counted number of corectly received bits.
 
double get_total_bits () const
 Returns the total number of bits processed.
 
double get_errorrate () const
 Returns the estimated bit error rate.
 

Static Public Member Functions

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
 

Detailed Description

Bit Error Rate Counter (BERC) Class.

Example:

#include <itpp/itcomm.h>
int main() {
//Initiate the Bit Error Counter
//Initiate a Binary Symetric Channel with cross-over probability 0.1
bvec transmitted_bits = randb(100);
//Count the number of bit errors
cout << "Estimated bit error probability is " << berc.get_errorrate()
<< endl;
return 0;
}
General array class.
Definition array.h:105
Bit Error Rate Counter (BERC) Class.
A Binary Symetric Channel with crossover probability p.
Definition channel.h:1038
bin randb(void)
Generates a random bit (equally likely 0s and 1s)
Definition random.h:793
Include file for the IT++ communications module.

Definition at line 67 of file error_counters.h.

Constructor & Destructor Documentation

◆ BERC()

itpp::BERC::BERC ( int  indelay = 0,
int  inignorefirst = 0,
int  inignorelast = 0 
)

Constructor for the berc class.

  • delay is positive if in2 is a delayed replica of in1 and negative otherwise.
  • ignorefirst and ignorelast may be used if errors in the begining and/or the end is to be ignored.

Definition at line 45 of file error_counters.cpp.

Member Function Documentation

◆ count() [1/2]

void itpp::BERC::count ( const bvec &  in1,
const bvec &  in2 
)

Cumulative error counter.

Definition at line 49 of file error_counters.cpp.

References itpp::Array< T >::length().

◆ count() [2/2]

void itpp::BERC::count ( const bool  x)

Variant of the cumulative error counter. Counts a bit error if x is true, and a correct bit otherwise.

Definition at line 76 of file error_counters.cpp.

◆ estimate_delay()

void itpp::BERC::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.

Definition at line 85 of file error_counters.cpp.

References itpp::elem_mult(), itpp::Array< T >::length(), itpp::Array< T >::mid(), itpp::sum(), and itpp::to_vec().

◆ clear()

void itpp::BERC::clear ( )
inline

Clears the bit error counter.

Definition at line 91 of file error_counters.h.

◆ report()

void itpp::BERC::report ( ) const

Writes an error report.

Definition at line 107 of file error_counters.cpp.

◆ get_delay()

int itpp::BERC::get_delay ( ) const
inline

Return the delay, assumed or estimated, between in1 and in2.

Definition at line 95 of file error_counters.h.

◆ get_errors()

double itpp::BERC::get_errors ( ) const
inline

Returns the counted number of bit errors.

Definition at line 97 of file error_counters.h.

◆ get_corrects()

double itpp::BERC::get_corrects ( ) const
inline

Returns the counted number of corectly received bits.

Definition at line 99 of file error_counters.h.

◆ get_total_bits()

double itpp::BERC::get_total_bits ( ) const
inline

Returns the total number of bits processed.

Definition at line 101 of file error_counters.h.

◆ get_errorrate()

double itpp::BERC::get_errorrate ( ) const
inline

Returns the estimated bit error rate.

Definition at line 103 of file error_counters.h.

◆ count_errors()

double itpp::BERC::count_errors ( const bvec &  in1,
const bvec &  in2,
int  indelay = 0,
int  inignorefirst = 0,
int  inignorelast = 0 
)
static

static function to allow simple and fast count of bit-errors

Returns the number of errors between in1 and in2. Typical usage:

bvec in1 = randb(100);
bvec in2 = randb(100);
double errors = BERC::count_errors(in1, in2);
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

Definition at line 127 of file error_counters.cpp.

References itpp::Array< T >::length().


The documentation for this class was generated from the following files:
SourceForge Logo

Generated on Mon Jun 10 2024 11:49:33 for IT++ by Doxygen 1.9.8