Turbo在瑞利衰弱信道下的仿真

weixin_47067266 2020-05-12 06:00:25
各位大佬,在此请教一个问题:
我做了一个基于Wu Yufei代码的Turbo编译码程序,想仿真在Rayleigh信道中的误码率。采用了Matlab 2009中的Rayleighchan函数和awgn函数。
但是译码之后,误码率为10^0,麻烦各位帮我看看
代码如下:
en_output = encoderm( x, g, alpha, puncture ) ; % Turbo译码器,做了BPSK调制encoder output (1->+1,0->-1)
chan = rayleighchan; %Rayleigh Channel,暂不考虑多普勒频移
r_chan = filter(chan,en_output); %Effect Channel
yk = demultiplex(r_chan,alpha,puncture); % demultiplex to get input for decoder 1 and 2
% Scale the received bits
rec_s = 0.5*L_c*yk;

% Initialize extrinsic information
% L_e(1:L_total) = zeros(1,L_total);
L_e = zeros(1,L_total);
for iter = 1:niter
% Decoder one
L_a(alpha) = L_e; % a priori info.
L_all = logmapo(rec_s(1,:), g, L_a, 1); % complete info.

L_e = L_all - 2*rec_s(1,1:2:2*L_total) - L_a; % extrinsic info.

% Decoder two
L_a = L_e(alpha); % a priori info.
L_all = logmapo(rec_s(2,:), g, L_a, 2); % complete info.

L_e = L_all - 2*rec_s(2,1:2:2*L_total) - L_a; % extrinsic info.

% Estimate the info. bits
xhat(alpha) = (sign(L_all)+1)/2;

% Number of bit errors in current iteration
err(iter) = length(find(xhat(1:L_total-m)~=x));

% Count frame errors for the current iteration
if err(iter)>0
nferr(nEN,iter) = nferr(nEN,iter)+1;
end
end
%iter

% Total number of bit errors for all iterations
errs(nEN,1:niter) = errs(nEN,1:niter) + err(1:niter);

if rem(nframe,3)==0 || nferr(nEN, niter)==ferrlim
% Bit error rate
ber(nEN,1:niter) = errs(nEN,1:niter)/nframe/(L_total-m);
% Frame error rate
fer(nEN,1:niter) = nferr(nEN,1:niter)/nframe;
...全文
97 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

70,037

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧