![]() |
ccsoft
0.0.0
Convolutional codes library with soft decision decoding
|
Convolutional soft-decision sequential decoder generic (virtual) class for algorithm internal use. It is tainted by the type of code tree node+edge tag that is algorithm dependant. It contains the code tree root node and some common methods. This version uses a fixed array to store forward node+edges pointers. N_k template parameter gives the size of the input symbol (k parameter). There are (1<<N_k) forward node+edges. More...
#include <CC_SequentialDecodingInternal_FA.h>
Public Member Functions | |
| CC_SequentialDecodingInternal_FA () | |
| virtual | ~CC_SequentialDecodingInternal_FA () |
| void | reset () |
Protected Member Functions | |
| float | log2 (float x) |
| void | init_root () |
| virtual void | visit_node_forward (CC_TreeNodeEdge_FA< T_IOSymbol, T_Register, T_Tag, N_k > *node, const CC_ReliabilityMatrix &relmat)=0 |
| void | back_track (CC_TreeNodeEdge_FA< T_IOSymbol, T_Register, T_Tag, N_k > *node_edge, std::vector< T_IOSymbol > &decoded_message, bool mark_nodes=false) |
| void | print_dot_internal (std::ostream &os) |
Protected Attributes | |
| CC_TreeNodeEdge_FA< T_IOSymbol, T_Register, T_Tag, N_k > * | root_node |
| Root node. | |
Convolutional soft-decision sequential decoder generic (virtual) class for algorithm internal use. It is tainted by the type of code tree node+edge tag that is algorithm dependant. It contains the code tree root node and some common methods. This version uses a fixed array to store forward node+edges pointers. N_k template parameter gives the size of the input symbol (k parameter). There are (1<<N_k) forward node+edges.
| T_Register | Type of the encoder internal registers |
| T_IOSymbol | Type of the input and output symbols |
| T_EdgeTag | Type of the code tree node+edge tag |
| N_k | Size of an input symbol in bits (k parameter) |
| ccsoft::CC_SequentialDecodingInternal_FA< T_Register, T_IOSymbol, T_Tag, N_k >::CC_SequentialDecodingInternal_FA | ( | ) | [inline] |
Constructor
| constraints | Vector of register lengths (constraint length + 1). The number of elements determines k. |
| genpoly_representations | Generator polynomial numeric representations. There are as many elements as there are input bits (k). Each element is itself a vector with one polynomial value per output bit. The smallest size of these vectors is retained as the number of output bits n. The input bits of a symbol are clocked simultaneously into the right hand side, or least significant position of the internal registers. Therefore the given polynomial representation of generators should follow the same convention. |
:
root_node(0)
{}
| virtual ccsoft::CC_SequentialDecodingInternal_FA< T_Register, T_IOSymbol, T_Tag, N_k >::~CC_SequentialDecodingInternal_FA | ( | ) | [inline, virtual] |
| void ccsoft::CC_SequentialDecodingInternal_FA< T_Register, T_IOSymbol, T_Tag, N_k >::back_track | ( | CC_TreeNodeEdge_FA< T_IOSymbol, T_Register, T_Tag, N_k > * | node_edge, |
| std::vector< T_IOSymbol > & | decoded_message, | ||
| bool | mark_nodes = false |
||
| ) | [inline, protected] |
Back track from a node. When the node is the selected terminal node it is used to retrieve the decoded message
| node | Node to track back from |
| decoded_message | Symbols corresponding to the edge ordered from root node to the given node |
| mark_nodes | Mark the nodes along the path |
{
std::vector<T_IOSymbol> reversed_message;
CC_TreeNodeEdge_FA<T_IOSymbol, T_Register, T_Tag, N_k> *cur_node_edge = node_edge;
CC_TreeNodeEdge_FA<T_IOSymbol, T_Register, T_Tag, N_k> *incoming_node_edge;
reversed_message.push_back(cur_node_edge->get_in_symbol());
while (incoming_node_edge = (cur_node_edge->get_incoming_node_edge()))
{
cur_node_edge->set_on_final_path(mark_nodes);
if (incoming_node_edge->get_depth() >= 0) // don't take root node
{
reversed_message.push_back(incoming_node_edge->get_in_symbol());
}
cur_node_edge = incoming_node_edge;
}
decoded_message.resize(reversed_message.size());
std::reverse_copy(reversed_message.begin(), reversed_message.end(), decoded_message.begin());
}
| void ccsoft::CC_SequentialDecodingInternal_FA< T_Register, T_IOSymbol, T_Tag, N_k >::init_root | ( | ) | [inline, protected] |
Initialize process at the root node
{
root_node = new CC_TreeNodeEdge_FA<T_IOSymbol, T_Register, T_Tag, N_k>(0, 0, 0, 0.0, 0.0, -1);
}
| float ccsoft::CC_SequentialDecodingInternal_FA< T_Register, T_IOSymbol, T_Tag, N_k >::log2 | ( | float | x | ) | [inline, protected] |
Base 2 logarithm
{
return log(x)/log(2.0);
}
| void ccsoft::CC_SequentialDecodingInternal_FA< T_Register, T_IOSymbol, T_Tag, N_k >::print_dot_internal | ( | std::ostream & | os | ) | [inline, protected] |
Print the code tree in Graphviz dot format
| os | Output stream |
{
CC_TreeGraphviz_FA<T_IOSymbol, T_Register, T_Tag, N_k>::create_dot(root_node, os);
}
| void ccsoft::CC_SequentialDecodingInternal_FA< T_Register, T_IOSymbol, T_Tag, N_k >::reset | ( | ) | [inline] |
Reset the decoding process
Reimplemented in ccsoft::CC_FanoDecoding_FA< T_Register, T_IOSymbol, N_k >, and ccsoft::CC_StackDecoding_FA< T_Register, T_IOSymbol, N_k >.
| virtual void ccsoft::CC_SequentialDecodingInternal_FA< T_Register, T_IOSymbol, T_Tag, N_k >::visit_node_forward | ( | CC_TreeNodeEdge_FA< T_IOSymbol, T_Register, T_Tag, N_k > * | node, |
| const CC_ReliabilityMatrix & | relmat | ||
| ) | [protected, pure virtual] |
Visit a new node in the code tree
| node | Node to visit |
| relmat | Reliability matrix reference |
Implemented in ccsoft::CC_FanoDecoding_FA< T_Register, T_IOSymbol, N_k >, and ccsoft::CC_StackDecoding_FA< T_Register, T_IOSymbol, N_k >.
CC_TreeNodeEdge_FA<T_IOSymbol, T_Register, T_Tag, N_k>* ccsoft::CC_SequentialDecodingInternal_FA< T_Register, T_IOSymbol, T_Tag, N_k >::root_node [protected] |
Root node.