[Next][Prev] [Right] [Left] [Up] [Index] [Root]

Decoding

Magma supplies functions for decoding vectors from the ambient space of a linear code C. The functions in this section only apply to codes over finite fields.

Decode(C, v: parameters) : Code, ModTupFldElt -> BoolElt, ModTupFldElt
    Al: MonStgElt                       Default: "Euclidean"
Given a linear code C and a vector v from the ambient space V of C, attempt to decode v with respect to C. Currently the accessible algorithms are: syndrome decoding (which is demonstrated manually in the example in the Coset Leaders section above); and a Euclidean algorithm, which operates on alternant codes (BCH, Goppa, and Reed--Solomon codes, etc.). While the Euclidean algorithm cannot correct as many errors as can the syndrome algorithm, in general it is much faster, since the syndrome algorithm requires the coset leaders of the code and is also inapplicable as soon as the codimension of the code is moderately large. If the code is alternant, the Euclidean algorithm is used by default, but the syndrome algorithm will be used if the parameter Al is assigned the value "Syndrome". For non-alternant codes, only syndrome decoding is possible, so the parameter Al is not relevant. If the decoding algorithm succeeds in computing a vector v' as the decoded version of v, then the function returns true and v'. (In the Euclidean case it may even happen that v' is not in C because there are too many errors in v to correct.) If the decoding algorithm does not succeed in decoding v, then the function returns false and the zero vector.
Decode(C, Q: parameters) : Code, [ ModTupFldElt ] -> [ BoolElt ], [ ModTupFldElt ]
    Al: MonStgElt                       Default: "Euclidean"
Given a linear code C and a sequence Q of vectors from the ambient space V of C, attempt to decode the vectors of Q with respect to C. This function is similar to the function Decode(C, v) except that rather than decoding a single vector, it decodes a sequence of vectors and returns a sequence of booleans and a sequence of decoded vectors corresponding to the given sequence. The algorithm used and effect of the parameter Al are as for the function Decode(C, v).

Example CodeFld_Decode (H152E43)

We create a code C and a vector v of C and then perturb v to a new vector w. We then decode w to find v again.

> C := GolayCode(GF(2), false);
> v := C ! [1,1,1,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1,1];
> w := v;
> w[5] := 1 - w[5];
> w[20] := 1 - w[20];
> v;
(1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 1 1)
> w;
(1 1 1 1 1 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 1 1 1)
> v - w;
(0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0)
> b, d := Decode(C, w);
> b;
true
> d;
(1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 1 1)
> d eq v;
true
> Decode(C, [w]);
[ true ]
[
    (1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 1 1)
]

 [Next][Prev] [Right] [Left] [Up] [Index] [Root]

Version: V2.19 of Wed Apr 24 15:09:57 EST 2013