加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

线性分组码编码译码

(2012-07-18 10:49:04)
标签:

线性分组码

linear

block

code

编码

encode

译码

decode

(6

3)

杂谈

分类: 通信原理MATLAB仿真
The execution of this MATLAB program will generate the following results, which include 
the erroneous codeword,the syndrome,the error pattern,and the corrected codeword.

% Chapter 15 Error Correcting Codes
% In this section, we provide MATLAB programs to illustrate simple
% examples of block encoders and decodes. We focus on the simpler case
% of hard-decision decoding based on syndromes.
%
% In the first experiment, we provide a program to decode the(6,3)
% linear block code of Example 15.1.
%
% Matlab Program < Ex15_1.m >
% to illustrate encoding and decoding of (6,3) block code
% in Example 15.1
%
G=[1 0 0 1 0 1      % Code Generator
   0 1 0 0 1 1
   0 0 1 1 1 0];
H=[1 0 1            % Parity Check Matrix
   0 1 1
   1 1 0
   1 0 0
   0 1 0
   0 0 1]';
E=[0 0 0 0 0 0      % List of correctable errors
   1 0 0 0 0 0
   0 1 0 0 0 0
   0 0 1 0 0 0
   0 0 0 1 0 0
   0 0 0 0 1 0
   0 0 0 0 0 1
   1 0 0 0 1 0];
K=size(E,1);
Syndrome=mod(mtimes(E,H'),2);   % Find Syndrome List
r=[1 1 1 0 1 1]                 % Received codeword
display(['Syndrom ','Error Pattern'])
display(num2str([Syndrome E]))
x=mod(r*H',2);                  % Compute syndrome
for kk=1:K,
    if Syndrome(kk,:)==x,
        idxe=kk;
    end
end
syndrome=Syndrome(idxe,:)       % display the syndrome
error=E(idxe,:)
cword=xor(r,error)              % Error correction

%------------------------------------------------------------

% 参考文献 

% B.P.拉兹,丁峙. 现代数字与模拟通信系统[M]. 第4版. 北京:电子工业出版社,2011:966-967

1. % The linear block code is used to encode and the syndrome decoding i.
% 采用线性分组码进行编码,用伴随式译码。

0

阅读 收藏 喜欢 打印举报/Report
前一篇:新号码
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有