Main Content

Binary Linear Encoder

Create linear block code from binary vector data

  • Binary Linear Encoder block

Libraries:
Communications Toolbox / Error Detection and Correction / Block

Description

The Binary Linear Encoder block creates a binary linear block code by using a generator matrix that you specify. For more information, see Linear Block Coding.

Examples

expand all

This example shows how to model a simple encoder and decoder using appropriate vector lengths for the code and message.

The cm_binary_linear model includes these blocks:

  • Bernoulli Binary Generator block with Samples per frame set to 4 to match the binary linear encoder message length

  • Binary Linear Encoder block with default parameter values

  • Binary Linear Decoder block with default parameter values

  • Error Rate Calculation block with Output data set to Port

  • Display block connected to the output port of the Error Rate Calculation block

To display the vector length of signals in the model, go to Debug > Diagnostics > Information Overlays > Signals and select Signal Dimensions. The connector lines show the signal attributes. To compile the model, press Ctrl+D. Run the model to display the error rate statistics.

Ports

Input

expand all

Message to encode, specified as a column vector input signal containing K elements. K must equal the number of rows in the generator matrix specified by the Generator matrix (binary K-by-N matrix) parameter. This port is unnamed on the block mask.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean

Output

expand all

Encoded message, returned as a binary column vector containing N elements and having the same data type as the input port, In. N equals the number of columns in the generator matrix specified by the Generator matrix (binary K-by-N matrix) parameter. This port is unnamed on the block mask.

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Generator matrix for the code, specified as a K-by-N matrix, where K is the message length and N is the codeword length. For more information, see Linear Block Coding.

Block Characteristics

Data Types

Boolean | double | fixed point | integer | single

Multidimensional Signals

no

Variable-Size Signals

no

More About

expand all

References

[1] Clark, George C., and J. Bibb Cain. Error-Correction Coding for Digital Communications. Applications of Communications Theory. New York: Plenum Press, 1981.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced before R2006a