| Communications Blockset™ | ![]() |
Block sublibrary of Channel Coding
This block supports punctures (Shortening, Puncturing, and Erasures provides a tutorial).
Note For a puncture vector, a 1 means that the data symbol is passed unaltered, and a 0 means that the data symbol is punctured (i.e., removed) from the data stream. This convention is carried for both the encoder and the decoder. |
The Integer-Input RS Encoder block creates a Reed-Solomon code with message length, K, and codeword length, (N - number of punctures). You specify both N and K directly in the block dialog. The symbols for the code are integers between 0 and 2M-1, which represent elements of the finite field GF(2M). Restrictions on M and N are described in Restrictions on M and the Codeword Length N below. The difference N - K must be an even integer.
This block can output shortened codewords when N and K are appropriately
specified. To specify output codewords that are shortened by a length
S, N and K must be specified in the dialog box as Nfull – S and Kfull – S, where Nfull and Kfull are the N and K
of an unshortened code. If
,
the encoder can automatically determine the value of Nfull and Kfull. However, if
, Primitive polynomial must be specified in order to properly define the extension field
for the code.
The input and output are integer-valued signals that represent messages and codewords, respectively. The input must be a frame-based column vector whose length is an integer multiple of K. The block can accept the data types int8, uint8, int16, uint16, int32, uint32, single, and double. The output is a frame-based column vector whose length is the same integer multiple of N, and whose data type is inherited from the input. For more information on representing data for Reed-Solomon codes, see the section Integer Format (Reed-Solomon Only) in Communications Blockset™ User's Guide.
If the encoder is processing multiple codewords per frame, then the same puncture pattern holds for all codewords.
The default value of M is the smallest integer that is greater than or equal to log2(N+1), that is, ceil(log2(N+1)). You can change the value of M from the default by specifying the primitive polynomial for GF(2M), as described in Specifying the Primitive Polynomial below. If N is less than 2M-1, the block uses a shortened Reed-Solomon code.
An (N, K) Reed-Solomon code can correct up to floor((N-K)/2) symbol errors (not bit errors) in each codeword.
You can specify the primitive polynomial that defines the finite field GF(2M), corresponding to the integers that form messages and codewords. To do so, first select Specify primitive polynomial. Then, in the Primitive polynomial field, enter a binary row vector that represents a primitive polynomial over GF(2) of degree M, in descending order of powers. For example, to specify the polynomial x3+x+1, enter the vector [1 0 1 1].
If you do not select Specify primitive polynomial, the block uses the default primitive polynomial of degree M = ceil(log2(N+1)). You can display the default polynomial by entering primpoly(ceil(log2(N+1))) at the MATLAB® prompt.
The restrictions on the degree M of the primitive polynomial and the codeword length N are as follows:
If you do not select Specify primitive polynomial, N must lie in the range 3 < N < 216–1.
If you do select Specify primitive polynomial, N must lie in the range 3 ≤ N < 2M–1 and M must lie in the range 3 ≤ M ≤ 16.
You can specify the generator polynomial for the Reed-Solomon code. To do so, first select Specify generator polynomial. Then, in the Generator polynomial field, enter an integer row vector whose entries are between 0 and 2M-1. The vector represents a polynomial, in descending order of powers, whose coefficients are elements of GF(2M) represented in integer format. See the section Integer Format (Reed-Solomon Only) for more information about integer format. The generator polynomial must be equal to a polynomial with a factored form
g(x) = (x+Ab)(x+Ab+1)(x+Ab+2)...(x+Ab+N-K-1)
where A is the primitive element of the Galois field over which the input message is defined, and b is an integer.
If you do not select Specify generator polynomial, the block uses the default generator polynomial, corresponding to b=1, for Reed-Solomon encoding. You can display the default generator polynomial by entering rsgenpoly(N1,K1), where N1 = 2^M-1 and K1 = K+(N1-N), at the MATLAB prompt, if you are using the default primitive polynomial. If the Specify primitive polynomial box is selected, and you specify the primitive polynomial specified as poly, the default generator polynomial is rsgenpoly(N1,K1,poly).
Suppose M = 3, N = 23-1 = 7, and K = 5. Then a message is a vector of length 5 whose entries are integers between 0 and 7. A corresponding codeword is a vector of length 7 whose entries are integers between 0 and 7. The following figure illustrates possible input and output signals to this block when Codeword length N is set to 7, Message length K is set to 5, and the default primitive and generator polynomials are used.


The codeword length.
The message length.
Selecting this check box enables the field Primitive polynomial.
This field is available only when Specify primitive polynomial is selected.
Binary row vector representing the primitive polynomial in descending order of powers.
Selecting this check box enables the field Generator polynomial.
This field is available only when Specify generator polynomial is selected.
Integer row vector, whose entries are in the range from 0 to 2M-1, representing the generator polynomial in descending order of powers.
Selecting this check box enables the field Puncture vector.
This field is available only when Puncture code is selected.
A column vector of length N-K. A value of 1 in the Puncture vector corresponds to a symbol that is not punctured, and a 0 corresponds to a symbol that is punctured.
The default value is [ones(2,1); zeros(2,1)].
![]() | Insert Zero | Integer-Output RS Decoder | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |