📄 bchenco.m
字号:
function code = bchenco(msg, n, k, pg);
%BCHENCO Encodes message signal using binary BCH code.
% CODE = BCHENCO(MSG, N, K) encodes the K-column message MSG to N-column
% codeword CODE by using BCH code method.
%
% CODE = BCHENCO(MSG, N, K, PG) specifies the generator polynomial PG
% for the BCH code.
%
% Wes Wang 8/3/94, 9/30/95
% Copyright (c) 1995-96 by The MathWorks, Inc.
% $Revision: 1.1 $ $Date: 1996/04/01 17:52:08 $
% routine check
if nargin < 3
error('Not enough input variable');
end;
[n_msg, m_msg] = size(msg);
if m_msg ~= k
error('The input dimension does not match the message length.')
end;
% code calculation.
if nargin < 4
pg = bchpoly(n, k);
end;
[h, gen] = cyclgen(n, pg);
code = rem(msg * gen, 2);
%----- end of bchenco -----
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -