Communications Toolbox    
rsenc

Reed-Solomon encoder

Syntax

Description

code = rsenc(msg,n,k) encodes the message in msg using an [n,k] Reed-Solomon code with the narrow-sense generator polynomial. msg is a Galois array of symbols having m bits each. Each k-element row of msg represents a message word, where the leftmost symbol is the most significant symbol. n is at most 2m-1. If n is not exactly 2m-1, then rsenc uses a shortened Reed-Solomon code. Parity symbols are at the end of each word in the output Galois array code.

code = rsenc(msg,n,k,genpoly) is the same as the syntax above, except that a nonempty value of genpoly specifies the generator polynomial for the code. In this case, genpoly is a Galois row vector that lists the coefficients, in order of descending powers, of the generator polynomial. The generator polynomial must have degree n-k. To use the default narrow-sense generator polynomial, set genpoly to [].

code = rsenc(...,paritypos) specifies whether rsenc appends or prepends the parity symbols to the input message to form code. The string paritypos can be either 'end' or 'beginning'. The default is 'end'.

Examples

The example below encodes two message words using a (7,3) Reed-Solomon encoder.

For additional examples, see Representing Words for Reed-Solomon Codes and Creating and Decoding Reed-Solomon Codes.

Limitations

n and k must differ by an even integer. The maximum allowable value of n is 65535.

See Also

rsdec, gf, rsgenpoly


  rsdecof rsencof