Communications Toolbox | ![]() ![]() |
Syntax
code = rsenco(msg,n,k); code = rsenco(msg,n,k,format); code = rsenco(msg,n,k,format,genpoly); code = rsenco(msg,field,...); [code,added] = rsenco(...);
For All Syntaxes
The decoding counterpart for this function is rsdeco
.
In all cases, the codeword length n
must have the form 2m-1 where m is an integer greater than or equal to 3.
The matrix msg
, which contains the messages to be encoded, can have one of several formats. Table 3-21, Information Formats for Reed-Solomon Encoding, shows which formats are allowed for msg
, how the optional argument format
should reflect the format of msg
, and how the format of the output code
depends on these choices. If format
is not specified as input, then its default value is 'binary
'.
For Specific Syntaxes
code = rsenco(msg,n,k)
encodes msg
using the Reed-Solomon encoding method. k
is the message length. msg
has either of the two binary formats described in Table 3-21, Information Formats for Reed-Solomon Encoding. The generator polynomial for the code is the output of the function rspoly
.
code = rsenco(msg,n,k,
is the same as the syntax above, except that format
)
format
specifies the format of msg
. Table 3-21, Information Formats for Reed-Solomon Encoding, lists the possible values for format
, as well as the corresponding shape and contents of msg
.
code = rsenco(msg,n,k,
is the same as the syntax above, except that format
,genpoly)
genpoly
is a row vector that gives the coefficients, in order of ascending powers, of the generator polynomial for the code. Each coefficient is an element of GF(2m) expressed in exponential format. For a description of exponential format, see Exponential Format.
code = rsenco(msg,field,...)
is a faster variation of the syntaxes above. field
is a matrix that lists all elements of GF(2m) in the format described in List of All Elements of a Galois Field. The size of field
determines n
.
[code,added] = rsenco(...)
returns the additional variable added
. added
is the number of zeros that were placed at the end of the message matrix before encoding, in order for the matrix to have the appropriate shape.
Algorithm
rsenco
invokes the function rsencode
, which processes data in power format. If msg
has decimal or binary format, then rsenco
converts it to the power format, passes it to rsencode
, and converts the code back to the original format of msg
. Binary data has the longest processing time.
See Also
rsdeco
, encode
, decode
, rsencode
![]() | rsdecof | rsencode | ![]() |