📄 untitled2.asv
字号:
m = 4; n = 2^m-1; % Codeword length
params = bchpoly(n); % Arbitrarily focus on 3rd row of params.
k = 1; % Codeword length
t = params(3,3); % Error-correction capability
msg = randint(150,1);
code = bchenco(msg,n,k); % Encode the message.
% Corrupt up to t bits in each codeword.
y = awgn(code,10,'measured'); % Add white Gaussian noise
% Decode the noisy code.
[newmsg,err,ccode] = bchdeco(noisycode,k,t);
decode= [newmsg,err,ccode]
if ccode==code
disp('所有错误已更正')
end
if newmsg==msg
disp('所有信息已恢复')
end
plot(decode);
title('')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -