summaryrefslogtreecommitdiff
path: root/1655/CH4/EX4.15.2/Example_4_15_2.sce
diff options
context:
space:
mode:
Diffstat (limited to '1655/CH4/EX4.15.2/Example_4_15_2.sce')
-rwxr-xr-x1655/CH4/EX4.15.2/Example_4_15_2.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/1655/CH4/EX4.15.2/Example_4_15_2.sce b/1655/CH4/EX4.15.2/Example_4_15_2.sce
new file mode 100755
index 000000000..dcce8401b
--- /dev/null
+++ b/1655/CH4/EX4.15.2/Example_4_15_2.sce
@@ -0,0 +1,20 @@
+// Example 4.15.2 page 4.36
+
+clc;
+clear;
+
+L=10; //fiber length in km
+Pin=100d-6; //input power
+Pout=5d-6; //output power
+len=12; //length of optical link
+interval=1; //splices after interval of 1 km
+l=0.5; //loss due to 1 splice
+
+attenuation=-10*log10(Pin/Pout); //computing attenuation
+alpha=attenuation/L;
+signal_attenuation=-alpha*L; //computing signal attenuation
+splices_loss=(len-interval)*l; //computing splices loss
+attenuation_loss=-len*alpha //computing attenuation loss
+total_attenuation=attenuation_loss+splices_loss; //computing total attenuation
+
+printf("\nSignal attenuation is %.1f dB/Km.\nOverall attenuation is %d dB for 10 km.\nTotal attenuation is %.1f dBs for 12km.",alpha,signal_attenuation,total_attenuation);