📄 bercurve_cv_soft2.m
字号:
% Computes BER v EbNo curve for convolutional encoding / soft decision
% Viterbi decoding scheme assuming BPSK
% Brute force Monte Carlo approach is unsatisfactory (takes too long)
% to find the BER curve.
% The computation uses a quasi-analytic (QA) technique that relies on the
% estimation (approximate one) of the information-bits Weight Enumerating
% Function (WEF) using
% a simulation of the convolutional encoder
% Once the WEF is estimated, the analystic formula for the BER is used.
%
% For more info on the QA, see for example:
% "Error Control Coding", Lin & Costello, 2nd edition p 530-535
% "Simulation of Communication Systems", Jeruchim et al, 1992, p 619
% (c) Dr B. Gremont, 2007
clear
clc
codeselect=1;
switch codeselect
case 1
Gpoly=[27 31];
case 2
Gpoly=[6 2 6; 2 4 4];
case 3
Gpoly=[4 2 6; 1 4 7];
case 4
Gpoly=[60 30 70; 14 40 74];
otherwise
Gpoly=[561 753];
end
%===============================================================
% Find key descriptors of the convolutional code
%===============================================================
[K, M, nu, n, k, coderate, StateTable]=getcodeparameters(Gpoly);
% StateTable
%===============================================================
% Estimate the information WEF (Weight Enumerating Function)
%===============================================================
[Bd, dfree]=EstimateBitWEF(Gpoly);
figure(1)
bar(Bd)
title('Estimated information bit WEF')
xlabel('d')
ylabel('Bd')
%===============================================================
% Compute BER v EbNo for unqnatized & quantized VA decoders
%===============================================================
EbNodBvals=0.5:0.5:15;
% compute BER for unquantized soft decision VA decoding
Pb=ComputeBerSoftDecisionUnquantized(EbNodBvals, Bd, coderate);
figure(2)
if ishold, hold,end
semilogy(EbNodBvals,Pb,'r') % plots results
hold
% compute BER for quantized soft decision VA deciding
% Nb; if Q=2 then we get hard quantized VA decoding results
% we assume uniform quantization with Q levels regularly spaced
% between 0 and 1
Qvals=2.^(1:5); % No of quantization levels for quantized sift decision VA deoding
figure(2)
for i=1:length(Qvals)
Q=Qvals(i);
Pb=ComputeBerSoftDecisionQuantized(EbNodBvals, Q, Bd, coderate);
if Q==2,
semilogy(EbNodBvals,Pb,'b') % plots results
else
semilogy(EbNodBvals,Pb,'k') % plots results
end
figure(gcf)
pause(1)
end
axis([2 15 10.^(-12) 10.^(-2)])
grid
figure(gcf)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -