summaryrefslogtreecommitdiff
path: root/1655/CH2/EX2.13.2/Example_2_13_2.sce
diff options
context:
space:
mode:
Diffstat (limited to '1655/CH2/EX2.13.2/Example_2_13_2.sce')
-rwxr-xr-x1655/CH2/EX2.13.2/Example_2_13_2.sce14
1 files changed, 14 insertions, 0 deletions
diff --git a/1655/CH2/EX2.13.2/Example_2_13_2.sce b/1655/CH2/EX2.13.2/Example_2_13_2.sce
new file mode 100755
index 000000000..c551ba0e6
--- /dev/null
+++ b/1655/CH2/EX2.13.2/Example_2_13_2.sce
@@ -0,0 +1,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);