Commit d1aa38b7 authored by Renaud Pacalet's avatar Renaud Pacalet

LDPC doc

parent 5ab661ca
......@@ -73,7 +73,7 @@ $(BUILDDIR)/intl.pdf: $(intl_figs) $(intl_texs)
ldpc_figs := $(patsubst $(FIGDIR)/%.fig,$(BUILDDIR)/%-fig.pdf_t,$(wildcard $(FIGDIR)/ldpc_*.fig))
ldpc_figs += $(patsubst $(FIGDIR)/%.svg,$(BUILDDIR)/%-svg.pdf,$(wildcard $(FIGDIR)/ldpc_*.svg))
ldpc_texs := ldpc_ds.tex ldpc_ug.tex ldpc_lib_bitfield.tex
ldpc_texs := ldpc_scms.tex ldpc_ds.tex ldpc_ug.tex ldpc_lib_bitfield.tex
$(BUILDDIR)/ldpc.pdf: $(ldpc_figs) $(ldpc_texs) $(BIBLIO)
mapper_figs := $(patsubst $(FIGDIR)/%.fig,$(BUILDDIR)/%-fig.pdf_t,$(wildcard $(FIGDIR)/mapper_*.fig))
......
......@@ -12,193 +12,22 @@
\section{Algorithm}
The original SCMS algorithm, as proposed in~\cite{savin2008self}, is depicted on algorithm~\ref{alg:scms-original}, with the following notations:
\input{ldpc_scms}
\begin{itemize}
\item $\Tg$: Tanner graph of LDPC code
\item $n \in \{1,2,\ldots,N\}$: Variable Nodes (VN) of $\Tg$
\item $m \in \{1,2,\ldots,M\}$: Check Nodes (CN) of $\Tg$
\item $\Tg(n)$: set of neighbor CNs of VN $n$
\item $\Tg(m)$: set of neighbor VNs of CN $m$
\item $\bm{x}$: vector
\item $x_i$: component $i$ of vector $\bm{x}$
\item $\prio_n$: a priori information (LLR) on bit $n$ from channel observation
\item $\post_n$: a posteriori information (LLR) on bit $n$
\item $\bm{\prio}$: vector of a priori information (LLR)
\item $\bm{\post}$: vector of a posteriori information (LLR)
\item $\alpha_{m,n}$: VN-to-CN message from VN $n$ to CN $m$
\item $\beta_{m,n}$: CN-to-VN message from CN $m$ to VN $n$
\item $\sign(x)\in\{-1,+1\}$: sign of $x$ ($\sign(0)=+1$).
\item $s.x$: field $x$ of data structure $s$
\item $\mathcal{G}\setminus g$: set $\mathcal{G}$ without element $g$ ($\{g'\in\mathcal{G},\ g'\neq g\}$)
\end{itemize}
\section{Architecture}
\begin{algorithm}
\small
\begin{algorithmic}[1]
\For{$n = 0$ to $N-1$} \Comment For all columns
\State $\prio_n \leftarrow \ln(\Pr(x_n = 0 | channel)/\Pr(x_n = 1 | channel))$ \Comment LLRs
\For{$m \in \Tg(n)$} \Comment For all active rows in column
\State $\alpha_{m,n}^{(0)} \leftarrow \prio_n$ \Comment Initialization
\EndFor
\EndFor
\For{$l = 1$ to $l_{max}$} \Comment Iterate
\For{$m = 0$ to $M-1$} \Comment For all rows
\For{$n \in \Tg(m)$} \Comment For all active columns in row
\State $\beta_{m,n}^{(l)} \leftarrow \left(\prod\limits_{n'\in\Tg(m)\setminus n}\sign\left(\alpha_{m,n'}^{(l-1)}\right)\right)\times\min\limits_{n'\in\Tg(m)\setminus n}\left(\lvert\alpha_{m,n'}^{(l-1)}\rvert\right)$
\EndFor
\EndFor
\For{$n = 0$ to $N-1$} \Comment For all columns
\State $\post_n^{(l)} \leftarrow \prio_n + \sum\limits_{m\in\Tg(n)}\beta_{m,n}^{(l)}$
\For{$m \in \Tg(n)$} \Comment For all active rows in column
\State $\alpha_{m,n}^{(l)} \leftarrow \post_n^{(l)} - \beta_{m,n}^{(l)}$
\If{$\sign\left(\alpha_{m,n}^{(l)}\right)\neq\sign\left(\alpha_{m,n}^{(l-1)}\right)\band\alpha_{m,n}^{(l-1)}\neq 0$}
\State $\alpha_{m,n}^{(l)} \leftarrow 0$ \Comment Erasure
\EndIf
\EndFor
\EndFor
\EndFor
\end{algorithmic}
\caption{The original SCMS algorithm}\label{alg:scms-original}
\end{algorithm}
Algorithm~\ref{alg:scms-original} can be transformed in the equivalent algorithm~\ref{alg:scms-modified} where the CN-to-VN ($\beta$) and VN-to-CN ($\alpha$) message computations are swapped, their initializations changed and the VN-to-CN messages after the erasure are denoted $\lambda$.
\begin{algorithm}
\small
\begin{algorithmic}[1]
\For{$n = 0$ to $N-1$} \Comment For all columns
\State $\prio_n \leftarrow \ln(\Pr(x_n = 0 | channel)/\Pr(x_n = 1 | channel))$ \Comment LLRs
\For{$m \in \Tg(n)$} \Comment For all active rows in column
\State $\alpha_{m,n}^{(0)} \leftarrow 0$ \Comment Initialization
\State $\beta_{m,n}^{(0)} \leftarrow 0$ \Comment Initialization
\EndFor
\EndFor
\For{$l = 1$ to $l_{max}$} \Comment Iterate
\For{$m = 0$ to $M-1$} \Comment For all rows
\For{$n \in \Tg(m)$} \Comment For all active columns in row
\State $\alpha_{m,n}^{(l)} \leftarrow \prio_n - \beta_n^{(l-1)}$
\If{$\sign(\alpha_{m,n}^{(l)}) \neq \sign(\alpha_{m,n}^{(l-1)}) \band \alpha_{m,n}^{(l-1)} \neq 0$}
\State $\lambda_{m,n}^{(l)} \leftarrow 0$ \Comment Erase message
\Else
\State $\lambda_{m,n}^{(l)} \leftarrow \alpha_{m,n}^{(l)}$
\EndIf
\EndFor
\For{$n \in \Tg(m)$} \Comment For all active columns in row
\State $\beta_{m,n}^{(l)} \leftarrow \left(\prod\limits_{n'\in\Tg(m)\setminus n}\sign\left(\lambda_{m,n'}^{(l-1)}\right)\right)\times\min\limits_{n'\in\Tg(m)\setminus n}\left(\lvert\lambda_{m,n'}^{(l-1)}\rvert\right)$
\EndFor
\EndFor
\For{$n = 0$ to $N-1$} \Comment For all columns
\State $\post_n^{(l)} \leftarrow \prio_n + \sum\limits_{m\in\Tg(n)}\beta_{m,n}^{(l)}$
\EndFor
\EndFor
\end{algorithmic}
\caption{The modified SCMS algorithm}\label{alg:scms-modified}
\end{algorithm}
The layered schedule proposed in~\cite{mansour2006turbo} speeds-up the propagation of the posterior information and reduces the average number of iterations. Algorithm~\ref{alg:scms-modified-layered} depicts this proposal applied to the SCMS decoding kernel.
\begin{algorithm}
\small
\begin{algorithmic}[1]
\For{$n = 0$ to $N-1$} \Comment For all columns
\State $\post_n^{(0)} \leftarrow \ln(\Pr(x_n = 0 | channel)/\Pr(x_n = 1 | channel))$ \Comment LLRs
\For{$m \in \Tg(n)$} \Comment For all active rows in column
\State $\alpha_{m,n}^{(0)} \leftarrow 0$ \Comment Initialization
\State $\beta_{m,n}^{(0)} \leftarrow 0$ \Comment Initialization
\EndFor
\EndFor
\For{$l = 1$ to $l_{max}$} \Comment Iterate
\For{$m = 0$ to $M-1$} \Comment For all rows
\For{$n \in \Tg(m)$} \Comment For all active columns in row
\State $\alpha_{m,n}^{(l)} \leftarrow \post_n^{(l-1)} - \beta_n^{(l-1)}$
\If{$\sign(\alpha_{m,n}^{(l)}) \neq \sign(\alpha_{m,n}^{(l-1)}) \band \alpha_{m,n}^{(l-1)} \neq 0$}
\State $\lambda_{m,n}^{(l)} \leftarrow 0$ \Comment Erase message
\Else
\State $\lambda_{m,n}^{(l)} \leftarrow \alpha_{m,n}^{(l)}$
\EndIf
\EndFor
\For{$n \in \Tg(m)$} \Comment For all active columns in row
\State $\beta_{m,n}^{(l)} \leftarrow \left(\prod\limits_{n'\in\Tg(m)\setminus n}\sign\left(\lambda_{m,n'}^{(l-1)}\right)\right)\times\min\limits_{n'\in\Tg(m)\setminus n}\left(\lvert\lambda_{m,n'}^{(l-1)}\rvert\right)$
\EndFor
\EndFor
\For{$n = 0$ to $N-1$} \Comment For all columns
\State $\post_n^{(l)} \leftarrow \post_n^{(l-1)} + \sum\limits_{m\in\Tg(n)}\beta_{m,n}^{(l)}$
\EndFor
\EndFor
\end{algorithmic}
\caption{The modified and layered SCMS algorithm}\label{alg:scms-modified-layered}
\end{algorithm}
With the layered schedule (algorithm~\ref{alg:scms-modified-layered}), the posterior information $\post_n^{(l)}$ must be stored. The $\beta_{m,n}^{(l)}$ (CN-to-VN messages) depend entirely on limited information about the set of the $\alpha_{m,n}^{(l)}$ (argmin, first and second minimum of absolute values, signs, product of signs). The SCMS algorithm also requires that the signs of the $\alpha_{m,n}^{(l)}$ are stored, along with flags indicating that they have been erased. All in all, for each row $m$, the set of $\alpha_{m,n}^{(l)}$ can be represented in the compact form $r_m^{(l)} = \{m_1,m_2,i,\bm{\alpha^s},sp,\bm{\alpha^e}\}$:
With structured quasi-cyclic parity check matrices a first level of parallelism can be exploited to speed-up the decoding: all rows of a block row can be processed in parallel because the active variable nodes do not overlap between rows. In algorithm~\ref{alg:scms-optimized} it means that several iterations of the loop over the rows can be processed in parallel. For 3GPP New Radio LDPC codes, for instance, up to 384 processing elements can be running simultaneously.
As can been seen in algorithm~\ref{alg:scms-optimized}, the processing of a row is split in two phases:
\begin{itemize}
\item $m_1=\min\limits_{n\in\Tg(m)}\lvert\alpha_{m,n}^{(l)}\rvert=$ minimum of absolute values
\item $i=\argmin\limits_{n\in\Tg(m)}\lvert\alpha_{m,n}^{(l)}\rvert=$ index of $m_1$
\item $m_2=\min\limits_{n\in\Tg(m)\setminus i}\lvert\alpha_{m,n}^{(l)}\rvert=$ second minimum of absolute values
\item $\bm{\alpha^s}: \alpha^s_n=\sign(\alpha_{m,n}^{(l)})=$ vector of signs
\item $sp=\prod\limits_{n\in\Tg(m)}\sign(\alpha_{m,n}^{(l)})=$ product of signs
\item $\bm{\alpha^e}: \alpha^e_n=true$ if $\alpha_{m,n}^{(l)}$ erased = vector of erasure flags
\item In a first phase the new variable to check node messages ($\alpha$) are computed (and possibly erased) from the posterior LLRs and the compact representation of the row information. The new compact representation of the row information is created.
\item In a second phase the posterior LLRs ($\post$) are updated using the new compact representation of the row information.
\end{itemize}
Using this compact form, $\beta_{m,n}^{(l)}$ can be computed from $r_m^{(l)}$ as shown on algorithm~\ref{alg:scms-r2b}.
\begin{algorithm}
\small
\begin{algorithmic}[1]
\If{$n=r_m^{(l)}.i$}
\State $\beta_{m,n}^{(l)} \leftarrow r_m^{(l)}.\alpha^s_n \times r_m^{(l)}.sp \times r_m^{(l)}.m_2$
\Else
\State $\beta_{m,n}^{(l)} \leftarrow r_m^{(l)}.\alpha^s_n \times r_m^{(l)}.sp \times r_m^{(l)}.m_1$
\EndIf
\end{algorithmic}
\caption{Computing $\beta_{m,n}^{(l)}$ from $r_m^{(l)}$ compact data structure}\label{alg:scms-r2b}
\end{algorithm}
The SCMS algorithm with layered schedule can be re-formulated as shown on algorithm~\ref{alg:scms-optimized} where we denote $\beta(r_m^{(l)},n)$ the computation of $\beta_{m,n}^{(l)}$ from $r_m^{(l)}$ according algorithm~\ref{alg:scms-r2b}, and $\lambda_{m,n}^{(l)}$ the $\alpha_{m,n}^{(l)}$ after erasure.
\begin{algorithm}
\small
\begin{algorithmic}[1]
\For{$n = 0$ to $N-1$} \Comment For all columns
\State $\post_n^{(0)} \leftarrow \ln(\Pr(x_n = 0 | channel)/\Pr(x_n = 1 | channel))$ \Comment LLRs
\EndFor
\For{$m = 0$ to $M-1$} \Comment For all rows
\State $r_m^{(0)} = \{0,0,0,\bm{+1},+1,\bm{true}\}$\label{alg:scms-optimized:r-init0}
\EndFor
\For{$l = 1$ to $l_{max}$}
\For{$m = 0$ to $M-1$}
\State $r_m^{(l)} \leftarrow \{+\infty,+\infty,0,\bm{+1},+1,\bm{false}\}$\label{alg:scms-optimized:r-init}
\For{$n \in \Tg(m)$}
\State $\beta_{m,n}^{(l-1)} \leftarrow \beta(r_m^{(l-1)},n)$\label{alg:scms-optimized:b-old}
\State $\alpha_{m,n}^{(l)} \leftarrow \post_n^{(l-1)} - \beta_{m,n}^{(l-1)}$\label{alg:scms-optimized:a-new}
\If{$\sign(\alpha_{m,n}^{(l)}) \neq r_m^{(l-1)}.\alpha^s_n \band\ (\bnot r_m^{(l-1)}.\alpha^e_n)$}\label{alg:scms-optimized:erase-begin}
\State $\lambda_{m,n}^{(l)} \leftarrow 0$
\State $r_m^{(l)}.\alpha^e_n \leftarrow true$
\Else
\State $\lambda_{m,n}^{(l)} \leftarrow \alpha_{m,n}^{(l)}$
\EndIf \label{alg:scms-optimized:erase-end}
\State $r_m^{(l)}.\alpha^s_n \leftarrow \sign(\lambda_{m,n}^{(l)})$\label{alg:scms-optimized:r-new-begin}
\State $r_m^{(l)}.sp \leftarrow r_m^{(l)}.sp\times\sign(\lambda_{m,n}^{(l)})$
\If{$\lvert\lambda_{m,n}^{(l)}\rvert < r_m^{(l)}.m_1$}
\State $r_m^{(l)}.m_2 \leftarrow r_m^{(l)}.m_1$
\State $r_m^{(l)}.m_1 \leftarrow \lvert\lambda_{m,n}^{(l)}\rvert$
\State $r_m^{(l)}.i \leftarrow n$
\ElsIf{$\lvert\lambda_{m,n}^{(l)}\rvert < r_m^{(l)}.m_2$}
\State $r_m^{(l)}.m_2 \leftarrow \lvert\lambda_{m,n}^{(l)}\rvert$
\EndIf\label{alg:scms-optimized:r-new-end}
\EndFor
\For{$n \in \Tg(m)$}\label{alg:scms-optimized:g-begin}
\State $\beta_{m,n}^{(l)} \leftarrow \beta(r_m^{(l)},n)$\label{alg:scms-optimized:b-new}
\State $\post_n^{(l)} \leftarrow \alpha_{m,n}^{(l)} + \beta_{m,n}^{(l)}$\label{alg:scms-optimized:g-new}
\EndFor\label{alg:scms-optimized:g-end}
\EndFor
\EndFor
\end{algorithmic}
\caption{The memory-optimized SCMS algorithm with layered schedule}\label{alg:scms-optimized}
\end{algorithm}
These two phases are not independent: the second cannot start before the first one ends. With some codes, however, the first phase of a group of rows can be processed in parallel with the second phase of the previous group of rows. It is the case with the 3GPP New Radio LDPC codes.
\section{Architecture}
Thanks to these two opportunities of parallel processing the potential speed-up factor can be as large as $2\times384=768$.
\subsection{The processing pipeline}
......
%
% Embb ( http://embb.telecom-paristech.fr/ ) - This file is part of Embb
% Copyright (C) - Telecom ParisTech
% Contacts: contact-embb@telecom-paristech.fr
%
% Embb is governed by the CeCILL license under French law and abiding by the rules
% of distribution of free software. You can use, modify and/ or redistribute the
% software under the terms of the CeCILL license. You should have received a copy
% of the CeCILL license along with this program; if not, you can access it online
% at http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
%
The original SCMS algorithm, as proposed in~\cite{savin2008self}, is depicted on algorithm~\ref{alg:scms-original}, with the following notations:
\begin{itemize}
\item $\Tg$: Tanner graph of LDPC code
\item $n \in \{1,2,\ldots,N\}$: Variable Nodes (VN) of $\Tg$
\item $m \in \{1,2,\ldots,M\}$: Check Nodes (CN) of $\Tg$
\item $\Tg(n)$: set of neighbor CNs of VN $n$
\item $\Tg(m)$: set of neighbor VNs of CN $m$
\item $\bm{x}$: vector
\item $x_i$: component $i$ of vector $\bm{x}$
\item $\prio_n$: a priori information (LLR) on bit $n$ from channel observation
\item $\post_n$: a posteriori information (LLR) on bit $n$
\item $\bm{\prio}$: vector of a priori information (LLR)
\item $\bm{\post}$: vector of a posteriori information (LLR)
\item $\alpha_{m,n}$: VN-to-CN message from VN $n$ to CN $m$
\item $\beta_{m,n}$: CN-to-VN message from CN $m$ to VN $n$
\item $\sign(x)\in\{-1,+1\}$: sign of $x$ ($\sign(0)=+1$).
\item $s.x$: field $x$ of data structure $s$
\item $\mathcal{G}\setminus g$: set $\mathcal{G}$ without element $g$ ($\{g'\in\mathcal{G},\ g'\neq g\}$)
\end{itemize}
\begin{algorithm}
\small
\begin{algorithmic}[1]
\For{$n = 0$ to $N-1$} \Comment\ For all columns
\State\ $\prio_n \leftarrow \ln(\Pr(x_n = 0 | channel)/\Pr(x_n = 1 | channel))$ \Comment\ LLRs
\For{$m \in \Tg(n)$}\ \Comment\ For all active rows in column
\State\ $\alpha_{m,n}^{(0)} \leftarrow \prio_n$ \Comment\ Initialization
\EndFor%
\EndFor%
\For{$l = 1$ to $l_{max}$} \Comment\ Iterate
\For{$m = 0$ to $M-1$} \Comment\ For all rows
\For{$n \in \Tg(m)$} \Comment\ For all active columns in row
\State\ $\beta_{m,n}^{(l)} \leftarrow \left(\prod\limits_{n'\in\Tg(m)\setminus n}\sign\left(\alpha_{m,n'}^{(l-1)}\right)\right)\times\min\limits_{n'\in\Tg(m)\setminus n}\left(\lvert\alpha_{m,n'}^{(l-1)}\rvert\right)$
\EndFor%
\EndFor%
\For{$n = 0$ to $N-1$} \Comment\ For all columns
\State\ $\post_n^{(l)} \leftarrow \prio_n + \sum\limits_{m\in\Tg(n)}\beta_{m,n}^{(l)}$\label{alg:scms-original-posterior-update}
\For{$m \in \Tg(n)$} \Comment\ For all active rows in column
\State\ $\alpha_{m,n}^{(l)} \leftarrow \post_n^{(l)} - \beta_{m,n}^{(l)}$
\If{$\sign\left(\alpha_{m,n}^{(l)}\right)\neq\sign\left(\alpha_{m,n}^{(l-1)}\right)\band\alpha_{m,n}^{(l-1)}\neq 0$}
\State\ $\alpha_{m,n}^{(l)} \leftarrow 0$ \Comment\ Erasure
\EndIf%
\EndFor%
\EndFor%
\EndFor%
\end{algorithmic}
\caption{The original SCMS algorithm}\label{alg:scms-original}
\end{algorithm}
Note that algorithm~\ref{alg:scms-original} can be slightly modified to use only posterior information ($\post_n$), initialized with prior information ($\prio_n$) before the first iteration. Line~\ref{alg:scms-original-posterior-update} becomes: $\post_n^{(l)} \leftarrow \post_n^{(l-1)} + \sum\limits_{m\in\Tg(n)}\beta_{m,n}^{(l)}$ with $\post_n^{(0)}=\prio_n$. The impact on decoding performance is negigible but the savings in terms of storage space is significant.
Algorithm~\ref{alg:scms-original} can also be transformed in an equivalent algorithm where the CN-to-VN ($\beta$) and VN-to-CN ($\alpha$) message computations are swapped and their initializations are changed. Algorithm~\ref{alg:scms-modified} illustrates these two modifications.
\begin{algorithm}
\small
\begin{algorithmic}[1]
\For{$n = 0$ to $N-1$} \Comment\ For all columns
\State\ $\post_n^{(0)} \leftarrow \ln(\Pr(x_n = 0 | channel)/\Pr(x_n = 1 | channel))$ \Comment\ LLRs
\For{$m \in \Tg(n)$} \Comment\ For all active rows in column
\State\ $\alpha_{m,n}^{(0)} \leftarrow 0$ \Comment\ Initialization
\State\ $\beta_{m,n}^{(0)} \leftarrow 0$ \Comment\ Initialization
\EndFor%
\EndFor%
\For{$l = 1$ to $l_{max}$} \Comment\ Iterate
\For{$m = 0$ to $M-1$} \Comment\ For all rows
\For{$n \in \Tg(m)$} \Comment\ For all active columns in row
\State\ $\alpha_{m,n}^{(l)} \leftarrow \post_n^{(l-1)} - \beta_n^{(l-1)}$
\If{$\sign(\alpha_{m,n}^{(l)}) \neq \sign(\alpha_{m,n}^{(l-1)}) \band \alpha_{m,n}^{(l-1)} \neq 0$}
\State\ $\alpha_{m,n}^{(l)} \leftarrow 0$ \Comment\ Erase message
\EndIf%
\EndFor%
\For{$n \in \Tg(m)$} \Comment\ For all active columns in row
\State\ $\beta_{m,n}^{(l)} \leftarrow \left(\prod\limits_{n'\in\Tg(m)\setminus n}\sign\left(\alpha_{m,n'}^{(l-1)}\right)\right)\times\min\limits_{n'\in\Tg(m)\setminus n}\left(\lvert\alpha_{m,n'}^{(l-1)}\rvert\right)$
\EndFor%
\EndFor%
\For{$n = 0$ to $N-1$} \Comment\ For all columns
\State\ $\post_n^{(l)} \leftarrow \post_n^{(l-1)} + \sum\limits_{m\in\Tg(n)}\beta_{m,n}^{(l)}$
\EndFor%
\EndFor%
\end{algorithmic}
\caption{The modified SCMS algorithm}\label{alg:scms-modified}
\end{algorithm}
The layered schedule proposed in~\cite{mansour2006turbo} speeds-up the propagation of the posterior information and reduces the average number of iterations. Algorithm~\ref{alg:scms-modified-layered} depicts this proposal applied to the modified SCMS algorithm~\ref{alg:scms-modified}.
\begin{algorithm}
\small
\begin{algorithmic}[1]
\For{$n = 0$ to $N-1$} \Comment\ For all columns
\State\ $\post_n^{(0)} \leftarrow \ln(\Pr(x_n = 0 | channel)/\Pr(x_n = 1 | channel))$ \Comment\ LLRs
\For{$m \in \Tg(n)$} \Comment\ For all active rows in column
\State\ $\alpha_{m,n}^{(0)} \leftarrow 0$ \Comment\ Initialization
\State\ $\beta_{m,n}^{(0)} \leftarrow 0$ \Comment\ Initialization
\EndFor%
\EndFor%
\For{$l = 1$ to $l_{max}$} \Comment\ Iterate
\For{$m = 0$ to $M-1$} \Comment\ For all rows
\For{$n \in \Tg(m)$} \Comment\ For all active columns in row
\State\ $\alpha_{m,n}^{(l)} \leftarrow \post_n^{(l-1)} - \beta_n^{(l-1)}$
\If{$\sign(\alpha_{m,n}^{(l)}) \neq \sign(\alpha_{m,n}^{(l-1)}) \band \alpha_{m,n}^{(l-1)} \neq 0$}
\State\ $\alpha_{m,n}^{(l)} \leftarrow 0$ \Comment\ Erase message
\EndIf%
\EndFor%
\For{$n \in \Tg(m)$} \Comment\ For all active columns in row
\State\ $\beta_{m,n}^{(l)} \leftarrow \left(\prod\limits_{n'\in\Tg(m)\setminus n}\sign\left(\alpha_{m,n'}^{(l-1)}\right)\right)\times\min\limits_{n'\in\Tg(m)\setminus n}\left(\lvert\alpha_{m,n'}^{(l-1)}\rvert\right)$
\State\ $\post_n^{(l)} \leftarrow \post_n^{(l-1)} + \sum\limits_{m\in\Tg(n)}\beta_{m,n}^{(l)}$
\EndFor%
\EndFor%
\EndFor%
\end{algorithmic}
\caption{The modified and layered SCMS algorithm}\label{alg:scms-modified-layered}
\end{algorithm}
With the layered schedule (algorithm~\ref{alg:scms-modified-layered}), the posterior information $\post_n^{(l)}$ must be stored. The $\beta_{m,n}^{(l)}$ (CN-to-VN messages) depend entirely on limited information about the set of the $\alpha_{m,n}^{(l)}$ (argmin, first and second minimum of absolute values, signs, product of signs). The SCMS algorithm also requires that the signs of the $\alpha_{m,n}^{(l)}$ are stored, along with flags indicating that they have been erased. All in all, for each row $m$, the set of $\alpha_{m,n}^{(l)}$ can be represented in the compact form $r_m^{(l)} = \{m_1,m_2,i,\bm{\alpha^s},sp,\bm{\alpha^e}\}$:
\begin{itemize}
\item $m_1=\min\limits_{n\in\Tg(m)}\lvert\alpha_{m,n}^{(l)}\rvert=$ minimum of absolute values
\item $i=\argmin\limits_{n\in\Tg(m)}\lvert\alpha_{m,n}^{(l)}\rvert=$ index of $m_1$
\item $m_2=\min\limits_{n\in\Tg(m)\setminus i}\lvert\alpha_{m,n}^{(l)}\rvert=$ second minimum of absolute values
\item $\bm{\alpha^s}: \alpha^s_n=\sign(\alpha_{m,n}^{(l)})=$ vector of signs
\item $sp=\prod\limits_{n\in\Tg(m)}\sign(\alpha_{m,n}^{(l)})=$ product of signs
\item $\bm{\alpha^e}: \alpha^e_n=true$ if $\alpha_{m,n}^{(l)}$ erased = vector of erasure flags
\end{itemize}
Using this compact form, $\beta_{m,n}^{(l)}$ can be computed from $r_m^{(l)}$ as shown on algorithm~\ref{alg:scms-r2b}.
\begin{algorithm}
\small
\begin{algorithmic}[1]
\If{$n=r_m^{(l)}.i$}
\State\ $\beta_{m,n}^{(l)} \leftarrow r_m^{(l)}.\alpha^s_n \times r_m^{(l)}.sp \times r_m^{(l)}.m_2$
\Else%
\State\ $\beta_{m,n}^{(l)} \leftarrow r_m^{(l)}.\alpha^s_n \times r_m^{(l)}.sp \times r_m^{(l)}.m_1$
\EndIf%
\end{algorithmic}
\caption{Computing $\beta_{m,n}^{(l)}$ from $r_m^{(l)}$ compact data structure}\label{alg:scms-r2b}
\end{algorithm}
The SCMS algorithm with layered schedule can be re-formulated as shown on algorithm~\ref{alg:scms-optimized} where we denote $\beta(r_m^{(l)},n)$ the computation of $\beta_{m,n}^{(l)}$ from $r_m^{(l)}$ and $n$ according algorithm~\ref{alg:scms-r2b}.
\begin{algorithm}
\small
\begin{algorithmic}[1]
\For{$n = 0$ to $N-1$} \Comment\ For all columns
\State\ $\post_n^{(0)} \leftarrow \ln(\Pr(x_n = 0 | channel)/\Pr(x_n = 1 | channel))$ \Comment\ LLRs
\EndFor%
\For{$m = 0$ to $M-1$} \Comment\ For all rows
\State\ $r_m^{(0)} = \{0,0,0,\bm{+1},+1,\bm{true}\}$\label{alg:scms-optimized:r-init0}
\EndFor%
\For{$l = 1$ to $l_{max}$}
\For{$m = 0$ to $M-1$}
\State\ $r_m^{(l)} \leftarrow \{+\infty,+\infty,0,\bm{+1},+1,\bm{false}\}$\label{alg:scms-optimized:r-init}
\For{$n \in \Tg(m)$}
\State\ $\alpha \leftarrow \post_n^{(l-1)} - \beta(r_m^{(l-1)},n)$\label{alg:scms-optimized:a-new}
\If{$\sign(\alpha) \neq r_m^{(l-1)}.\alpha^s_n \band\ (\bnot r_m^{(l-1)}.\alpha^e_n)$}\label{alg:scms-optimized:erase-begin}
\State\ $\alpha \leftarrow 0$
\State\ $r_m^{(l)}.\alpha^e_n \leftarrow true$
\EndIf\label{alg:scms-optimized:erase-end}
\State\ $r_m^{(l)}.\alpha^s_n \leftarrow \sign(\alpha)$\label{alg:scms-optimized:r-new-begin}
\State\ $r_m^{(l)}.sp \leftarrow r_m^{(l)}.sp\times\sign(\alpha)$
\If{$\lvert\alpha\rvert < r_m^{(l)}.m_1$}
\State\ $r_m^{(l)}.m_2 \leftarrow r_m^{(l)}.m_1$
\State\ $r_m^{(l)}.m_1 \leftarrow \lvert\alpha\rvert$
\State\ $r_m^{(l)}.i \leftarrow n$
\ElsIf{$\lvert\alpha\rvert < r_m^{(l)}.m_2$}
\State\ $r_m^{(l)}.m_2 \leftarrow \lvert\alpha\rvert$
\EndIf\label{alg:scms-optimized:r-new-end}
\EndFor%
\For{$n \in \Tg(m)$}\label{alg:scms-optimized:g-begin}
\State\ $\post_n^{(l)} \leftarrow \post_n^{(l-1)} + \beta(r_m^{(l)},n)$\label{alg:scms-optimized:g-new}
\EndFor\label{alg:scms-optimized:g-end}
\EndFor%
\EndFor%
\end{algorithmic}
\caption{The memory-optimized SCMS algorithm with layered schedule}\label{alg:scms-optimized}
\end{algorithm}
% vim: set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab textwidth=0:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment