Communications Blockset    

Encoding Using a Convolutional Code

The Convolutional Encoder block, in the Convolutional sublibrary of the Channel Coding library, receives the messages from the Bernoulli Random Binary Generator block and encodes them into codewords.

While the message data is a scalar bit stream, the encoded data is a stream of binary length-two vectors. These signal sizes are compatible with the structure of the particular convolutional code and with the corresponding parameter configuration of the Convolutional Encoder block.

Digression: Exploring Signal Sizes

This section explains a technique for gathering information about the sizes of signals in a model. This technique can be useful for determining what parameters you should use for a block or for diagnosing problems in a model.

To check the sizes of signals in the model, use the Signal dimensions feature from the model window's Format menu. In this example, when the signal dimension display is on, the connector line that leads out of the Convolutional Encoder block has the annotation [2x1] above it because the signal is a 2-by-1 matrix signal. The connector line that leads into the Convolutional Encoder block has no annotation above it because it is a scalar. The situation is the opposite for the Viterbi Decoder block.

Defining the Convolutional Code (Technical)

The feedforward convolutional encoder in this example is depicted below.

Each summing node represents modulo-2 addition. Each box marked z-1 represents a memory register that holds the input values from previous sample times. Since there are six memory registers, the output at a given time depends on seven input values, including the current one. Thus the constraint length of the code is 7. Since the code has one input and two outputs, the code rate is 1/2.

A pair of octal numbers called the code generator indicates the connections from the memory registers to the modulo-2 summing nodes. The pair [171 133] describes the encoder in the figure.

The Trellis structure parameter in the Convolutional Encoder block tells the block which code to use when processing data. In this case, the poly2trellis function, in the Communications Toolbox, converts the constraint length and the pair of octal numbers into a valid trellis structure that the block uses in its processing.

Computing the Code Generator.   The code generator is a 1-by-2 matrix of octal numbers because the encoder has one input and two outputs. The first element in the matrix indicates which input values contribute to the first output, and the second element in the matrix indicates which input values contribute to the second output.

For example, the first output in the encoder diagram is the modulo-2 sum of the rightmost and the four leftmost elements in the diagram's array of input values. The seven-digit binary number 1111001 captures this information, and is equivalent to the octal number 171. The octal number 171 thus becomes the first entry of the code generator matrix. Here, each triplet of bits uses the leftmost bit as the most significant bit.

The second output corresponds to the binary number 1011011, which is equivalent to the octal number 133. The code generator is therefore [171 133].


 Components of the Example Unbuffering to Convert Vectors to Scalars