16#include <QLoggingCategory>
26Q_DECLARE_LOGGING_CATEGORY(decoder_js8);
42 if (
auto const env = std::getenv(
"JS8_LLR_SCALE"); env) {
44 float const value = std::strtof(env, &end);
45 if (end != env && *end ==
'\0' && std::isfinite(value) && value > 0.0f)
77 if (
auto const env = std::getenv(
"JS8_LLR_ERASURE_THRESH"); env) {
79 float val = std::strtof(env, &end);
81 if (end != env && std::isfinite(val)) {
86 if (threshold <= 0.0f || !std::isfinite(threshold) ||
87 std::getenv(
"JS8_DISABLE_ERASURE_THRESHOLDING")) {
105 int value = qEnvironmentVariableIntValue(
"JS8_LDPC_FEEDBACK", &ok);
106 return ok ? value != 0 :
true;
120 int value = qEnvironmentVariableIntValue(
"JS8_LDPC_MAX_PASSES", &ok);
155template <std::
size_t N>
157 std::array<int8_t, N>
const &cw,
158 float erasureThreshold,
159 std::array<float, N> &llrOut,
160 int &confidentCount,
int &uncertainCount) {
165 for (std::size_t i = 0; i < llrOut.size(); ++i) {
166 float &value = llrOut[i];
168 if (!std::isfinite(value)) {
174 bool const bitOne = cw[i] != 0;
175 float const mag = std::abs(value);
176 bool const signMatch = (value >= 0.0f) == bitOne;
182 value = bitOne ? boosted : -boosted;
187 if (erasureThreshold > 0.0f && shrunk < erasureThreshold) {
190 value = bitOne ? shrunk : -shrunk;
JS8 namespace for Kalman filter-based trackers.
Definition bp_math.h:12
constexpr float LLR_ERASURE_THRESHOLD_DEFAULT
LDPC erasure threshold config and feedback refinement helpers.
Definition ldpc_feedback.h:38
constexpr float LLR_FEEDBACK_MAX_MAG
Definition ldpc_feedback.h:59
constexpr float LLR_FEEDBACK_UNCERTAIN_MAX
Definition ldpc_feedback.h:53
float llrGlobalScale()
Definition ldpc_feedback.h:41
constexpr int LDPC_FEEDBACK_MAX_PASSES_DEFAULT
Definition ldpc_feedback.h:61
constexpr float LLR_FEEDBACK_CONFIDENT_MIN
Definition ldpc_feedback.h:51
constexpr float LLR_FEEDBACK_UNCERTAIN_SHRINK
Definition ldpc_feedback.h:57
void refineLlrsWithLdpcFeedback(std::array< float, N > const &llrIn, std::array< int8_t, N > const &cw, float erasureThreshold, std::array< float, N > &llrOut, int &confidentCount, int &uncertainCount)
Refine LLRs using a decoded LDPC codeword as feedback.
Definition ldpc_feedback.h:156
int ldpcFeedbackMaxPasses()
Maximum LDPC feedback passes to attempt.
Definition ldpc_feedback.h:118
bool ldpcFeedbackEnabled()
Whether LDPC feedback is enabled.
Definition ldpc_feedback.h:103
float llrErasureThreshold()
Read configured LLR erasure threshold.
Definition ldpc_feedback.h:74
constexpr float LLR_FEEDBACK_CONFIDENT_BOOST
Definition ldpc_feedback.h:55