| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Communications Blockset |
| Contents | Index |
| Learn more about Communications Blockset |
Block sublibrary of Channel Coding
This block supports punctures (Shortening, Puncturing, and Erasures provides a tutorial).
The BCH Encoder block creates a BCH code with message length K and codeword length (N - number of punctures). You specify both N and K directly in the dialog box.
The input must be a frame-based column vector with an integer multiple of K elements. Each group of K input elements represents one message word to be encoded.
If the encoder is processing multiple codewords per frame, then the same puncture pattern holds for all codewords.
For a given codeword length N, only specific
message lengths K are valid for a BCH code. For
a full length BCH code, N must be of the form
2M-1, where
. If N is
less than 2M-1, the
block assumes that the code has been shortened by length 2M -
1 - N. However, if N is
greater than or equal to 2M-1, Primitive
polynomial must be specified to appropriately set the value
of M.
No known analytic formula describes the relationship among the codeword length, message length, and error-correction capability. For a list of some valid values of K corresponding to values of N up to 511, see the bchenc reference page in the Communications Toolbox documentation.
This block supports double and boolean data types.
The primitive and generator polynomials may be specified in their respective fields, which appear after selecting their corresponding check boxes.
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 codeword length.
The message length.
Selecting this check box enables the field Primitive polynomial.
A row vector that represents the binary coefficients of the primitive polynomial in order of descending powers.
This field defaults to de2bi(primpoly(4, 'nodisplay'), 'left-msb'), corresponding to a (15,5) code.
This field is available only when you select Specify primitive polynomial.
Selecting this check box enables the field Generator polynomial.
A row vector that represents the binary coefficients of the generator polynomial in order of descending powers.
The length of the Generator polynomial must be N-K+1.
This field defaults to bchgenpoly(15,5).
This field appears only when you select Specify generator polynomial.
This check box appears only when you select Specify generator polynomial.
Each time a model initializes, the block performs a polynomial check. This check verifies that X N + 1 is divisible by the user-defined generator polynomial, where N represents the full code word length. Selecting this check box disables the polynomial check. For larger codes, disabling the check speeds up the simulation process. You should always run the check at least once before disabling this feature.
Selecting this check box enables the field Puncture vector.
A column vector of length N-K. A value of 1 in the Puncture vector corresponds to a bit that is not punctured, and a 0 corresponds to a bit that is punctured.
The field defaults to [ones(8,1); zeros(2,1)].
This field appears only when you select Puncture code.
[1] Clark, George C., Jr., and J. Bibb Cain, Error-Correction Coding for Digital Communications, New York, Plenum Press, 1981.
bchenc (in Communications Toolbox documentation)
![]() | BCH Decoder | Bernoulli Binary Generator | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |