RSC编码代码
来源:互联网 发布:ipad装windows系统教程 编辑:程序博客网 时间:2024/05/16 11:43
output1 = zeros(1,L_total); %preallocate for speedinput = [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)]; %寄存器移位endfor 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