encode.m

来自「Digital communication labs,」· M 代码 · 共 12 行

M
12
字号
function [encoded,received]=encode(G,n,information_bits1)

encoded1=information_bits1*G;    % calculating the encoded bits by multiplying message with the G Matrix

for i=1:n;                        % this suff is for the XOR of product of above bits
    if rem(encoded1(1,i),2)==0
        encoded1(1,i)=0;
    else encoded1(1,i)=1;
    end 
end

encoded=encoded1;  % ENCODED BITS

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?