JS8Call-Improved master
Loading...
Searching...
No Matches
bp_math.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <algorithm>
8#include <cmath>
9#include <limits>
10
12namespace js8::bp {
17inline float channelLlr(float value) {
18 return std::isnan(value) ? 0.0f : std::clamp(value, -8.0f, 8.0f);
19}
20
25inline float checkMessage(float product) {
26 constexpr float limit = 1.0f - std::numeric_limits<float>::epsilon();
27 return 2.0f * std::atanh(-std::clamp(product, -limit, limit));
28}
29} // namespace js8::bp
Numerical limits for JS8 belief propagation.
Definition bp_math.h:12
float channelLlr(float value)
Limits channel confidence so a contaminated strong symbol is correctable.
Definition bp_math.h:17
float checkMessage(float product)
Converts a check-node product to a finite extrinsic LLR.
Definition bp_math.h:25