16#include <QLoggingCategory>
26Q_DECLARE_LOGGING_CATEGORY(decoder_js8);
66 if (
auto const env = std::getenv(
"JS8_LLR_ERASURE_THRESH"); env) {
68 float val = std::strtof(env, &end);
70 if (end != env && std::isfinite(val)) {
75 if (threshold <= 0.0f || !std::isfinite(threshold) ||
76 std::getenv(
"JS8_DISABLE_ERASURE_THRESHOLDING")) {
94 int value = qEnvironmentVariableIntValue(
"JS8_LDPC_FEEDBACK", &ok);
95 return ok ? value != 0 :
true;
109 int value = qEnvironmentVariableIntValue(
"JS8_LDPC_MAX_PASSES", &ok);
144template <std::
size_t N>
146 std::array<int8_t, N>
const &cw,
147 float erasureThreshold,
148 std::array<float, N> &llrOut,
149 int &confidentCount,
int &uncertainCount) {
154 for (std::size_t i = 0; i < llrOut.size(); ++i) {
155 float &value = llrOut[i];
157 if (!std::isfinite(value)) {
163 bool const bitOne = cw[i] != 0;
164 float const mag = std::abs(value);
165 bool const signMatch = (value >= 0.0f) == bitOne;
171 value = bitOne ? boosted : -boosted;
176 if (erasureThreshold > 0.0f && shrunk < erasureThreshold) {
179 value = bitOne ? shrunk : -shrunk;
JS8 namespace for Kalman filter-based trackers.
Definition FrequencyTracker.cpp:14
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:48
constexpr float LLR_FEEDBACK_UNCERTAIN_MAX
Definition ldpc_feedback.h:42
constexpr int LDPC_FEEDBACK_MAX_PASSES_DEFAULT
Definition ldpc_feedback.h:50
constexpr float LLR_FEEDBACK_CONFIDENT_MIN
Definition ldpc_feedback.h:40
constexpr float LLR_FEEDBACK_UNCERTAIN_SHRINK
Definition ldpc_feedback.h:46
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:145
int ldpcFeedbackMaxPasses()
Maximum LDPC feedback passes to attempt.
Definition ldpc_feedback.h:107
bool ldpcFeedbackEnabled()
Whether LDPC feedback is enabled.
Definition ldpc_feedback.h:92
float llrErasureThreshold()
Read configured LLR erasure threshold.
Definition ldpc_feedback.h:63
constexpr float LLR_FEEDBACK_CONFIDENT_BOOST
Definition ldpc_feedback.h:44