Graphics Programs Reference
In-Depth Information
% This function uses "incomplete_gamma.m".
delmax = .00001;
eps = 0.000000001;
delta =10000.;
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
Listing 2.13. MATLAB Program Ðfig2_8.mÑ
% Use this program to reproduce Fig. 2.8 of text
clear all
for n= 1: 1:150
[pfa1 y1(n)] = threshold(1000,n);
[pfa2 y3(n)] = threshold(10000,n);
[pfa3 y4(n)] = threshold(500000,n);
end
n =1:1:150;
loglog(n,y1,'k',n,y3,'k--',n,y4,'k-.');
axis([0 200 1 300])
xlabel ('Number of pulses');
ylabel('Threshold')
legend('nfa=1000','nfa=10000','nfa=500000')
grid
Listing 2.14. MATLAB Function Ðpd_swerling5.mÑ
function pd = pd_swerling5 (input1, indicator, np, snrbar)
% This function is used to calculate the probability of
% for Swerling 5 or 0 targets for np>1.
if(np == 1)
'Stop, np must be greater than 1'
return
Search WWH ::




Custom Search