Documentation ¶
Overview ¶
Package fec implementes Forward Error Correction algorithms
Index ¶
- Constants
- func Golay_20_8_Check(bits []byte) error
- func Golay_20_8_Parity(bits []byte) []byte
- func Golay_23_12_Correct(block *uint32)
- func Golay_23_12_Encode(codeword uint32) uint32
- func Hamming15_11_3_Correct(block *uint32)
- func Hamming15_11_3_Encode(input uint32) uint32
- func RS_12_9_Calc(syndrome, locator, evaluator *RS_12_9_Poly)
- func RS_12_9_CalcChecksum(data []byte) []uint8
- func RS_12_9_CalcDiscrepancy(locator, syndrome *RS_12_9_Poly, L, n uint8) uint8
- func RS_12_9_CalcErrorEvaluatorPoly(locator, syndrome, evaluator *RS_12_9_Poly)
- func RS_12_9_CalcSyndrome(data []byte, syndrome *RS_12_9_Poly) error
- func RS_12_9_CheckSyndrome(syndrome *RS_12_9_Poly) bool
- func RS_12_9_Correct(data []byte, syndrome *RS_12_9_Poly) (int, error)
- func RS_12_9_FindRoots(locator *RS_12_9_Poly) []uint8
- func RS_12_9_Galois_Inv(elt uint8) uint8
- func RS_12_9_Galois_Mul(a, b uint8) uint8
- func RS_12_9_MulPolyZ(poly *RS_12_9_Poly)
- func RS_12_9_MulPolys(p1, p2 *RS_12_9_Poly, dst []uint8)
- type RS_12_9_Poly
Constants ¶
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_Parity ¶
func Golay_23_12_Correct ¶
func Golay_23_12_Correct(block *uint32)
Golay(23, 12) forward error correction.
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 ¶
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 ¶
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_Mul ¶
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