
output1 = zeros(1,L_total); %preallocate for speed
input = [x zeros(1,m)];
state1 = zeros(1,m);
for i=1:L_info %g=[1 0 1 1;1 1 0 1]; m=3
in1 = xor(rem(g(1,2:end)*state1',2),input(i)); %mode 2 plus
output1(i) = rem(g(2,:)*[in1 state1]',2);
state1 = [in1,state1(1:m-1)]; %寄存器移位
end
for i=L_info+1:L_total %terminate the trellis
input(i) = rem(g(1,2:end)*state1',2); %将前向反馈作为输入,模拟真实的硬件
output1(i) = rem(g(2,:)*[0 state1]',2);
state1 = [0,state1(1:m-1)] ; %寄存器移位
end

3242

被折叠的 条评论
为什么被折叠?



