📄 pr9_25.m
字号:
%Problem 9.25;%
%convolutional encoder;
clear all;
Go=[133;145;175]; %set matrix of generator polynomials (rows) in octal representation;
n=size(Go,1); R=1/n; %number of symbols in the frame and rate;
Gb=de2bi(oct2dec(Go),'left-msb'); %conversion octal-number representation of polynomials to binary vectors via decimal numbers;
[i,j]=find(Gb); nzcl=min(j); Gb=Gb(:,nzcl:end); %removal of left zero-padding;
nu=size(Gb,2); %constraint length;
b=[de2bi(1),zeros(1,nu-1)]; %message polynomial padded by tail bits;
for k=1:n
U(k,:)=gfadd(gfconv(b,Gb(k,:)),zeros(1,length(b)+nu-1)); %computing code symbols
end;
u=U(:)'; %codeword ready;
fprintf('\n'); disp('generator polynomials are rows of G='); disp(Gb);
fprintf('\n'); disp(' cntlgth rate'); disp([nu,1/n]);
fprintf('\n'); disp('bitstream b='); disp(b);
fprintf('\n'); disp('codeword u='); disp(u);
fprintf('\n'); fprintf(['weight w=',num2str(sum(u))]); %codeword weight;
fprintf('\n');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -