Graphics Programs Reference
In-Depth Information
nfa = log(2) / pfa;
index = 0;
for snr = -10:.5:30
index = index +1;
prob1(index) = pd_swerling3 (nfa, 1, snr);
prob10(index) = pd_swerling3 (nfa, 10, snr);
prob50(index) = pd_swerling3(nfa, 50, snr);
prob100(index) = pd_swerling3 (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
Listing 2.23. MATLAB Function Ðpd_swerling4.mÑ
function pd = pd_swerling4 (nfa, np, snrbar)
% This function is used to calculate the probability of detection
% for Swerling 4 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);
vt = vt0 + (num / (deno+eps));
delta = abs(vt - vt0) * 10000.0;
vt0 = vt;
end
h8 = snrbar /2.0;
Search WWH ::




Custom Search