Encoding a polar code

The recursive $ \left(U+V\mid V\right)$ structure of a polar code leads in a natural way to an encoding algorithm for it. We use the following algorithm to encode a polar code. To encode a polar code of length $ 2^n$ and dimension $ k$ we take a binary vector $ \mathbf{u}$ with $ 2^n-k$ positions fixed to 0 and $ k$ positions where the information bits are copied to. Encoding is performed by calling Encode $ (0,2^n,n,\mathbf{u})$ and by outputting the resulting vector $ \mathbf{u}$.
\begin{algorithmic}
\Function{Encode}{$i,j,t,\mathbf{u}$}
\If{$t>0$\ }
\State{\C...
...] \gets u[l] \oplus u[l+2^{t-1}]$}
\EndFor
\EndIf
\EndFunction
\end{algorithmic}

Implement this function in Java and check that it gives the right encoding of the polar code of length $ 8$ that you have found in the previous question.



Jean-Pierre TILLICH 2019-03-08