Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

simthlib::Trellis Class Reference

#include <trellis.h>

Inheritance diagram for simthlib::Trellis:

Inheritance graph
[legend]
List of all members.

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

Detailed Description

Trellis diagram. Trellis describes a finite state machine (e.g. a convolutional coder) with memory m, input i and output o, where

m' = f(m, i) o = g(m, i)

an input sequence $<i>$ generates an output sequence $<o>$. 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.


Member Typedef Documentation

typedef std::vector<TrellisBranch> simthlib::Trellis::TrellisBranchArray
 

Return type for the getPrevState_branch() method. Is also part of the TrellisStatesArray type.

typedef std::vector<TrellisBranchArray> simthlib::Trellis::TrellisStatesArray
 

Return type for the getPrevArray_state() method. Should also be used for internal storage of the trellis itself.


Constructor & Destructor Documentation

simthlib::Trellis::Trellis (  int  states,
int  inbits,
int  outbits
) 
 

Class constructor.

virtual simthlib::Trellis::~Trellis (   )  [virtual]
 

destructor


Member Function Documentation

virtual int simthlib::Trellis::getCodeLength (  int  data_length  )  const [virtual]
 

returns the length of the coded bit sequence which the coder generates from a data sequence of the given length

virtual int simthlib::Trellis::getDataLength (  int  code_length  )  const [virtual]
 

Returns the maximal length of a data bit which encoded length is smaller or equal code_length.

virtual int simthlib::Trellis::getNextOut (  int  state,
int  input,
size_t  step,
size_t  path_length
)  const [pure virtual]
 

Returns the output according to a given previous state and input for the given time step

Implemented in simthlib::ConvCodeTrellis, and simthlib::AdachiTrellis.

virtual int simthlib::Trellis::getNextState (  int  state,
int  input,
size_t  step,
size_t  path_length
)  const [pure virtual]
 

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.

static const TrellisBranchArray& simthlib::Trellis::getPrevArray_state (  const TrellisStatesArray &  state_array,
int  state
)  [inline, static]
 

static int simthlib::Trellis::getPrevIn (  const TrellisBranch &  tb  )  [inline, static]
 

virtual int simthlib::Trellis::getPrevIn (  int  state,
int  index,
size_t  step,
size_t  path_length
)  const [pure virtual]
 

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.

static int simthlib::Trellis::getPrevOut (  const TrellisBranch &  tb  )  [inline, static]
 

virtual int simthlib::Trellis::getPrevOut (  int  state,
int  index,
size_t  step,
size_t  path_length
)  const [pure virtual]
 

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.

static int simthlib::Trellis::getPrevState (  const TrellisBranch &  tb  )  [inline, static]
 

virtual int simthlib::Trellis::getPrevState (  int  state,
int  index,
size_t  step,
size_t  path_length
)  const [pure virtual]
 

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.

static const TrellisBranch& simthlib::Trellis::getPrevState_branch (  const TrellisBranchArray &  branch_array,
int  index
)  [inline, static]
 

virtual const TrellisStatesArray& simthlib::Trellis::getPrevTrellisArray (  size_t  time_step,
size_t  path_length
)  const [pure virtual]
 

Returns the argument to getPrevArray_state() according to the given time step and path length.

Implemented in simthlib::ConvCodeTrellis, and simthlib::AdachiTrellis.

virtual bool simthlib::Trellis::isPossibleStartingState (  int  state  )  const [pure virtual]
 

Implemented in simthlib::ConvCodeTrellis, simthlib::ConvCodeTrellisShiftRegister, simthlib::ConvCodeTrellisExplicit, and simthlib::AdachiTrellis.

bool simthlib::Trellis::isTerminationStep (  size_t  path_length,
size_t  step
)  const [inline]
 

Returns true if step is greater or equal the given path_length minus the number of tailsteps.

const int simthlib::Trellis::numInbits (   )  const [inline]
 

number of input bits in each step

const int simthlib::Trellis::numInput (   )  const [inline]
 

number of possible input words in each step, i.e. 2^numInbits().

const int simthlib::Trellis::numOutbits (   )  const [inline]
 

number of output bits in each step

const int simthlib::Trellis::numOutput (   )  const [inline]
 

number of possible output words in each step, i.e. 2^numInbits().

const int simthlib::Trellis::numStates (   )  const [inline]
 

number of states of the finite state machine

size_t simthlib::Trellis::numTailbits (   )  const [inline]
 

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().

size_t simthlib::Trellis::numTailsteps (   )  const [inline]
 

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().

virtual void simthlib::Trellis::print (  std::ostream &  os  )  const [inline, virtual]
 

Reimplemented in simthlib::ConvCodeTrellisShiftRegister, and simthlib::ConvCodeTrellisExplicit.

void simthlib::Trellis::printStateDiagram (  std::ostream &  os  )  const [inline]
 

Reimplemented in simthlib::ConvCodeTrellis.

void simthlib::Trellis::setPathLength (  int  newPathLength  )  [protected]
 

void simthlib::Trellis::setTailbitLength (  int  newTailbits  )  [inline, protected]
 

void simthlib::Trellis::setTailstepLength (  int  newTailsteps  )  [inline, protected]
 

virtual int simthlib::Trellis::terminationInput (  int  state  )  const [pure virtual]
 

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.


Member Data Documentation

const int simthlib::Trellis::num_inbits [protected]
 

number of input bits in each step

const int simthlib::Trellis::num_input [protected]
 

number of possible input words in each step

const int simthlib::Trellis::num_outbits [protected]
 

number of output bits in each step

const int simthlib::Trellis::num_output [protected]
 

number of possible output words in each step

const int simthlib::Trellis::num_states [protected]
 

number of states of the finite state machine


Generated on Tue Aug 9 14:39:38 2005 for simtheticlib by  doxygen 1.4.1