📄 ex-ham7a
字号:
#!/bin/sh# Example of decoding a (7,4) Hamming code using exhaustive enumeration and# probability propagation, with an Additive White Gaussian Noise channel with # noise standard deviation of 0.5, for which Eb/N0 = 5.44 dB.## Testing is done by transmitting zero blocks, which is sufficient because # both the channel and the decoding procedure are symmetrical. WARNING: But# things can easily become non-symmetrical with bugs, so this technique should# be used with caution, and only when necessary for performance reasons. # Decoding is done three times, once minimizing block error probability, once # minimizing bit error probability, and once by up to 200 iterations of# probability propagation.set -e # Stop if an error occursset -v # Echo commands as they are readmake-pchk ex-ham7a.pchk 3 7 0:0 0:3 0:4 0:5 1:1 1:3 1:4 1:6 2:2 2:4 2:5 2:6make-gen ex-ham7a.pchk ex-ham7a.gen densetransmit 7x100000 ex-ham7a.rec 1 awgn 0.5# DECODE BY ENUMERATION TO MINIMIZE BLOCK ERROR PROBABILITYdecode ex-ham7a.pchk ex-ham7a.rec ex-ham7a.dec-blk awgn 0.5 \ enum-block ex-ham7a.genverify ex-ham7a.pchk ex-ham7a.dec-blk ex-ham7a.gen # DECODE BY ENUMERATION TO MINIMIZE BIT ERROR PROBABILITYdecode ex-ham7a.pchk ex-ham7a.rec ex-ham7a.dec-bit awgn 0.5 \ enum-bit ex-ham7a.genverify ex-ham7a.pchk ex-ham7a.dec-bit ex-ham7a.gen # DECODE BY PROBABILITY PROPAGATIONdecode ex-ham7a.pchk ex-ham7a.rec ex-ham7a.dec-prp awgn 0.5 \ prprp 200verify ex-ham7a.pchk ex-ham7a.dec-prp ex-ham7a.gen
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -