⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demultiplex.m

📁 该程序是turbo码仿真程序,由12个m文件组成,分别是turbo编码(包括凿孔和非凿孔turbo码生成),译码网格和软判决迭代译码等模块,主程序可以直接运行,也可根据需要修改相应参数
💻 M
字号:
function subr = demultiplex(r, alpha, puncture);
% Copyright 1998, Yufei Wu
% MPRG lab, Virginia Tech.
% for academic use only

% At receiver end, serial to paralle demultiplex to get the code word of each
% encoder
% alpha: interleaver mapping 
% puncture = 0: use puncturing to increase rate to 1/2;
% puncture = 1; unpunctured, rate 1/3;

% Frame size, which includes info. bits and tail bits
L_total = length(r)/(2+puncture);

% Extract the parity bits for both decoders
if puncture == 1        % unpunctured
  for i = 1:L_total  
      x_sys(i) = r(3*(i-1)+1);
      for j = 1:2
          subr(j,2*i) = r(3*(i-1)+1+j); % 1/3 rate, one info.bit, two parity bits   -yzh
      end
   end
else            % punctured, 1/2 rate
   for i = 1:L_total
       x_sys(i) = r(2*(i-1)+1);
       for j = 1:2
          subr(j,2*i) = 0;
       end   
       if rem(i,2)>0    % even position,one check bit from ENC1, one from ENC2 alternatively  --yzh
          subr(1,2*i) = r(2*i); % odd posisition is systematic bits,puntured parity bits are padded to zero   -yzh
       else
          subr(2,2*i) = r(2*i); 
       end      
   end
end       

% Extract the systematic bits for both decoders
for j = 1:L_total
% For decoder one
   subr(1,2*(j-1)+1) = x_sys(j);    % odd positions is reserved for systematic bits  -yzh
% For decoder two: interleave the systematic bits  
   subr(2,2*(j-1)+1) = x_sys(alpha(j)); % info.bits that are put into DEC2 are interleaved bits -yzh
end    


⌨️ 快捷键说明

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