Vous êtes sur la page 1sur 2

The Reed Solomon code-The Reed-Solomon codes are an important subclass of nonbinary BCH codes.

The encoder for an RS code differs from a binary encoder in that it operates on multiple bits rather than individual bits. Specifically, the encoder for an RS(n,k) code on m-bit symbols groups the incoming binary data stream into blocks, each km bits long. Each block is tread as k symbols, with each symbol having m bits. The encoding algorithm expands a block of k symbols to n symbols by adding n-k redundant symbols. When m is an integer power of two, the m-bit symbols are called bytes. A popular value of m is 8. Function description rsenc Reed-Solomon encoder 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 narrowsense 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'. rsdec Reed-Solomon decoder decoded = rsdec(code,n,k) attempts to decode the received signal in code using an [n,k] Reed-Solomon decoding process with the narrow-sense generator polynomial. code is a Galois

array of symbols having m bits each. Each n-element row of code represents a corrupted systematic codeword, where the parity symbols are at the end and the leftmost symbol is the most significant symbol. n is at most 2m-1. If n is not exactly 2m-1, then rsdec assumes that code is a corrupted version of a shortened code. In the Galois array decoded, each row represents the attempt at decoding the corresponding row in code. A decoding failure occurs if rsdec detects more than (nk)/2 errors in a row of code. In this case, rsdec forms the corresponding row of decoded by merely removing n-k symbols from the end of the row of code. decoded = rsdec(code,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 narrowsense generator polynomial, set genpoly to []. decoded = rsdec(...,paritypos) specifies whether the parity symbols in code were appended or prepended to the message in the coding operation. The string paritypos can be either 'end' or 'beginning'. The default is 'end'. If paritypos is 'beginning', then a decoding failure causes rsdec to remove n-k symbols from the beginning rather than the end of the row. [decoded,cnumerr] = rsdec(...) returns a column vector cnumerr, each element of which is the number of corrected errors in the corresponding row of code. A value of -1 in cnumerr indicates a decoding failure in that row in code. [decoded,cnumerr,ccode] = rsdec(...) returns ccode, the corrected version of code. The Galois array ccode has the same format as code. If a decoding failure occurs in a certain row of code, then the corresponding row in ccode contains that row unchanged.

Vous aimerez peut-être aussi