Here are two programs written in C for simulating encoding and decoding procedures of RS codes, which is the topic of Chapter 4 of the book. These programs implement errors-and-erasures decoding with (1) Berlekamp-Massey (BM) algorithm and (2) Euclidean algorithm. Any shortened RS code with arbitrary starting root of its generator polynomial (or starting zero of the code) can be simulated.
In the programs below, the Reed-Somolon code is specified by the finite
field GF(2^m), the code length (length <= 2^m-1), the number of redundant
symbols (length-k), and the initial zero of the code, init_zero.
Update 8/17/03: Added a line to check for zero in computation of the erasure
polynomial. Many thanks to Matteo Albanese, a graduate student at Politecnico
di Milano, for pointing this out.
Encoding and errors-and-erasures decoding of an RS code, BM algorithm:
rs_eedec_bm.c
Errors and erasures correction using the modified Berlekamp-Massey algorithm.
For more details and an example, see the book.
Encoding and errors-and-erasures decoding of an RS code, Euclidean algorithm:
rs_eedec_euc.c
Errors and erasures correction using the modified Euclidean algorithm.
For more details and an example, see the book.