encode_bit.m

来自「一个turbo码的仿真程序」· M 代码 · 共 18 行

M
18
字号
function [output, state] = encode_bit(g, input, state)% the rate is 1/n% k is the constraint length% m is the amount of memory[n,k] = size(g);m = k-1;% determine the next output bitfor i=1:n   output(i) = g(i,1)*input;   for j = 2:k      output(i) = xor(output(i),g(i,j)*state(j-1));   end;endstate = [input, state(1:m-1)];

⌨️ 快捷键说明

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