?? 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 + -