summaryrefslogtreecommitdiff
path: root/2399/CH2/EX2.9.2/Example2_9_2.sce
blob: 077e995f184016ddfb1354ad8ce5bc77fa2cb8ba (plain)
1
2
3
4
5
6
7
8
9
10
11
// Example 2.9.2
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);