Communications Toolbox    
rsenco

Reed-Solomon encoder

Syntax

Description

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'.

Table 3-21: Information Formats for Reed-Solomon Encoding 
Format of msg
Value of format Argument
Format of code
Binary matrix with m columns
'binary'
Binary matrix with m columns
Example: msg = [1 1 0; 1 0 1; 1 0 0; 0 1 1; 1 1 0; 1 0 1; 1 0 0; 0 1 1]
Binary column vector
'binary'
Binary column vector
Example: msg = [1 1 0, 1 0 1, 1 0 0, 0 1 1, 1 1 0, 1 0 1, 1 0 0, 0 1 1]'
Matrix of integers in the range [0, 2m-1], with k columns
'decimal'
Matrix of integers in the range [0, 2m-1], with n columns
Example: msg = [3, 5, 1, 6; 3, 5, 1, 6]
Matrix of integers in the range [-1, 2m-2], with k columns
'power'
Matrix of integers in the range [-1, 2m-2], with n columns
Example: msg = [2, 4, 0, 5; 2, 4, 0, 5]

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,format) is the same as the syntax above, except that 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,format,genpoly) is the same as the syntax above, except that 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