You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am interested in replicating the following command run by aff3ct.exe in a simple program that utilizes the aff3ct library (using the Factory module):
I am able to run my code for the 32-bit precision case as this is the default. It seems that there isn't any option to set the precision to the 8-bit and 16-bit case as I am not able to pass in the precision or quantizer parameters to the factory module. I have also tried changing the data type in the template but got prompted with an error when I execute the code. I would appreciate if I can receive some assistance regarding this matter.
As reference:
char arg0[] = "FactoryProject.exe";
// Encoder parameters
char E1Name[] = "-K";
char E1Value[] = "6144"; // info bits
char E2Name[] = "--enc-sub-std";
char E2Value[] = "LTE"; // standard: CCSDS, LTE
char E3Name[] = "--enc-sub-type";
char E3Value[] = "RSC"; // encoder type: AZCW, COSET, NO, RSC, USER
char E4Name[] = "--enc-type";
char E4Value[] = "TURBO";
// Decoder parameters
char D1Name[] = "--dec-implem";
char D1Value[] = "FAST"; // algo implementation: FAST, NAIVE, STD
char D2Name[] = "--dec-ite";
char D2Value[] = "6"; // no. of iterations
char D3Name[] = "--dec-sf-type";
char D3Value[] = "LTE"; // scaling factor: ADAPTIVE, ARRAY, CST, LTE, LTE_VEC
char D4Name[] = "--dec-sub-implem";
char D4Value[] = "VERY_FAST"; // algo implementation: FAST, GENERIC, NAIVE, STD, VERY_FAST
char D5Name[] = "--dec-sub-max";
char D5Value[] = "MAX"; // MAX implementation for the nodes: MAX, MAXL, MAXS
char D6Name[] = "--dec-sub-type";
char D6Value[] = "BCJR"; // decode algo: BCJR, CHASE, ML
char D7Name[] = "--dec-type";
char D7Value[] = "TURBO"; // decode algo: CHASE, ML, TURBO
char D8Name[] = "--dec-sub-simd";
char D8Value[] = "INTER";
char fName[] = "-F"; // noOfFrames
char fValue[] = "4";
// precision
char P1Name[] = "-p";
char P1Value[] = "32";
char Q1Name[] = "--qnt-type";
char Q1Value[] = "POW2";
char Q2Name[] = "--qnt-bits";
char Q2Value[] = "6";
char Q3Name[] = "--qnt-dec";
char Q3Value[] = "2"; // 2 for 8-bit, 3 for 16-bit
char* argList[] = { &arg0[0], &E1Name[0], &E1Value[0], &E2Name[0], &E2Value[0], &E3Name[0], &E3Value[0], &E4Name[0], &E4Value[0], &D1Name[0], &D1Value[0], &D2Name[0], &D2Value[0],
&D3Name[0], &D3Value[0], &D4Name[0], &D4Value[0], &D5Name[0], &D5Value[0], &D6Name[0], &D6Value[0], &D7Name[0], &D7Value[0],
&D8Name[0], &D8Value[0], // simd
//&P1Name[0], &P1Value[0], // precision
//&Q1Name[0], &Q1Value[0], &Q2Name[0], &Q2Value[0], &Q3Name[0], &Q3Value[0], // quantizer
&fName[0], &fValue[0], // number of frames
NULL };
const int n_frames = 4;
const int K = 6144; // number of information bits
const int N = K * 3 + 12; // codeword size
int seed = static_cast<unsigned>(std::chrono::system_clock::now().time_since_epoch().count()); // PRNG seed for the AWGN channel
float ebn0_min = 1.0f; // minimum SNR value
float ebn0_max = 1.01f; // maximum SNR value
float ebn0_step = 1.0f; // SNR step
float R = (float)K / (float)N; // code rate (R=K/N)
std::vector<tB> ref_bits = std::vector<tB>(K * n_frames);
std::vector<tB> enc_bits = std::vector<tB>(N * n_frames);
std::vector<tR> symbols = std::vector<tR>(N * n_frames);
std::vector<tR> noisy_symbols = std::vector<tR>(N * n_frames);
std::vector<tR> LLRs = std::vector<tR>(N * n_frames);
std::vector<tB> dec_bits = std::vector<tB>(K * n_frames);
std::unique_ptr<module::Source_random<tB>> source; // template <typename B = int>
std::unique_ptr<module::Modem_BPSK<tB, tR, tR>> modem; // template <typename B = int, typename R = float, typename Q = R>
std::unique_ptr<module::Channel_AWGN_LLR<tR>> channel; // template <typename R = float>
std::unique_ptr<tools::Sigma<tR>> noise; // a sigma noise type // template <typename R = float>
// create a sigma noise type
noise = std::unique_ptr<tools::Sigma<>>(new tools::Sigma<float>());
source = std::unique_ptr<module::Source_random <tB>>(new module::Source_random <tB>(K, 0, n_frames));
modem = std::unique_ptr<module::Modem_BPSK <tB, tR, tR>>(new module::Modem_BPSK <tB, tR, tR>(N, *noise, false, n_frames));
channel = std::unique_ptr<module::Channel_AWGN_LLR <tR>>(new module::Channel_AWGN_LLR <tR>(N, seed, false, *noise, n_frames));
std::unique_ptr<factory::Codec_turbo::parameters> p_codec;
p_codec = std::unique_ptr<factory::Codec_turbo::parameters>(new factory::Codec_turbo::parameters());
auto p_launcher = std::unique_ptr<factory::Launcher::parameters>(new factory::Launcher::parameters());
std::vector<factory::Factory::parameters*> params_list = { p_codec.get() };
int noOfArgs = (int)(sizeof(argList) / sizeof(argList[0])) - 1;
factory::Command_parser cp(noOfArgs, argList, params_list, true);
if (cp.parsing_failed())
{
cp.print_help();
cp.print_warnings();
cp.print_errors();
std::exit(1);
}
std::unique_ptr<module::Codec_SIHO<tB, tR>> m_codec; // template <typename B = int, typename Q = float>
m_codec = std::unique_ptr<module::Codec_SIHO <tB, tR>>(p_codec->build<tB, tR>());
module::Encoder<tB>* encoder; // template <typename B = int>
module::Decoder_SIHO<tB, tR>* decoder; // template <typename B = int, typename R = float>
encoder = m_codec->get_encoder().get(); // template <typename B, typename Q> std::unique_ptr<Encoder<B>>& Codec<B, Q>::get_encoder()
decoder = m_codec->get_decoder_siho().get(); //template <typename B, typename Q> const std::shared_ptr<Decoder_SIHO<B, Q>>& Codec_SIHO<B, Q>::get_decoder_siho()
auto& interleaver = m_codec->get_interleaver();
interleaver->init();
R = (float)p_codec->enc->K / (float)p_codec->enc->N_cw; // compute the code rate
// get the AFF3CT version
const std::string v = "v" + std::to_string(tools::version_major()) + "." +
std::to_string(tools::version_minor()) + "." +
std::to_string(tools::version_release());
std::cout << "#----------------------------------------------------------" << std::endl;
std::cout << "# This is a basic program using the AFF3CT library (" << v << ")" << std::endl;
std::cout << "# Feel free to improve it as you want to fit your needs." << std::endl;
std::cout << "#----------------------------------------------------------" << std::endl;
std::cout << "#" << std::endl;
std::cout << "# Simulation parameters: " << std::endl;
factory::Header::print_parameters(params_list); // display the headers (= print the AFF3CT parameters on the screen)
std::cout << "#" << std::endl;
cp.print_warnings();
// loop over the various SNRs
for (auto ebn0 = ebn0_min; ebn0 < ebn0_max; ebn0 += ebn0_step)
{
int num_errors_ttl = 0;
// compute the current sigma for the channel noise
const auto esn0 = tools::ebn0_to_esn0(ebn0, R);
const auto sigma = tools::esn0_to_sigma(esn0);
noise->set_noise(sigma, ebn0, esn0);
// update the sigma of the modem and the channel
modem->set_noise(*noise);
channel->set_noise(*noise);
source->generate(ref_bits);
encoder->encode(ref_bits, enc_bits);
modem->modulate(enc_bits, symbols);
channel->add_noise(symbols, noisy_symbols);
modem->demodulate(noisy_symbols, LLRs);
decoder->decode_siho(LLRs, dec_bits);
}
std::cout << "# End of the simulation" << std::endl;
Also:
aff3ct (Windows 64-bit, g++-6.2, SSE4.1) v2.3.5
Compilation options:
- Precision: 8/16/32/64-bit
- Polar bit packing: on
- Polar bounds: off
- Terminal colors: on
- Backtrace: off
- External strings: on
- MPI: off
- GSL: off
- MKL: off
- SystemC: off
Copyright (c) 2016-2019 - MIT license.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I hope to hear back from you.
Thanks,
Dayana
The text was updated successfully, but these errors were encountered:
Hi,
I am interested in replicating the following command run by aff3ct.exe in a simple program that utilizes the aff3ct library (using the Factory module):
I am able to run my code for the 32-bit precision case as this is the default. It seems that there isn't any option to set the precision to the 8-bit and 16-bit case as I am not able to pass in the precision or quantizer parameters to the factory module. I have also tried changing the data type in the template but got prompted with an error when I execute the code. I would appreciate if I can receive some assistance regarding this matter.
As reference:
Also:
I hope to hear back from you.
Thanks,
Dayana
The text was updated successfully, but these errors were encountered: