📄 encoder_pc.m
字号:
%%%%%%%%%%%%%%%%%%% this is a program of punctured convolutional code encoder%%%%%%%%%%%%%%%%%%%%%%%%
function [code]=encoder(info,R)
switch R,
case 1/3,
trel = poly2trellis(9,[557 663 711]); % Define trellis.
code = convenc(info,trel);
case 1/2,
trel = poly2trellis(7,[171 133]); % Define trellis.
code = convenc(info,trel);
case 2/3,
trel = poly2trellis(7,[171 133]); % Define trellis.
code = convenc(info,trel);
code(4:4:end)=[];% Length is 2*len.
case 3/4,
trel = poly2trellis(7,[171 133]); % Define trellis.
code = convenc(info,trel);
code(3:3:end)=[];
case 4/5,
trel = poly2trellis(7,[171 133]); % Define trellis.
code = convenc(info,trel);
code(2:8:end)=[];
code(3:7:end)=[];
code(4:6:end)=[];
case 4/9,
trel = poly2trellis(9,[557 663 711]); % Define trellis.
code = convenc(info,trel);
code(4:4:end)=[];% Length is 2*len.
case 15/16,
trel = poly2trellis(7,[171 133]); % Define trellis.
code = convenc(info,trel);
code(2:15:end)=[];
code(3:14:end)=[];
code(4:13:end)=[];
code(5:12:end)=[];
code(6:11:end)=[];
code(7:10:end)=[];
code(8:9:end)=[];
otherwise,
error('Unsupported Rate');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -