Turbo在瑞利衰弱信道下的仿真
各位大佬,在此请教一个问题:
我做了一个基于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;