首页 > 编程语言 > 详细

Python实现BSC信道

时间:2020-06-06 12:42:34      阅读:72      评论:0      收藏:0      [点我收藏+]
import numpy as np
z = np.random.randint(0, 2, size=(100, 100))
bit_size = 100 * 100
nz = z^(np.random.random(z.shape) < 0.15)  #binary  symmetric channel 0.15 is the exact probability you specify 
bit_numerrs = np.sum(z != nz)
bit_pcterrs = bit_numerrs/float(bit_size)

参考:
1. Binary symmetric channel - MATLAB bsc - MathWorks 中国
2. numpy - How to implement Binary Symmetric Channel in Python correctly? - Stack Overflow

Python实现BSC信道

原文:https://www.cnblogs.com/lingr7/p/13053494.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!