Graphics Programs Reference
In-Depth Information
Listing 2.15. MATLAB Program Ðfig2_9.mÑ
% This program is used to produce Fig. 2.9
close all
clear all
pfa = 1e-9;
nfa = log(2) / pfa;
b = sqrt(-2.0 * log(pfa));
index = 0;
for snr = 0:.1:20
index = index +1;
a = sqrt(2.0 * 10^(.1*snr));
pro(index) = marcumsq(a,b);
prob205(index) = pd_swerling5 (pfa, 1, 10, snr);
end
x = 0:.1:20;
plot(x, pro,'k',x,prob205,'k:');
axis([0 20 0 1])
xlabel ('SNR - dB')
ylabel ('Probability of detection')
legend('np = 1','np = 10')
grid
Listing 2.16. MATLAB Function Ðpd_swerling1.mÑ
function pd = pd_swerling1 (nfa, np, snrbar)
% This function is used to calculate the probability of detection
% for Swerling 1 targets.
format long
snrbar = 10.0^(snrbar/10.);
eps = 0.00000001;
delmax = .00001;
delta =10000.;
% Calculate the threshold Vt
pfa = np * log(2) / nfa;
sqrtpfa = sqrt(-log10(pfa));
sqrtnp = sqrt(np);
vt0 = np - sqrtnp + 2.3 * sqrtpfa * (sqrtpfa + sqrtnp - 1.0);
vt = vt0;
while (abs(delta) >= vt0)
igf = incomplete_gamma(vt0,np);
num = 0.5^(np/nfa) - igf;
temp = (np-1) * log(vt0+eps) - vt0 - factor(np-1);
deno = exp(temp);
Search WWH ::




Custom Search