|
JS8Call-Improved master
|
JS8 namespace for Kalman filter-based trackers. More...
Namespaces | |
| namespace | bp |
| Numerical limits for JS8 belief propagation. | |
Classes | |
| struct | CoherentPilot |
| struct | CoherentDataSymbol |
| struct | CarrierPhaseFit |
| Result of the low-order carrier-phase fit over pilot symbols. More... | |
| struct | CoherentLikelihoodTelemetry |
| Debug/benchmark telemetry for one candidate frame. More... | |
| struct | CoherentToneResult |
| struct | CoherentBlend |
| class | FrequencyTracker |
| Lightweight PLL/Kalman-style tracker for residual frequency offset. More... | |
| class | TimingTracker |
| class | OptionalWorkSignal |
| class | OptionalWorkBudget |
| struct | SicRefinementResult |
| class | SoftCombiner |
| Cache and combine repeated LLR frames for the same decode candidate. More... | |
| class | WhiteningProcessor |
| Compute per-tone/symbol noise medians and whiten LLRs for a JS8 frame. More... | |
Enumerations | |
| enum class | OptionalStage : std::size_t { Deep , Rescue , Aided , Count } |
Functions | |
| double | effectiveSymbolTimeSeconds (double baseTimeSeconds, double shiftSamples, double sampleRateHz) |
| std::complex< double > | normalizeFrequencyTrackerPhase (std::complex< double > bin, double trackerHz, double sampleRateHz, int windowSamples) |
| std::complex< double > | normalizeTimingPhase (std::complex< double > bin, int tone, double shiftSamples, int windowSamples) |
| CarrierPhaseFit | fitCarrierPhase (std::vector< CoherentPilot > const &pilots, int minPilots, double minSpanSeconds, int windowSamples, double sampleRateHz) |
| double | coherentBlendWeight (CarrierPhaseFit const &fit) |
| double | predictCarrierPhase (CarrierPhaseFit const &fit, double timeSeconds) |
| Predicted carrier phase at an absolute symbol-start time. | |
| template<std::size_t Tones> | |
| bool | blendToneScores (std::array< float, Tones > const &noncoherent, std::array< float, Tones > const &coherent, float alpha, std::array< float, Tones > &out) |
| template<std::size_t Tones> | |
| std::optional< double > | topTwoMargin (std::array< float, Tones > const &scores) |
| Margin between the largest and second-largest tone scores, if well-defined. | |
| CoherentToneResult | computeCoherentToneScores (std::vector< CoherentPilot > const &pilots, std::vector< CoherentDataSymbol > const &data, int minPilots, double minSpanSeconds, int windowSamples, double sampleRateHz) |
| float | llrGlobalScale () |
| float | llrErasureThreshold () |
| Read configured LLR erasure threshold. | |
| bool | ldpcFeedbackEnabled () |
| Whether LDPC feedback is enabled. | |
| int | ldpcFeedbackMaxPasses () |
| Maximum LDPC feedback passes to attempt. | |
| template<std::size_t N> | |
| 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. | |
| std::vector< std::complex< float > > | applySicTimingWarp (std::vector< std::complex< float > > const &reference, double interceptSamples, double slopeSamplesPerSecond, double sampleRate) |
| double | wrapSicPhase (double angle) |
| bool | solveSicLinearSystem3 (double const normal[3][3], double const right[3], double solution[3]) |
| int | sicStartSample (float seconds) |
| Converts SIC timing to the nearest 12-kHz sample for fit and subtraction. | |
| template<int SymbolSamples, std::size_t Symbols, typename Samples, typename Tones> | |
| SicRefinementResult | refineSicReference (std::vector< std::complex< float > > nominal, Samples const &samples, Tones const &tones, float const dt, bool const allowTimingDrift) |
| Refines a decoded reference while guarding its matched correlation. | |
Variables | |
| constexpr float | LLR_ERASURE_THRESHOLD_DEFAULT = 0.0f |
| LDPC erasure threshold config and feedback refinement helpers. | |
| constexpr float | LLR_FEEDBACK_CONFIDENT_MIN = 3.0f |
| constexpr float | LLR_FEEDBACK_UNCERTAIN_MAX = 1.0f |
| constexpr float | LLR_FEEDBACK_CONFIDENT_BOOST = 1.2f |
| constexpr float | LLR_FEEDBACK_UNCERTAIN_SHRINK = 0.5f |
| constexpr float | LLR_FEEDBACK_MAX_MAG = 6.0f |
| constexpr int | LDPC_FEEDBACK_MAX_PASSES_DEFAULT = 8 |
JS8 namespace for Kalman filter-based trackers.
| bool js8::blendToneScores | ( | std::array< float, Tones > const & | noncoherent, |
| std::array< float, Tones > const & | coherent, | ||
| float | alpha, | ||
| std::array< float, Tones > & | out ) |
Blend physical noncoherent and coherent tone scores for one symbol.
noncoherent[i] must hold the decoder's 0.5*power*invSigma2 values and coherent[i] the (A*projection - 0.5*A*A)*invSigma2 values sharing the same invSigma2. With alpha <= 0 (or any invalid input) this copies noncoherent exactly, so the fallback path is bit-identical to the legacy likelihood path. Symbols are never renormalized: reliability information in the score magnitudes is preserved.

|
inline |
Blend weight in [0,1] from pilot phase-fit quality.
Full weight below the good RMS threshold, zero above the poor threshold, and a simple linear ramp between them. Returns exactly 0 whenever the fit is untrusted or non-finite.
|
inline |
Effective carrier-model timestamp for an extracted symbol.
The carrier trajectory must be evaluated where the FFT window actually starts, not at the nominal symbol boundary. Timing-dependent FSK phase is handled separately by normalizeTimingPhase(), so adding the displacement here does not double-count it.

|
inline |
Fit the carrier-phase model to pilot observations.
Pilot bins are first normalized into the nominal phase frame (tracker and timing corrections above). Adjacent same-block phase differences then give a closed-form frequency/drift seed, followed by one absolute-phase refinement pass. Cost is O(pilots): a few dozen trig evaluations, no grid.
| pilots | Known-tone pilot observations (complex bin + metadata). |
| minPilots | Minimum valid pilots required before trusting the fit. |
| minSpanSeconds | Minimum time span across valid pilots. |
| windowSamples | Decoder symbol FFT length (Mode::NDOWNSPS). |
| sampleRateHz | Decoder downsampled rate (post-downsample Hz). |

|
inline |
Whether LDPC feedback is enabled.
The JS8_LDPC_FEEDBACK environment variable may be set to 0 to explicitly disable feedback. If the variable is not present or cannot be parsed as an integer, feedback is enabled by default.
|
inline |
Maximum LDPC feedback passes to attempt.
Reads JS8_LDPC_MAX_PASSES and clamps the value to the range [1, LDPC_FEEDBACK_MAX_PASSES_DEFAULT]. Returns a sensible default when the variable is not provided or invalid.
|
inline |
Read configured LLR erasure threshold.
Reads the JS8_LLR_ERASURE_THRESH environment variable (if present) and returns a positive finite threshold. If the environment variable is missing, invalid, or the JS8_DISABLE_ERASURE_THRESHOLDING variable is set, this function returns 0.0f to indicate erasure thresholding is disabled.
|
inline |
Fixed LLR calibration shared across all frames (one means no adjustment).
|
inline |
Remove the deterministic bulk phase of one FrequencyTracker::apply() call.
apply() multiplies window sample n by wstep^(n+1) with wstep = exp(j*2*pi*trackerHz/sampleRateHz) and resets every symbol. For a bin-centered tone that contributes exactly exp(j*dphi*(windowSamples+1)/2) to the matched FFT bin, so dividing it out leaves the physical carrier trajectory plus only the residual error.

|
inline |
Remove the known tone-dependent phase of a TimingTracker displacement.
A window starting shiftSamples late sees the tone component advanced by 2*pi*tone*shiftSamples/windowSamples; dividing it out normalizes every symbol to the nominal-boundary phase frame used by the carrier model.

| void js8::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.
The algorithm adjusts each input LLR based on whether its sign matches the corresponding bit in the provided codeword cw and on the magnitude of the LLR:
This function writes results to llrOut and returns counts of confident and uncertain bits via confidentCount and uncertainCount respectively.
| N | Number of LLR elements (array length). |
| llrIn | Input LLR array (unchanged). | |
| cw | Decoded codeword as an array of int8_t (non-zero means bit 1). | |
| erasureThreshold | Threshold below which shrunk magnitudes are erased (set to zero). Use 0.0f to disable erasure thresholding. | |
| [out] | llrOut | Output array receiving adjusted LLRs. |
| [out] | confidentCount | Number of bits considered confident after adjust. |
| [out] | uncertainCount | Number of bits considered uncertain after adjust. |
| SicRefinementResult js8::refineSicReference | ( | std::vector< std::complex< float > > | nominal, |
| Samples const & | samples, | ||
| Tones const & | tones, | ||
| float const | dt, | ||
| bool const | allowTimingDrift ) |
Refines a decoded reference while guarding its matched correlation.

|
inline |
Converts SIC timing to the nearest 12-kHz sample for fit and subtraction.

|
constexpr |
Default maximum number of LDPC feedback passes when unset in env.
|
constexpr |
LDPC erasure threshold config and feedback refinement helpers.
Inline env readers expose thresholds/pass limits; the templated refineLlrsWithLdpcFeedback shrinks/boosts LLRs using the decoded codeword to retry LDPC. Used inside the JS8 decode loop between LDPC passes. Default erasure threshold (zero retains all likelihood evidence).
|
constexpr |
Multiply confident magnitudes by this factor when boosting.
|
constexpr |
Minimum magnitude to consider a bit "confident" when sign matches.
|
constexpr |
Maximum allowed absolute magnitude for adjusted LLRs.
|
constexpr |
Maximum magnitude considered "uncertain" (will be shrunk).
|
constexpr |
Multiply uncertain magnitudes by this factor when shrinking.