python实现 Polar码极化过程

python实现 Polar码极化过程BEC信道极化现象以消除概率=0.5的二进制消除信道BEC为例,信道的错误概率上限巴氏参数可通过以下确定的递归计算得到:Python实现程序如下:importosimportnumpyasnpimportmatplotlib.pyplotaspltdefmain():index=10;n=np.power(2,range(1,index+1))W=np.zeros((n[9]+1,n[9]+1));W=W.as

大家好,欢迎来到IT知识分享网。

BEC信道极化现象
以消除概率=0.5 的二进制消除信道 BEC 为例,信道的错误概率上限巴氏参数可通过以下确定的递归计算得到:
在这里插入图片描述

Python实现程序如下:

import os
import numpy as np
import matplotlib.pyplot as plt

def main():
    index = 10;
    n = np.power(2, range(1, index+1))
    W = np.zeros((n[9]+1,n[9]+1));
    W = W.astype(np.float64)
    W[1][1] = 0.5;
    for i in n :
        for j in range( 1,int(i / 2)+1):
            W[i, 2 * j - 1] = W[int(i / 2), j] * W[int(i / 2), j]   #^ 2;
            W[i, 2 * j] = 2 * W[int(i / 2), j] - W[int(i / 2), j]*W[int(i / 2), j]   # ^ 2;

    plt.scatter(range(1, 1024), W[1024,1:1024], s = 5,label='b.');
    plt.axis([0, 1024, 0 ,1]);
    plt.xlabel('Channel index');
    plt.ylabel('Symmetric capacity');
    plt.show();


if __name__ == '__main__':
    main()

运行结果:

在这里插入图片描述

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/23309.html

(0)
上一篇 2023-09-15 10:00
下一篇 2023-09-16 10:00

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信