test3.m

来自「GSM信道编码设计」· M 代码 · 共 30 行

M
30
字号
coder_input=[];
channel_input=[];
channel_output=[];
%for i=1:186;
 %  temp=rand;
  % if temp<0.5
   %   coder_input(i)=0;
   %else
   %   coder_input(i)=1;
   %end
   %end

coder_input=[1 0 1 1 1];
%(2,1,4)
G=[1 1 1;1 0 1];

%(6,1,4)
%G=[1 1 0 1 1;1 0 1 0 1;1 1 1 1 1;1 1 0 1 1;1 0 1 0 1;1 1 1 1 1];

k=1;

channel_output=viterbi_encoder(G,k,coder_input)

%[decoder_output,survivor_state,cumulated_metric]=viterbi_decoder(G,k,channel_output);

%if decoder_output==coder_input
 %  'Ok'
 %else
 %  'Error'
 %end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?