summaryrefslogtreecommitdiff
path: root/1655/CH2/EX2.13.2/Example_2_13_2.sce
blob: c551ba0e62e74b3569d28c5200b946efa782431b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Example 2.13.2  page 2.57

clc;
clear;

Pin=500d-6;     //input power
L=200;      //length of fiber
loss=2;     //loss associated with fiber

Pin_dbm=10 * log10 (Pin/(10^-3));   //computing input power in dBm
Pin_dbm=round(Pin_dbm);
Pout_dbm=Pin_dbm-L*loss;        //computing output power level
Pout= 10^(Pout_dbm/10);
printf("Output power is %.2e mW.",Pout);