M0LTE.Fec 0.3.0

dotnet add package M0LTE.Fec --version 0.3.0
                    
NuGet\Install-Package M0LTE.Fec -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="M0LTE.Fec" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="M0LTE.Fec" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="M0LTE.Fec" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add M0LTE.Fec --version 0.3.0
                    
#r "nuget: M0LTE.Fec, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package M0LTE.Fec@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=M0LTE.Fec&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=M0LTE.Fec&version=0.3.0
                    
Install as a Cake Tool

M0LTE.Fec

Dependency-free forward-error-correction and checksum primitives for .NET, extracted from the pdn-soundmodem packet-radio modem. Nothing here is radio-specific — it's general-purpose FEC.

Type What it is
ReedSolomon Systematic Reed-Solomon codec over GF(2⁸): configurable parity length and first-consecutive-root, LFSR encoder, Berlekamp-Massey + Chien search + Forney decode.
Crc16X25 CRC-16/X.25 (the AX.25 / IL2P FCS variant).
FreedvCrc16 The CRC-16 FreeDV uses (CRC-16/CCITT, check 0x29B1).
Hamming74 Hamming(7,4) single-error-correcting encode/decode.
GpInterleaver Golden-prime block interleaver (ChooseB / Interleave / Deinterleave) over any T.
ConvolutionalCode A rate-1/2 convolutional code descriptor — constraint length K and the two generator polynomials.
TailBitingEncoder Tail-biting rate-1/2 convolutional encoder for any ConvolutionalCode.
TailBitingViterbiDecoder Soft-decision (LLR) tail-biting Viterbi decoder; punctured positions carry LLR 0.

Install

dotnet add package M0LTE.Fec

Quick start

using M0LTE.Fec;

// Reed-Solomon: 16 parity bytes over GF(2^8) (corrects up to 8 byte errors).
var rs = new ReedSolomon(paritySymbols: 16);
byte[] data = "hello, world"u8.ToArray();

byte[] parity = new byte[16];
rs.Encode(data, parity);            // systematic: data unchanged, parity computed

// ... transmit data + parity, pick up some errors ...
byte[] received = [.. data, .. parity];
int corrected = rs.Decode(received);  // returns the number of symbols corrected, or -1 if unrecoverable

// CRC-16/X.25 frame check:
ushort fcs = Crc16X25.Compute(data);

// Hamming(7,4):
byte codeword = Hamming74.Encode(0x0A);
byte nibble = Hamming74.Decode(codeword);   // corrects a single bit flip

(Exact constructor/method signatures are in the XML docs shipped with the package.)

Licence

AGPL-3.0-or-later (see LICENSE). The implementations are independent/textbook (the Reed-Solomon codec is the least derivative component); field/root parameters and the Hamming/CRC tables come from published standards. See PROVENANCE.md.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on M0LTE.Fec:

Package Downloads
pdn-soundmodem

Headless soundcard packet modem core: IL2P/AX.25 framing and FEC now; demodulators, KISS TCP and DCD to follow.

M0LTE.Il2p

A managed IL2P v0.6 codec for .NET: encodes/decodes AX.25 frames to and from the IL2P wire format (Type 0/1 headers, the packet-synchronous scrambler, Reed-Solomon FEC, block segmentation) including the IL2P+CRC extension, plus a streaming bit-level deframer. Dire-Wolf / NinoTNC interoperable. Extracted from the pdn-soundmodem packet-radio modem.

M0LTE.Ardop

A managed, ardopcf-compatible ARDOP 1 virtual TNC for .NET: the 4FSK/4PSK/8PSK/16QAM modulator and demodulator, Reed-Solomon FEC frames, the full ARQ engine (bandwidth negotiation, gearshift) and a byte-compatible TCP host interface, so Winlink hosts (Pat, Winlink Express, ARIM, hamChat) connect unmodified. Drive it from any audio device via the M0LTE.Radio.Audio seam. Extracted from the pdn-soundmodem packet-radio modem; validated bidirectionally against ardopcf.

M0LTE.Ofdm

A managed, codec2-compatible FreeDV datac OFDM modem for .NET: the modulator (per-symbol iDFT, cyclic prefix, Hilbert clipper, tx BPF, preamble/postamble, burst assembly), the demodulator with timing/frequency acquisition and streaming + burst sync, LDPC-protected framing and code-shortening for all six datac modes (datac0/1/3/4/13/14), and single-precision complex arithmetic matching the C reference's accumulation order. Ports of codec2 1.2.0 ofdm.c/ofdm_mode.c, validated against codec2-generated vectors and its own CLI. Extracted from the pdn-soundmodem packet-radio modem.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 165 8/6/2026
0.2.0 576 7/18/2026
0.1.0 480 7/17/2026