This module provides the TDecoder class, capable of performing Gallager's SPA decoding.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | N |
Number of edges |
||
integer, | intent(in) | :: | e_to_v(N) |
each location contains the index of the variable node connected to the edge corresponding to that location |
||
integer, | intent(in) | :: | e_to_c(N) |
each location contains the index of the check node connected to the edge corresponding to that location |
The resulting Decoder object
LDPC Decoder object
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | cnum |
Number of Check Nodes |
|||
integer, | public | :: | vnum |
Number of variable nodes |
|||
integer, | public | :: | Ne |
Number of edges |
|||
type(TEdgeList), | public, | allocatable | :: | c_to_e(:) |
For each check node, the list of its connected edges |
||
type(TEdgeList), | public, | allocatable | :: | v_to_e(:) |
For each variable node, the list of its connected edges |
||
type(TEdgeList), | public, | allocatable | :: | c_to_v(:) |
For each check node, the list of its connected variable nodes |
||
type(TEdgeList), | public, | allocatable | :: | v_to_c(:) |
For each variable node, the list of its connected check nodes |
||
real(kind=wp), | public, | allocatable | :: | B_buffer(:) |
Support buffer for node processing (backwards partial results) |
||
real(kind=wp), | public, | allocatable | :: | F_buffer(:) |
Support buffer for node processing (forward partial results) |
public function TDecoderConstructor (N, e_to_v, e_to_c) |
final :: destructor |
procedure, public, pass(this) :: print => print_decoder | |
procedure, public, pass(this) :: check_llr | |
procedure, public, pass(this) :: word_to_synd | |
procedure, public, pass(this) :: decode |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | N |
Number of edges |
||
integer, | intent(in) | :: | e_to_v(N) |
each location contains the index of the variable node connected to the edge corresponding to that location |
||
integer, | intent(in) | :: | e_to_c(N) |
each location contains the index of the check node connected to the edge corresponding to that location |
The resulting Decoder object
Real sum
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x | |||
real(kind=wp), | intent(in) | :: | y |
Box-plus sum
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x | |||
real(kind=wp), | intent(in) | :: | y |
Check the array of LLRs (or LAPPRs) against the syndrome
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TDecoder) | :: | this |
Decoder |
|||
real(kind=wp), | intent(in) | :: | llr(this%vnum) |
Array of LLR (or LAPPR) |
||
logical, | intent(in) | :: | synd(this%cnum) |
Syndrome |
Evaluate the syndrome from a word
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TDecoder) | :: | this |
Decoder |
|||
logical, | intent(in) | :: | word(this%vnum) |
Word |
Syndrome
Binarize the LLRs (or LAPPRs)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | N |
Word size |
||
real(kind=wp), | intent(in) | :: | llr(N) |
LLR (or LAPPR) |
Word
Create an array which contains, in each location, the list of edges connected to the node corresponding to that location
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | N |
Number of edges |
||
integer, | intent(in) | :: | e_to_x(N) |
Array of nodes to which each edge is connected |
||
integer, | intent(in) | :: | xnum |
Total number of nodes |
||
type(TEdgeList), | intent(inout) | :: | x_to_e(xnum) |
Array of list of edges, one list for each node |
Build node-to-node connection list from node-to-edge and edge-to-other-node
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | N |
Number of nodes |
||
type(TEdgeList), | intent(in) | :: | x_to_e(N) |
Array with the list of connected edges for each node |
||
integer, | intent(in) | :: | Ne |
Total number of edges |
||
integer, | intent(in) | :: | e_to_y(Ne) |
Array with nodes (of the other kind) connected to each edge |
||
type(TEdgeList), | intent(inout) | :: | x_to_y(N) |
Array with the list of connected nodes from the original nodes i.e. from variable- to check-nodes or vice versa |
Destructor method for the TDecoder object It will just deallocate whatever was allocated.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(TDecoder) | :: | decoder |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TDecoder) | :: | this |
Generic processing function, it works both for variable- and for check- nodes - for variable nodes, f_plus_kind is a simple addition routine - for check nodes, f_plus_kind can be: + the "box plus" for exact message passing + the min abs with sign product for the min-sum algorithm + whatever you want for your approximation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(TEdgeList), | intent(in) | :: | buffer_x_to_y |
List of edges "y" connected to node "x" |
||
integer, | intent(in) | :: | Ne |
Number of edges |
||
real(kind=wp), | intent(inout) | :: | m_inout(Ne) |
Input messages, updated with the output messages |
||
procedure(f_real_real) | :: | f_plus_kind |
Function with 2 real inputs and one real output used to perform the combination of input messages to output messages |
|||
real(kind=wp), | intent(out), | optional | :: | total |
f_plus_kind applied to all input messages |
|
real(kind=wp), | intent(inout), | optional, | target | :: | B_buffer(2:buffer_x_to_y%N) |
pre-allocated backwords buffer for partial message processing results |
real(kind=wp), | intent(inout), | optional, | target | :: | F_buffer(buffer_x_to_y%N-1) |
pre-allocated forward buffer for partial message processing results |
Variable node A Posteriori Probability (APP) processing function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(TEdgeList), | intent(in) | :: | buffer_v_to_e |
List of edges connected to the variable node being currently processed |
||
real(kind=wp), | intent(in) | :: | llr_channel |
Log-Likelihood ratio (or Log-A Posteriori Probability Ratio) of the variable node being currently processed |
||
real(kind=wp), | intent(out) | :: | llr_updated |
Log-Likelihood ratio (or Log-A Posteriori Probability Ratio) of the variable node after processing |
||
integer, | intent(in) | :: | Ne |
Total number of edges in the LDPC code |
||
real(kind=wp), | intent(inout) | :: | m_inout(Ne) |
Array of input messages, to be updated with output messages, one per edge |
||
real(kind=wp), | intent(inout), | optional, | target | :: | B_buffer(2:buffer_v_to_e%N) |
pre-allocated backwords buffer for partial message processing results |
real(kind=wp), | intent(inout), | optional, | target | :: | F_buffer(buffer_v_to_e%N-1) |
pre-allocated forward buffer for partial message processing results |
Variable node A Posteriori Probability (APP) processing function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(TEdgeList), | intent(in) | :: | buffer_c_to_e |
List of edges connected to the variable node being currently processed |
||
logical, | intent(in) | :: | s |
Syndrome bit value associated to the checknode being currently processed |
||
integer, | intent(in) | :: | Ne |
Total number of edges in the LDPC code |
||
real(kind=wp), | intent(inout) | :: | m_inout(Ne) |
Message buffer |
||
real(kind=wp), | intent(inout), | optional, | target | :: | B_buffer(2:buffer_c_to_e%N) |
pre-allocated backwords buffer for partial message processing results |
real(kind=wp), | intent(inout), | optional, | target | :: | F_buffer(buffer_c_to_e%N-1) |
pre-allocated forward buffer for partial message processing results |
Iteratively decode array of LLR (or LAPPRs) based on syndrome
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(TDecoder) | :: | this |
Decoder |
|||
real(kind=wp), | intent(in) | :: | llr_channel(this%vnum) |
Array of LLRs (or LAPPRs) obtained from the channel |
||
real(kind=wp), | intent(out) | :: | llr_updated(this%vnum) |
Array of processed LLRs (or LAPPRs) |
||
logical, | intent(in) | :: | synd(this%cnum) |
Syndrome |
||
integer, | intent(inout) | :: | N_iterations |
Maximum number of iterations (in), actual number of iterations (out) |