学习网址:
https://www.zhihu.com/question/20136144
https://www.doc88.com/p-5436827857500.html
%实现1/2卷积编码。
% function y=encoder_12(data)
clc;
clear all;
%
% data = [ 1 0 0 0 1 0 0 ]; %验证[1,1,1,0,1,1,0,0,1,1,1,0,1,1];
data = [ 1 0 0 1 0 1 1 ];
D1=0;D2=0;
for i=1:length(data)
D0=data(i);
D3=mod(D0+D1+D2,2);%输出数据B g0=(171)8=(1111001)2
D4=mod(D0+D2,2);%输出数据A g0=(133)8=(1011011)2
D2=D1;
D1=D0;
y(1,i)=D3;%输出数据A 按照S(x)=x^6+x^5+x^3+x^2+1实现的 A对应的删除码为:110
y(2,i)=D4;%输出数据B 按照S(x)=x^6+x^3+x^2+x+1实现的 B对应的删除码为:101
end
y
tt = zeros (1,14);
tt (1:2:13) = y(1,:);
tt (2:2:end) = y(2,:);
tt
% %实现1/2卷积编码。
% function y=