summaryrefslogtreecommitdiff
path: root/2409/CH12/EX12.17/Ex12_17.sce
blob: 93df132f7ca48ca673fd8f0d3ae45b4c1191a39a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37


//Variable Declaration

CNR=17.4   //Clear sky input C/N (dB)
T=10       //Threshold level for FM etector(dB)
Ta=272     //Value of Ta(Kelvin)
Tscs=544   //Value of Tscs(Kelvin)

//Calculation

TM=CNR-T    //Threshold margin at FM detector(dB)
CNR=10**(CNR/10)  //Converting CNR to ratio
NCR=1/CNR

function [y]=f(A)
    y=0.1-NCR*(A+(A-1)*Ta/Tscs)
endfunction    
A=fsolve(2,f)

A=10*log10(A)  //Converting A into decibels
A=round(A)

// Getting the value of probablity of exceeding A from the curve

if (A==6) then
   P=2.5*10**-4 
else
   printf("error")
end
Av=100*(1-P)  //Availability(percentage)

//Result

printf("The time system stays above threshold is %.3f percentage",Av)