summaryrefslogtreecommitdiff
path: root/Optical_Communiation_by_Anasuya_Kalavar/chapter10_1.ipynb
blob: 6479ba9e9ab47539cf6123ec20e2498dc6e66006 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
 "metadata": {
  "name": "",
  "signature": "sha256:0e6d6451a42a64c2f14a17049d585a97e1d159d84d0a7abf55f333e84dfeeece"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "chapter10 - Performance measurement and monitoring"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 10.5.1, page 10-24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import sqrt\n",
      "from __future__ import division\n",
      "To=12.6     #width of output pulse\n",
      "Ti=0.3      #width of input pulse\n",
      "l=1.2       #length of measurement\n",
      "Pulse_dispersion = sqrt(To**2 - Ti**2)    #computing pulse dispersion\n",
      "PDKM=Pulse_dispersion/l         #computing pulse dispersion per Kilometer\n",
      "BW=0.44/PDKM        #computing optical bandwidth\n",
      "BW=BW*1000 \n",
      "print \"Pulse broadning is %.1f ns/km.\\nOptical bandwidth is %.1f MHz.Km.\" %(PDKM,BW) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pulse broadning is 10.5 ns/km.\n",
        "Optical bandwidth is 41.9 MHz.Km.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 10.6.1, page 10-28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import log10\n",
      "V2=12 \n",
      "V1=2.5 \n",
      "L2=3 \n",
      "L1=0.004 \n",
      "alpha_dB = 10* log10(V2/V1)/(L2-L1) \n",
      "un = 0.2/(L2-L1) \n",
      "print \"Attenuation is %.2f dB/km\\nUncertainity +/- %.3f dB.\" %(alpha_dB,un) \n",
      "#answer for attenuation in the book is wrong."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Attenuation is 2.27 dB/km\n",
        "Uncertainity +/- 0.067 dB.\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}