IT++ Logo Newcom Logo

itpp::BERC Class Reference

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

#include <itpp/comm/error_counters.h>

List of all members.

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 estimate_delay (const bvec &in1, const bvec &in2, int mindelay=-100, int maxdelay=100)
void clear ()
 Clears the bit error counter.
void report ()
 Writes an error report.
int get_delay ()
 Return the delay, assumed or estimated, between in1 and in2.
double get_errors ()
 Returns the counted number of bit errors.
double get_corrects ()
 Returns the counted number of corectly received bits.
double get_errorrate ()
 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
      BERC berc;

      //Initiate a Binary Symetric Channel with cross-over probability 0.1
      BSC binary_symetric_channel(0.1);
  
      bvec transmitted_bits = randb(100);
      bvec received_bits = binary_symetric_channel(transmitted_bits);

      //Count the number of bit errors
      berc.count(transmitted_bits, received_bits);

      cout << "Estimated bit error probability is " << berc.get_errorrate() 
           << endl;

      return 0;
    } 

Definition at line 69 of file error_counters.h.


Constructor & Destructor Documentation

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

Constructor for the berc class.

Definition at line 48 of file error_counters.cpp.


Member Function Documentation

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

Cumulative error counter.

Definition at line 57 of file error_counters.cpp.

References itpp::abs(), and min.

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 86 of file error_counters.cpp.

References itpp::abs(), itpp::elem_mult(), min, itpp::sum(), and itpp::to_vec().

void itpp::BERC::clear (  )  [inline]

Clears the bit error counter.

Definition at line 89 of file error_counters.h.

void itpp::BERC::report (  ) 

Writes an error report.

Definition at line 112 of file error_counters.cpp.

int itpp::BERC::get_delay (  )  [inline]

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

Definition at line 93 of file error_counters.h.

double itpp::BERC::get_errors (  )  [inline]

Returns the counted number of bit errors.

Definition at line 95 of file error_counters.h.

double itpp::BERC::get_corrects (  )  [inline]

Returns the counted number of corectly received bits.

Definition at line 97 of file error_counters.h.

double itpp::BERC::get_errorrate (  )  [inline]

Returns the estimated bit error rate.

Definition at line 99 of file error_counters.h.

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);

Definition at line 132 of file error_counters.cpp.

References itpp::abs(), and min.


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

Generated on Sat Aug 25 23:37:30 2007 for IT++ by Doxygen 1.5.2