small_bec_perf.py

来自「著名的ldpc编解码的资料及源代码」· Python 代码 · 共 33 行

PY
33
字号
"""This test creates a dual of a small regular Gallager code,generates random binary words, erases a fraction of the bits in theword and tries to match the unerased positions with a codeword."""import randomfrom pycodes.utils import CodeMakerfrom pycodes.utils.bec_quant_perf import *#random.setstate((1, (25685, 5259, 296), None))seed = random.getstate()print 'Using seed ', seedcol_w = 3row_w = 6N=3600K=N*col_w/row_wE=(N-K)*row_wL=CodeMaker.make_H_gallager(N,col_w,row_w)numSteps = 6numToErase = range(round((N-K)*1.14),round(K*1.165),round(.025*K/numSteps))numTimes = [200]*len(numToErase)tester = BECTester([CodeParams(N,K,E,L,'small test',numToErase,numTimes)])tester.ReportStats(title='Test results for small length %i code w/seed %s: \n'                   % (N,`seed`), reportFile='/tmp/small_test_results.py',                   imgFile='/tmp/small_test_results.eps')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?