In this example we will show how to use the convolutional encoder/decoder class in it++. The Viterbi decoder uses the soft received values.
using std::cout;
using std::endl;
{
Ec = 1.0;
RNG_randomize();
cout <<
"Now simulating point " << p + 1 <<
" out of " <<
EbN0dB.
length() << endl;
cout <<
"Breaking on point " << p + 1 <<
" with " <<
berc.get_errors() <<
" errors." << endl;
break;
}
}
}
cout <<
"BER = " <<
ber << endl;
cout <<
"EbN0dB = " <<
EbN0dB << endl;
return 0;
}
Ordinary AWGN Channel for cvec or vec inputs and outputs.
void set_size(int n, bool copy=false)
Resizing an Array<T>.
int length() const
Returns the number of data elements in the array object.
Bit Error Rate Counter (BERC) Class.
BPSK modulator with real symbols.
void modulate_bits(const bvec &bits, vec &output) const
Modulate bits into BPSK symbols in complex domain.
Binary Convolutional rate 1/n class.
Include file for the IT++ communications module.
When you run this program, the output will look something like this:
Now simulating point 1 out of 5
Breaking on point 1 with 3297 errors.
Now simulating point 2 out of 5
Breaking on point 2 with 781 errors.
Now simulating point 3 out of 5
Breaking on point 3 with 112 errors.
Now simulating point 4 out of 5
Now simulating point 5 out of 5
BER = [0.330858 0.0783743 0.00280983 0 0]
EbN0dB = [-2 0 2 4 6]