fec

package
v0.0.0-...-e993038 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package fec implementes Forward Error Correction algorithms

Index

Constants

View Source
const (
	RS_12_9_DATASIZE     = 9
	RS_12_9_CHECKSUMSIZE = 3
	// Maximum degree of various polynomials
	RS_12_9_POLY_MAXDEG = RS_12_9_CHECKSUMSIZE * 2
)

Variables

This section is empty.

Functions

func Golay_20_8_Check

func Golay_20_8_Check(bits []byte) error

func Golay_20_8_Parity

func Golay_20_8_Parity(bits []byte) []byte

func Golay_23_12_Correct

func Golay_23_12_Correct(block *uint32)

Golay(23, 12) forward error correction.

func Golay_23_12_Encode

func Golay_23_12_Encode(codeword uint32) uint32

Golay(23, 12) codeword.

func Hamming15_11_3_Correct

func Hamming15_11_3_Correct(block *uint32)

Correct a block of data using Hamming(15, 11, 3).

func Hamming15_11_3_Encode

func Hamming15_11_3_Encode(input uint32) uint32

Hamming(15, 11, 3) encode a block of data.

func RS_12_9_Calc

func RS_12_9_Calc(syndrome, locator, evaluator *RS_12_9_Poly)

This finds the coefficients of the error locator polynomial, and then calculates the error evaluator polynomial using the Berlekamp-Massey algorithm. From Cain, Clark, "Error-Correction Coding For Digital Communications", pp. 216.

func RS_12_9_CalcChecksum

func RS_12_9_CalcChecksum(data []byte) []uint8

Simulates an LFSR with the generator polynomial and calculates checksum bytes for the given data.

func RS_12_9_CalcDiscrepancy

func RS_12_9_CalcDiscrepancy(locator, syndrome *RS_12_9_Poly, L, n uint8) uint8

func RS_12_9_CalcErrorEvaluatorPoly

func RS_12_9_CalcErrorEvaluatorPoly(locator, syndrome, evaluator *RS_12_9_Poly)

Computes the combined erasure/error evaluator polynomial (error_locator_poly*syndrome mod z^4)

func RS_12_9_CalcSyndrome

func RS_12_9_CalcSyndrome(data []byte, syndrome *RS_12_9_Poly) error

func RS_12_9_CheckSyndrome

func RS_12_9_CheckSyndrome(syndrome *RS_12_9_Poly) bool

func RS_12_9_Correct

func RS_12_9_Correct(data []byte, syndrome *RS_12_9_Poly) (int, error)

func RS_12_9_FindRoots

func RS_12_9_FindRoots(locator *RS_12_9_Poly) []uint8

The error-locator polynomial's roots are found by looking for the values of a^n where evaluating the polynomial yields zero (evaluating rs_12_9_error_locator_poly at successive values of alpha (Chien's search)).

func RS_12_9_Galois_Inv

func RS_12_9_Galois_Inv(elt uint8) uint8

func RS_12_9_Galois_Mul

func RS_12_9_Galois_Mul(a, b uint8) uint8

func RS_12_9_MulPolyZ

func RS_12_9_MulPolyZ(poly *RS_12_9_Poly)

Multiply by z (shift right by 1).

func RS_12_9_MulPolys

func RS_12_9_MulPolys(p1, p2 *RS_12_9_Poly, dst []uint8)

Types

type RS_12_9_Poly

type RS_12_9_Poly [RS_12_9_POLY_MAXDEG]uint8

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL