#include <trellis.h>
Inheritance diagram for simthlib::Trellis:
Optimized state calculation | |
These methods leave it up to you, the implementer, to call isTerminationStep() beforehand. If that function returned true, you *have* to call the *_term version of the function. If it returned false, you *have* to call the *_noterm version of that method. Rationale: The viterbi decoder consumes by far most of the simulation time. Therefore aggressive optimization really pays off here! | |
typedef std::vector< TrellisBranch > | TrellisBranchArray |
typedef std::vector< TrellisBranchArray > | TrellisStatesArray |
virtual const TrellisStatesArray & | getPrevTrellisArray (size_t time_step, size_t path_length) const =0 |
static const TrellisBranchArray & | getPrevArray_state (const TrellisStatesArray &state_array, int state) |
static const TrellisBranch & | getPrevState_branch (const TrellisBranchArray &branch_array, int index) |
static int | getPrevState (const TrellisBranch &tb) |
static int | getPrevOut (const TrellisBranch &tb) |
static int | getPrevIn (const TrellisBranch &tb) |
Public Member Functions | |
Trellis (int states, int inbits, int outbits) | |
virtual | ~Trellis () |
destructor | |
virtual void | print (std::ostream &os) const |
void | printStateDiagram (std::ostream &os) const |
virtual int | getDataLength (int code_length) const |
virtual int | getCodeLength (int data_length) const |
const int | numStates () const |
number of states of the finite state machine | |
const int | numInbits () const |
number of input bits in each step | |
const int | numInput () const |
number of possible input words in each step, i.e. 2^numInbits(). | |
const int | numOutbits () const |
number of output bits in each step | |
const int | numOutput () const |
number of possible output words in each step, i.e. 2^numInbits(). | |
virtual int | getNextState (int state, int input, size_t step, size_t path_length) const =0 |
virtual int | getNextOut (int state, int input, size_t step, size_t path_length) const =0 |
virtual int | getPrevState (int state, int index, size_t step, size_t path_length) const =0 |
virtual int | getPrevOut (int state, int index, size_t step, size_t path_length) const =0 |
virtual int | getPrevIn (int state, int index, size_t step, size_t path_length) const =0 |
virtual int | terminationInput (int state) const =0 |
bool | isTerminationStep (size_t path_length, size_t step) const |
virtual bool | isPossibleStartingState (int state) const =0 |
size_t | numTailsteps () const |
size_t | numTailbits () const |
Protected Member Functions | |
void | setTailstepLength (int newTailsteps) |
void | setTailbitLength (int newTailbits) |
void | setPathLength (int newPathLength) |
Protected Attributes | |
const int | num_states |
number of states of the finite state machine | |
const int | num_inbits |
number of input bits in each step | |
const int | num_input |
number of possible input words in each step | |
const int | num_outbits |
number of output bits in each step | |
const int | num_output |
number of possible output words in each step |
m' = f(m, i) o = g(m, i)
an input sequence generates an output sequence . The initial state of the machine is always the all-zero state.
For a given output sequence or a corresponding metric, the input sequence can be estimated with the Viterbi algorithm. The Viterbi algorithm does not assume the final state to be the all-zero state, but it considers zeroes which are appended to the input sequence in the case of a convolutional code by influencing the metric. This way of proceeding is not suboptimal.
|
Return type for the getPrevState_branch() method. Is also part of the TrellisStatesArray type. |
|
Return type for the getPrevArray_state() method. Should also be used for internal storage of the trellis itself. |
|
Class constructor. |
|
destructor
|
|
returns the length of the coded bit sequence which the coder generates from a data sequence of the given length |
|
Returns the maximal length of a data bit which encoded length is smaller or equal |
|
Returns the output according to a given previous state and input for the given time step Implemented in simthlib::ConvCodeTrellis, and simthlib::AdachiTrellis. |
|
Returns the next state of the machine according to a given previous state and input for the given time step Implemented in simthlib::ConvCodeTrellis, and simthlib::AdachiTrellis. |
|
|
|
|
|
Returns the previous input according to a given current state and number of the trellis branch leading to this state in the previous time step Implemented in simthlib::ConvCodeTrellis, and simthlib::AdachiTrellis. |
|
|
|
Returns the previous output according to a given current state and number of the trellis branch leading to this state in the previous time step Implemented in simthlib::ConvCodeTrellis, and simthlib::AdachiTrellis. |
|
|
|
Returns the previous state according to a given current state and number of the trellis branch leading to this state in the previous time step Implemented in simthlib::ConvCodeTrellis, and simthlib::AdachiTrellis. |
|
|
|
Returns the argument to getPrevArray_state() according to the given time step and path length. Implemented in simthlib::ConvCodeTrellis, and simthlib::AdachiTrellis. |
|
Implemented in simthlib::ConvCodeTrellis, simthlib::ConvCodeTrellisShiftRegister, simthlib::ConvCodeTrellisExplicit, and simthlib::AdachiTrellis. |
|
Returns true if step is greater or equal the given path_length minus the number of tailsteps. |
|
number of input bits in each step
|
|
number of possible input words in each step, i.e. 2^numInbits().
|
|
number of output bits in each step
|
|
number of possible output words in each step, i.e. 2^numInbits().
|
|
number of states of the finite state machine
|
|
Number of bits which are appended to the input sequence. to terminated the trellis. The value must be set by a derived class using the function setTailstepsLength() or setTailbitLength(). |
|
Number of steps which are appended to the input sequence to terminated the trellis. The value must be set by a derived class using the function setTailstepsLength() or setTailbitLength(). |
|
Reimplemented in simthlib::ConvCodeTrellisShiftRegister, and simthlib::ConvCodeTrellisExplicit. |
|
Reimplemented in simthlib::ConvCodeTrellis. |
|
|
|
|
|
|
|
Returns in order to a definite state of the trellis the termination input. If the recursive polynom is zero, the termination input is zero independend from the state of the trellis. Implemented in simthlib::ConvCodeTrellis, and simthlib::AdachiTrellis. |
|
number of input bits in each step
|
|
number of possible input words in each step
|
|
number of output bits in each step
|
|
number of possible output words in each step
|
|
number of states of the finite state machine
|