Documentation

ReedSolomonDecoder
in package

Implements Reed-Solomon decoding, as the name implies.

The algorithm will not be explained here, but the following references were helpful in creating this implementation:

  • Bruce Maggs "Decoding Reed-Solomon Codes" (see discussion of Forney's Formula) http://www.cs.cmu.edu/afs/cs.cmu.edu/project/pscico-guyb/realworld/www/rs_decode.ps
  • J.I. Hall. "Chapter 5. Generalized Reed-Solomon Codes" (see discussion of Euclidean algorithm) https://users.math.msu.edu/users/halljo/classes/codenotes/GRS.pdf

Much credit is due to William Rucklidge since portions of this code are an indirect port of his C++ Reed-Solomon implementation.

Tags
author

Sean Owen

author

William Rucklidge

author

sanfordsquires

Table of Contents

decode()  : array<string|int, int>
Decodes given set of received codewords, which include both data and error-correction codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place, in the input.
findErrorLocations()  : array<string|int, mixed>
findErrorMagnitudes()  : array<string|int, mixed>
runEuclideanAlgorithm()  : array<string|int, GenericGFPoly>

Methods

decode()

Decodes given set of received codewords, which include both data and error-correction codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place, in the input.

public decode(array<string|int, mixed> $received, int $numEccCodewords) : array<string|int, int>
Parameters
$received : array<string|int, mixed>

data and error-correction codewords

$numEccCodewords : int

number of error-correction codewords available

Tags
throws
RuntimeException

if decoding fails for any reason

Return values
array<string|int, int>

findErrorLocations()

private findErrorLocations(GenericGFPoly $errorLocator) : array<string|int, mixed>
Parameters
$errorLocator : GenericGFPoly
Tags
throws
RuntimeException
Return values
array<string|int, mixed>

findErrorMagnitudes()

private findErrorMagnitudes(GenericGFPoly $errorEvaluator, array<string|int, mixed> $errorLocations) : array<string|int, mixed>
Parameters
$errorEvaluator : GenericGFPoly
$errorLocations : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results