Polar Code(3)编码实例
前言
在《Polar
Code(2)编码原理》中详细阐述了Polar
Code编码原理,为更好地理解编码过程,本文将给出一个编码实例。
设码长为\(N=8\),消息比特数\(K=4\)。列出所有使用到的公式:
\[c_{1}^{N}=u_{1}^{N}{G_{N}}\]
\[{G_{N}}={B_{N}}{F^{\otimes n}}\]
\[{F^{\otimes n}}=F\otimes {F^{\otimes \left( n-1 \right)}}\]
\[F=\left[ \begin{matrix} 1 & 0 \\ 1 & 1 \\ \end{matrix} \right]\]
\[{B_{N}}={R_{N}}\left( {I_{2}}\otimes {B_{N/{2}\;}} \right)\]
\[{B_{2}}={I_{2}}\]
极化信道的可靠性估计
假设对于各二进制删除信道(BEC),已计算出各个分裂信道的巴氏参数\(Z\left( W_{N}^{\left( i \right)}
\right)\)。
比特混合
假设通过第一步得到巴氏参数最小的4个子信道序号为“4,6,7,8”,则消息比特序号集合记为
\[A=\left\{ 4,6,7,8 \right\}\]
则固定比特序号集合为
\[{A^{c}}=\left\{ 1,2,3,5 \right\}\]
设信息比特集合为\(\left( {i_{1}},{i_{2}},{i_{3}},{i_{4}} \right)=\left( 1,1,1,1 \right)\),固定比特集合为\(\left( 0,0,0,0 \right)\),则最终得到
\[u_{1}^{8}=\left[ 0,0,0,{i_{1}},0,{i_{2}},{i_{3}},{i_{4}} \right]=\left[ 0,0,0,1,0,1,1,1 \right]\]
构造生成矩阵
求排序矩阵BN
递归式:
\[{B_{8}}={R_{8}}\left( {I_{2}}\otimes {B_{4}} \right)\]
\[{B_{4}}={R_{4}}\left( {I_{2}}\otimes {B_{2}} \right)\]
计算:
\[{B_{2}}=\left[ \begin{matrix} 1 & 0 \\ 0 & 1 \\ \end{matrix} \right]\]
\[{I_{2}}\otimes {B_{2}}=\left[ \begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{matrix} \right]\]
\({R_{4}}\)由\({I_{4}}\)变换得来,先排\({I_{4}}\)的奇数列,再排\({I_{4}}\)的偶数列:
\[{R_{4}}=\left[ \begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ \end{matrix} \right]\Leftarrow {I_{4}}=\left[ \begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{matrix} \right]\]
\[{ {B}_{4}}={ {R}_{4}}\left( { {I}_{2}}\otimes { {B}_{2}} \right)=\left[ \begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ \end{matrix} \right]\cdot \left[ \begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{matrix} \right]\text{=}\left[ \begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ \end{matrix} \right]\]
\[{I_{2}}\otimes {B_{4}}=\left[ \begin{matrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{matrix} \right]\]
\({R_{8}}\)由\({I_{8}}\)变换得来,先排\({I_{8}}\)的奇数列,再排\({I_{8}}\)的偶数列:
\[{R_{8}}=\left[ \begin{matrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 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& 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{matrix} \right] \\ & \begin{matrix} {} & {} & {} & \begin{matrix} {} & {} & = \nonumber \left[ \begin{matrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{matrix} \right] \\ \end{matrix} \\ \end{matrix} \\ \end{align}\]
求F的n次克罗内克积
递归式:
\[{F^{\otimes 3}}=F\otimes {F^{\otimes 2}}\]
\[{F^{\otimes 2}}=F\otimes {F^{\otimes 1}}\]
计算:
\[{F^{\otimes 1}}\text{=}F=\left[ \begin{matrix} 1 & 0 \\ 1 & 1 \\ \end{matrix} \right]\]
\[{F^{\otimes 2}}=F\otimes {F^{\otimes 1}}=\left[ \begin{matrix} 1 & 0 \\ 1 & 1 \\ \end{matrix} \right]\otimes {F^{\otimes 1}}=\left[ \begin{matrix} {F^{\otimes 1}} & 0 \\ {F^{\otimes 1}} & {F^{\otimes 1}} \\ \end{matrix} \right]=\left[ \begin{matrix} 1 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 1 & 1 & 1 \\ \end{matrix} \right]\]
\[{F^{\otimes 3}}=F\otimes {F^{\otimes 2}}=\left[ \begin{matrix} 1 & 0 \\ 1 & 1 \\ \end{matrix} \right]\otimes {F^{\otimes 2}}=\left[ \begin{matrix} {F^{\otimes 2}} & 0 \\ {F^{\otimes 2}} & {F^{\otimes 2}} \\ \end{matrix} \right]\text{=}\left[ \begin{matrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\ 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \end{matrix} \right]\]
求生成矩阵GN
\[\begin{align}
& { {G}_{8}}={ {B}_{8}}{ {F}^{\otimes 3}}=\nonumber \left[
\begin{matrix}
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
\end{matrix} \right]\cdot \left[ \begin{matrix}
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\
1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 \\
1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
\end{matrix} \right] \\
& \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \text{=} \nonumber \left[
\begin{matrix}
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 \\
1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\
1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\
1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
\end{matrix} \right] \\
\end{align}\]
生成Polar Code
\[\nonumber \begin{align}
& c_{1}^{8}=u_{1}^{8}{G_{8}}=\left[ \begin{matrix}
0 & 0 & 0 & 1 & 0 & 1 & 1 & 1 \\
\end{matrix} \right]\cdot \left[ \begin{matrix}
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 \\
1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\
1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\
1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
\end{matrix} \right] \\
& \ \ \ \ =\left[ \nonumber \begin{matrix}
0 & 1 & 1 & 0 & 1 & 0 & 0 & 1 \\
\end{matrix} \right] \\
\end{align}\]