EXIT chart of PCCCs

This program computes the EXtrinsic Information Transfer (EXIT) chart for Parallel Concatenated Convolutional Codes (PCCCs) of coding rate 1/3. Actually the Transfer Characteristics (TCs) of the two SISO RSC modules used in the turbo decoder are computed at a given Signal to Noise Ratio (SNR).

Reference: S. ten Brink, ''Convergence behavior of iteratively decoded parallel concatenated codes,`` IEEE Transactions on Communications, vol. 49, pp. 1727-1737, Oct. 2001

#include "itpp/itcomm.h"
using namespace itpp;
using std::cout;
using std::endl;
using std::string;
int main(void)
{
//general parameters
vec sigmaA = "0.01:0.1:7";//standard deviation (sqrt(variance)) of the mutual a priori information
double threshold_value = 50;
string map_metric = "maxlogMAP";
ivec gen = "07 05";//octal form
int constraint_length = 3;
int nb_blocks_lim = 10;
int perm_len = int(itpp::pow10(5.0));//total number of bits in a block (with tail)
double EbN0_dB = 0.6;
double R = 1.0 / 3.0;//coding rate of PCCC
double Ec = 1.0;//coded bit energy
//other parameters
vec sigma2A = sqr(sigmaA);
int sigma2A_len = sigma2A.length();
int nb_bits = perm_len - (constraint_length - 1);//number of bits in a block (without tail)
double sigma2 = (0.5 * Ec / R) * pow(inv_dB(EbN0_dB), -1.0);//N0/2
double Lc = -2 / sigma2;//normalisation factor for intrinsic information (take into account the BPSK modulation)
bvec bits(nb_bits);
bvec tail;
bvec bits_tail(perm_len);
bmat parity_bits;
int coded_bits_len = 2 * perm_len;
bvec coded_bits(coded_bits_len);
vec mod_bits(coded_bits_len);
vec rec_sig(coded_bits_len);
vec intrinsic_coded(coded_bits_len);
vec intrinsic_coded_p(2*nb_bits);
intrinsic_coded_p.zeros();
vec apriori_data(perm_len);
vec extrinsic_coded;
vec extrinsic_data;
vec apriori_mutual_info(sigma2A_len);
vec extrinsic_mutual_info(sigma2A_len);
vec extrinsic_mutual_info_p(sigma2A_len);
extrinsic_mutual_info.zeros();
extrinsic_mutual_info_p.zeros();
register int en, n, nb_blocks;
//Recursive Systematic Convolutional Code
Rec_Syst_Conv_Code rsc;
rsc.set_generator_polynomials(gen, constraint_length);//initial state should be the zero state
//BPSK modulator
BPSK bpsk;
//AWGN channel
AWGN_Channel channel;
channel.set_noise(sigma2);
//SISO module
SISO siso;
siso.set_generators(gen, constraint_length);
siso.set_map_metric(map_metric);
//EXIT chart
EXIT exit;
//Randomize generators
RNG_randomize();
//main loop
for (en = 0;en < sigma2A_len;en++) {
apriori_mutual_info(en) = exit.apriori_mutual_info(sigma2A(en));//a priori mutual info
cout << "I_A = " << apriori_mutual_info(en) << endl;
for (nb_blocks = 0;nb_blocks < nb_blocks_lim;nb_blocks++) {
//bits generation
bits = randb(nb_bits);
//RSC code
rsc.encode_tail(bits, tail, parity_bits);//tail is added
//form coder output
bits_tail = concat(bits, tail);
for (n = 0;n < perm_len;n++) {
coded_bits(2*n) = bits_tail(n);//systematic output
coded_bits(2*n + 1) = parity_bits(n, 0);//parity output
}
//BPSK modulation (1->-1,0->+1)
mod_bits = bpsk.modulate_bits(coded_bits);
//AWGN channel
rec_sig = channel(mod_bits);
//first SISO RSC module (tail is added)
//intrinsic info. of coded bits
intrinsic_coded = Lc * rec_sig;
//a priori info. of data bits
apriori_data = exit.generate_apriori_info(bits_tail);
//SISO RSC module
siso.rsc(extrinsic_coded, extrinsic_data, intrinsic_coded, apriori_data, true);
//threshold
extrinsic_data = SISO::threshold(extrinsic_data, threshold_value);
//extrinsic mutual info
extrinsic_mutual_info(en) += exit.extrinsic_mutual_info(extrinsic_data.left(nb_bits), bits);
//second SISO RSC module (no tail added)
//intrinsic info. of coded bits
for (n = 0;n < nb_bits;n++)
intrinsic_coded_p(2*n + 1) = Lc * rec_sig(2 * n + 1);//parity bits only
//a priori info. of data bits
apriori_data = exit.generate_apriori_info(bits);
//SISO RSC module
siso.rsc(extrinsic_coded, extrinsic_data, intrinsic_coded_p, apriori_data, false);
//threshold
extrinsic_data = SISO::threshold(extrinsic_data, threshold_value);
//extrinsic mutual info
extrinsic_mutual_info_p(en) += exit.extrinsic_mutual_info(extrinsic_data, bits);
}//end blocks (while loop)
//mean extrinsic mutual info over all blocks
extrinsic_mutual_info(en) /= nb_blocks_lim;
extrinsic_mutual_info_p(en) /= nb_blocks_lim;
}
it_file ff("exit_pccc.it");
ff << Name("IA") << apriori_mutual_info;
ff << Name("IE") << extrinsic_mutual_info;
ff << Name("IE_p") << extrinsic_mutual_info_p;
ff << Name("EbN0_dB") << EbN0_dB;
ff << Name("gen") << gen;
ff << Name("R") << R;
ff << Name("perm_len") << perm_len;
ff << Name("nb_blocks_lim") << nb_blocks_lim;
ff.close();
return 0;
}
itpp::AWGN_Channel
Ordinary AWGN Channel for cvec or vec inputs and outputs.
Definition channel.h:1089
itpp::Array
General array class.
Definition array.h:105
itpp::Array::left
Array< T > left(int n) const
Get n left elements of the array.
Definition array.h:357
itpp::Array::length
int length() const
Returns the number of data elements in the array object.
Definition array.h:157
itpp::BPSK
BPSK modulator with real symbols.
Definition modulator.h:877
itpp::BPSK::modulate_bits
void modulate_bits(const bvec &bits, vec &output) const
Modulate bits into BPSK symbols in complex domain.
Definition modulator.cpp:310
itpp::EXIT
EXtrinsic Information Transfer (EXIT) chart.
Definition exit.h:56
itpp::Name
Automatic naming when saving.
Definition itfile.h:429
itpp::Rec_Syst_Conv_Code
A Recursive Systematic Convolutional Encoder/Decoder class.
Definition rec_syst_conv_code.h:52
itpp::Rec_Syst_Conv_Code::set_generator_polynomials
void set_generator_polynomials(const ivec &gen, int constraint_length)
Set generator polynomials.
Definition rec_syst_conv_code.cpp:69
itpp::Rec_Syst_Conv_Code::encode_tail
void encode_tail(const bvec &input, bvec &tail, bmat &parity_bits)
Encode a binary vector of inputs and also adds a tail of K-1 zeros to force the encoder into the zero...
Definition rec_syst_conv_code.cpp:124
itpp::SISO
Soft Input Soft Output (SISO) modules.
Definition siso.h:72
itpp::it_file
The IT++ file format reading and writing class.
Definition itfile.h:246
itpp::pow10
double pow10(double x)
Calculate ten to the power of x (10^x)
Definition log_exp.h:68
itcomm.h
Include file for the IT++ communications module.
bmat
Mat< bin > bmat
bin matrix
Definition mat.h:508
itpp
itpp namespace
Definition itmex.h:37

When you run this program, the results (mutual a priori and extrinsic information, EbN0_dB, etc.) are saved into exit_pccc.it file. Using the following MATLAB script

clear all
itload('exit_pccc.it')
plot(IA, IE, 'LineWidth', 3)
hold on
plot(IE_p, IA, 'LineWidth', 3)
xlabel('I_A^{(up)}, I_E^{(low)}')
ylabel('I_E^{(up)}, I_A^{(low)}')
grid on
title(['E_b/N_0 = ' num2str(EbN0_dB) ' dB'])
itpp::dB
double dB(double x)
Decibel of x (10*log10(x))
Definition log_exp.h:71

the EXIT chart can be displayed.

Generated on Mon Apr 22 2024 09:45:27 for IT++ by Doxygen 1.9.8