Graphics Programs Reference
In-Depth Information
delta = abs(vt - vt0) * 10000.0;
vt0 = vt;
end
if (np <= 50)
temp = vt / (1.0 + snrbar);
pd = 1.0 - incomplete_gamma(temp,np);
return
else
temp1 = snrbar + 1.0;
omegabar = sqrt(np) * temp1;
c3 = -1.0 / sqrt(9.0 * np);
c4 = 0.25 / np;
c6 = c3 * c3 /2.0;
V = (vt - np * temp1) / omegabar;
Vsqr = V *V;
val1 = exp(-Vsqr / 2.0) / sqrt( 2.0 * pi);
val2 = c3 * (V^2 -1.0) + c4 * V * (3.0 - V^2) - ...
c6 * V * (V^4 - 10. * V^2 + 15.0);
q = 0.5 * erfc (V/sqrt(2.0));
pd = q - val1 * val2;
end
Listing 2.20. MATLAB Program Ðfig2_12.mÑ
% This program is used to produce Fig. 2.12
clear all
pfa = 1e-10;
nfa = log(2) / pfa;
index = 0;
for snr = -10:.5:30
index = index +1;
prob1(index) = pd_swerling2 (nfa, 1, snr);
prob10(index) = pd_swerling2 (nfa, 10, snr);
prob50(index) = pd_swerling2 (nfa, 50, snr);
prob100(index) = pd_swerling2 (nfa, 100, snr);
end
x = -10:.5:30;
plot(x, prob1,'k',x,prob10,'k:',x,prob50,'k--', ...
x, prob100,'k-.');
axis([-10 30 0 1])
xlabel ('SNR - dB')
ylabel ('Probability of detection')
legend('np = 1','np = 10','np = 50','np = 100')
grid
Search WWH ::




Custom Search