Communications Toolbox    
istrellis

Check if the input is a valid trellis structure

Syntax

Description

[isok,status] = istrellis(s) checks if the input s is a valid trellis structure. If the input is a valid trellis structure, then isok is 1 and status is an empty string. Otherwise, isok is 0 and status is a string that indicates why s is not a valid trellis structure.

A valid trellis structure is a MATLAB structure whose fields are as in the table below.

Fields of a Valid Trellis Structure for a Rate k/n Code 
Field in Trellis Structure
Dimensions
Meaning
numInputSymbols
Scalar
Number of input symbols to the encoder: 2k
numOutputSymbols
Scalar
Number of output symbols from the encoder: 2n
numStates
Scalar
Number of states in the encoder
nextStates
numStates-by-2k matrix
Next states for all combinations of current state and current input
outputs
numStates-by-2k matrix
Outputs (in octal) for all combinations of current state and current input

In the nextStates matrix, each entry is an integer between 0 and numStates-1. The element in the sth row and uth column denotes the next state when the starting state is s-1 and the input bits have decimal representation u-1. To convert the input bits to a decimal value, use the first input bit as the most significant bit (MSB). For example, the second column of the nextStates matrix stores the next states when the current set of input values is {0,...,0,1}.

To convert the state to a decimal value, use this rule: If k exceeds 1, then the shift register that receives the first input stream in the encoder provides the least significant bits in the state number, while the shift register that receives the last input stream in the encoder provides the most significant bits in the state number.

In the outputs matrix, the element in the sth row and uth column denotes the encoder's output when the starting state is s-1 and the input bits have decimal representation u-1. To convert to decimal value, use the first output bit as the MSB.

Examples

These commands assemble the fields into a very simple trellis structure, and then verify the validity of the trellis structure.

Another example of a trellis is in Trellis Description of a Convolutional Encoder.

See Also

poly2trellis, struct, convenc, vitdec


  isprimitive lloyds