From: Jon on
"Toni " <antoni.castells(a)eumetsat.int> wrote in message <feneqf$j6o$1(a)ginger.mathworks.com>...
> Hello,
>
> I am trying to decode some data using Matlab, which was
> originally encoded using a CCSDS implementation of Reed
> Solomon (255, 223). I think I have a problem when using
> the 'rsgenpoly' function. According to Matlab it is
> defined as (x-alpha^B)*(x-alpha^(B+1)) ... (x-alpha^(B+N-K-
> 1)) where N=255 and K=223, whereas for CCSDS is defined as
> (x-alpha^(11*112))(x-alpha^(11*113))...(x-alpha^(11*143)).
> I don't know how to set the alpha and B values in Matlab
> to get the correct CCSDS code generator polynomial.
>
> Any ideas?

There is no way to use rsgenpoly, because it only returns generator polynomials of the form (x-alpha^B)*(x-alpha^(B+1)) ... (x-alpha^(B+N-K-1)), in which alpha is a root of the primitive polynomial used to generate the field. If you try setting beta = alpha^11, the CCSDS generator would have the form (x-beta^112)(x-beta^113) ... (x-beta^143) which looks promising with B=112, except that beta -- although a primitive element of the field -- is *not* a root of the primitive polynomial.

You don't have to use rsgenpoly. MATLAB allows you to specify the generator polynomial coefficients yourself, and these are given in an annex of the CCSDS standard. If you try doing this, you will find that MATLAB complains that the CCSDS generator you supply must be of the form (x-alpha^B)*(x-alpha^(B+1)) ... (x-alpha^(B+N-K-1)), even though the documentation for fec.rsenc makes no mention of this limitation.

So, simply, MATLAB's built-in RS encoder/decoder functions cannot be used to implement the CCSDS RS standard. You have to implement the algorithms yourself.