This program simulates the performance of LDPC codes on the AWGN channel. Since the channel is symmetric, the zero codeword is used.
#include <sstream>
{
it_info(
"Usage: " <<
argv[0] <<
" codec_file.it [EbN0_dB]");
return 1;
}
double x;
}
cout <<
"Running with Eb/N0: " <<
EbN0db << endl;
C.set_exit_conditions(2500);
cout << C << endl;
int N = C.get_nvar();
double N0 =
pow(10.0, -
EbN0db(
j) / 10.0) / C.get_rate();
ferc.set_blocksize(C.get_nvar() - C.get_ncheck());
cout <<
"Eb/N0 = " <<
EbN0db(
j) <<
" Simulated "
<<
ferc.get_total_blocks() <<
" frames and "
<<
berc.get_total_bits() <<
" bits. "
<<
"Obtained " <<
berc.get_errors() <<
" bit errors. "
<<
" BER: " <<
berc.get_errorrate()
<<
" FER: " <<
ferc.get_errorrate() << endl <<
flush;
}
else {
break;
}
}
cout <<
"Eb/N0 = " <<
EbN0db(
j) <<
" Simulated "
<<
ferc.get_total_blocks() <<
" frames and "
<<
berc.get_total_bits() <<
" bits. "
<<
"Obtained " <<
berc.get_errors() <<
" bit errors. "
<<
" BER: " <<
berc.get_errorrate()
<<
" FER: " <<
ferc.get_errorrate() << endl <<
flush;
break;
}
return 0;
}
Ordinary AWGN Channel for cvec or vec inputs and outputs.
Bit Error Rate Counter (BERC) Class.
Class for counting block error rates.
BPSK modulator with real symbols.
Low-density parity check (LDPC) codec.
Systematic LDPC Generator class.
#define it_info(s)
Print information message.
it_file & flush(it_file &f)
Flush operator.
vec pow(const double x, const vec &y)
Calculates x to the power of y (x^y)
int length(const Vec< T > &v)
Length of vector.
void RNG_randomize()
Set a random seed for all Random Number Generators in the current thread.
ITPP_EXPORT bvec zeros_b(int size)
A Binary vector of zeros.
Include file for the IT++ communications module.
To simulate the code "RU_10000.it" over a range of SNR (see Generation of LDPC codes for how to generate codec)
./ldpc_bersim_awgn RU_10000.it
To simulate at Eb/N0=1.1 dB
./ldpc_bersim_awgn RU_10000.it 1.1