accommodate preamble symbol in PAPR computations

This commit is contained in:
Ahmet Inan 2025-07-18 07:19:13 +02:00
commit 049dfdb3fa
3 changed files with 5 additions and 5 deletions

View file

@ -16,7 +16,7 @@ struct Common
static const int code_max = 15;
static const int bits_max = 1 << code_max;
static const int data_max = 2048;
static const int symbols_max = 23;
static const int symbols_max = 22 + 1;
static const int mls0_poly = 0x331;
static const int mls0_seed = 214;
static const int mls1_poly = 0x43;

View file

@ -385,8 +385,8 @@ struct Decoder : Common
}
if (oper_mode < 1)
continue;
DSP::quick_sort(snr, symbol_count);
std::cerr << "Es/N0 (dB): " << DSP::decibel(snr[0]) << " .. " << DSP::decibel(snr[symbol_count/2]) << " .. " << DSP::decibel(snr[symbol_count-1]) << std::endl;
DSP::quick_sort(snr, symbol_count + 1);
std::cerr << "Es/N0 (dB): " << DSP::decibel(snr[0]) << " .. " << DSP::decibel(snr[symbol_count/2]) << " .. " << DSP::decibel(snr[symbol_count]) << std::endl;
crc_bits = data_bits + 32;
shuffle(code, perm, code_order);
polar_decoder(nullptr, mesg, code, frozen_bits, code_order);

View file

@ -312,8 +312,8 @@ struct Encoder : public Common
}
symbol(j);
}
DSP::quick_sort(papr, symbol_count);
std::cerr << "PAPR (dB): " << DSP::decibel(papr[0]) << " .. " << DSP::decibel(papr[symbol_count/2]) << " .. " << DSP::decibel(papr[symbol_count-1]) << std::endl;
DSP::quick_sort(papr, symbol_count + 1);
std::cerr << "PAPR (dB): " << DSP::decibel(papr[0]) << " .. " << DSP::decibel(papr[symbol_count/2]) << " .. " << DSP::decibel(papr[symbol_count]) << std::endl;
}
finish();
}