{
 "metadata": {
  "name": "Chapter_14"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "Chapter 14 : Optical fiber measurements"
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 14.1, page 912"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\nv2=10.7                                   #increased voltage\nv1=2.1                                    #voltage\nl1=2                                      #length in Km\nl2=0.002                                  #length in Km\n\n\n\n#Calculation\na=(10/(l1-l2))*math.log10(v2/v1)           #Attenuation\nu=0.2/(l1-l2)                              #incertainty\n\n#Result\nprint'Attenuation per Km = %.1f dB Km^-1'%a\nprint'Uncertainty = \u00b1 %.1f dB'%u",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Attenuation per Km = 3.5 dB Km^-1\nUncertainty = \u00b1 0.1 dB\n"
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 14.2, page 917"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\nt2=100                                     #time in sec\nt1=10                                      #time in sec\nti=0.525                                   #micro voltage\nto=0.021                                   #micro voltage\nC=1.64*10**4                               #thermal capacity\ntin=4.3*10**-4                             #maximum temperature rise\npop=98*10**-3                              #optical power\n\n\n#Calculation\ntc=(t2-t1)/(math.log(ti)-math.log(to))       #time constant for the calorimeter\na=(C*tin)/(pop*tc)                           #absortion loss\n\n#Result\nprint'Absorption loss in dB = %.1f dB Km^-1'%a",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Absorption loss in dB = 2.6 dB Km^-1\n"
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 14.3, page 919"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\nVsc=6.14*10**-9                              #voltage\nVop=153.38*10**-6                            #voltage without scattering\nl=2.92                                       #length of fibre in cm\n\n\n#Calculation\na=4.343*10**5*Vsc/(l*Vop)                    #scattering loss\n\n#Result\nprint'Scattering loss in dB = %.1f dB Km^-1'%a",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Scattering loss in dB = 6.0 dB Km^-1\n"
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 14.4, page 922"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\nt1=12.6*10**-9                               #time in sec\nt2=0.3*10**-9                                #time in sec\n\n\n\n#Calculation\nt=math.sqrt(t1**2-t2**2)/1.2               #pulse broadening \nBop=0.44/t                                 #bandwidth length product\n\n#Result\nprint'(a) 3dB pulse broadening = %.1f ns km^-1'%(t*10**9)\nprint'(b) Fiber bandwidth\u2013length product = %.1f MHz km'%(Bop*10**-6)",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "(a) 3dB pulse broadening = 10.5 ns km^-1\n(b) Fiber bandwidth\u2013length product = 41.9 MHz km\n"
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 14.5, page 940"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\nA=6.2                                     #output pattern size\nD=10                                    #screen position\n\n#Calculation\nNA=A/math.sqrt(A**2+(4*D**2))            #numerical aperture\n\n#Result\nprint'Numerical aperture = %.2f'%NA",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Numerical aperture = 0.30\n"
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 14.6, page 942"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#Variable declaration\nphi=4                                       #angular velocity\nl=0.1                                       #length in meter\nwe=300*10**-6                               #shadow pulse width\n\n#Calculation\ns=l*phi                                   #shadow velocity\nd=we*s                                    #fibre diameter\n\n#Result\nprint'Outer fibre diameter = %.1f um'%(d*10**6)",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Outer fibre diameter = 120.0 um\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 14.7, page 950"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\na=5*10**-3                                     #optical signal power\nb=20*10**-6                                    #optical signal power\nc=0.3*10**-3                                   #optical signal power\nd=800*10**-9                                   #optical signal power\n\n#Calculation\nadb=10*math.log10(a*10**3)                         #in dBm\nbdb=10*math.log10(b*10**3)                         #in dBm\ncdb=10*math.log10(c*10**6)                         #in dBu\nddb=10*math.log10(d*10**6)                         #in dBu\n\n#Result\nprint'(a) For a 1 mW reference power level'\nprint' optical signal power of 5 mW = %.2f dBm'%adb\nprint' optical signal power of 20 uW = %.2f dBm'%bdb\nprint'\\n(b) For a 1 \u03bcW reference power level'\nprint' optical signal power of 0.3 mW = %.2f dBu'%cdb      #value given in a textbook is incorrect\nprint' optical signal power of 800 nW = %.2f dBu'%ddb",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "(a) For a 1 mW reference power level\n optical signal power of 5 mW = 6.99 dBm\n optical signal power of 20 uW = -16.99 dBm\n\n(b) For a 1 \u03bcW reference power level\n optical signal power of 0.3 mW = 24.77 dBu\n optical signal power of 800 nW = -0.97 dBu\n"
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 14.8, page 953"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\nNA=0.02                               #numerical aperture\nyr=0.7*10**-3                        #Rayleigh scattering coefficient\nc=2.998*10**8                        #speed of light\nwo=50*10**-9                         #pulse time\nn1=1.5\n\n#Calculation\np=0.5*(((NA**2)*yr*wo*c)/(4*(n1**3)))       #power ratio\npdb=10*math.log10(p*10**3)                  #in dB\n\n#Result\nprint'Power ratio  = %.3f X 10^-7'%(p*10**7)     #value given in a textbook is incorrect\nprint'Power ratio in dB = %.1f dB'%pdb            #value given in a textbook is incorrect",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Power ratio  = 1.555 X 10^-7\nPower ratio in dB = -38.1 dB\n"
      }
     ],
     "prompt_number": 19
    }
   ],
   "metadata": {}
  }
 ]
}