diff options
14 files changed, 4921 insertions, 0 deletions
diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter10_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter10_1.ipynb new file mode 100644 index 00000000..b87494de --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter10_1.ipynb @@ -0,0 +1,521 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10:Nonlinear Effects in Fibers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.1:pg-429" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Nonlinear coefficient = 1.267 W**-1m**-1 \n" + ] + } + ], + "source": [ + "# Example 10.1\n", + "# Calculation of the non linear coeffifient.\n", + "# Page no 429\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "n2=2.5*10**-20; # Kerr coefficient\n", + "lambdaa=1550*10**-9; # Wavelength\n", + "A=80*10**-12; # Effective area\n", + "\n", + "\n", + "\n", + "# Non linear coeffifient\n", + "g=(n2*2*math.pi)/(lambdaa*A); \n", + "g=g*10**3;\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n Nonlinear coefficient = \",round(g,3),\" W**-1m**-1 \"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.2:pg-431" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The lower limit on the effective area of the fiber = 43.62 micrometer**2\n", + "\n", + " The effective area should be greater than 43.62 μm2 to have the peak nonlinear phase shift less than or equal to 0.5 rad.\n" + ] + } + ], + "source": [ + "# Example 10.2\n", + "# Calculation of the lower limit on the effective area of the fiber.\n", + "# Page no 431\n", + "\n", + "\n", + "\n", + "import math\n", + "#Given data\n", + "\n", + "c=3*10**8; # Velocity of light\n", + "tl=1000*10**3; # Total length\n", + "asp=100*10**3; # Amplifier spacing\n", + "alpha=0.046*10**-3; # Loss coefficient\n", + "L=100*10**3;\n", + "n2=2.5*10**-20; # Kerr coefficient\n", + "p=0; # Peak power at the fiber input\n", + "lambdaa=1550*10**-9; # Operating frequency\n", + "\n", + "# The peak power required to form a soliton\n", + "Le=(1-math.exp(-alpha*L))/alpha;\n", + "n=tl/asp;\n", + "p=10**(p/10);\n", + "r=0.5/(Le*p);\n", + "A=(2*math.pi*n2)/(lambdaa*r);\n", + "A=A*10**12;\n", + "\n", + "# Displaying results in the command window \n", + "print \"\\n The lower limit on the effective area of the fiber = \",round(A*10**-2,2),\" micrometer**2\"\n", + "print \"\\n The effective area should be greater than 43.62 μm2 to have the peak nonlinear phase shift less than or equal to 0.5 rad.\"\n", + "\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.3:pg-435" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The peak power required to form a soliton = 2.4 mW\n" + ] + } + ], + "source": [ + "# Example 10.3\n", + "# Calculation of the peak power required to form a soliton\n", + "# Page no 435\n", + "\n", + "import math\n", + "from sympy.mpmath import asech\n", + "\n", + "#Given data\n", + "\n", + "b=-21*10**-27; # FWHM of a fundamental soliton\n", + "Tf=50*10**-12; # Fiber dispersion coefficient\n", + "r=1.1*10**-3; # Nonlinear coefficient\n", + "\n", + "# The peak power required to form a soliton\n", + "Th=asech(math.sqrt(0.5));\n", + "f=2*Th;\n", + "T0=Tf/f;\n", + "n=(math.sqrt(-b))/T0;\n", + "P=(n**2)/r;\n", + "#P=P*10**2;\n", + "\n", + "\n", + "# Displaying results in the command window \n", + "print \"\\n The peak power required to form a soliton = \",round(P*10**2,1),\" mW\"\n", + "\n", + "# Answer is wrong in book\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.4:pg-444" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " XPM efficiency = 3.567 *10**-3\n" + ] + } + ], + "source": [ + "# Example 10.4\n", + "# Calculation of the peak power required to form a soliton\n", + "# Page no 444\n", + "\n", + "\n", + "import math\n", + "# Given data\n", + "\n", + "c=3*10**8; # Velocity of light\n", + "S=0.06*10**3; # Dispersion slope\n", + "D=17*10**-6; # Dispersion coefficient\n", + "lambdaa=1550*10**-9; # Signal Wavelength\n", + "lc=1550*10**-9; # Signal Wavelength\n", + "lp=1549.6*10**-9; # Pump wavelength\n", + "l=50*10**3; # Length\n", + "r=2*math.pi*10**10;\n", + "alpha=0.046*10**-3; # Loss coefficient\n", + "\n", + "# The peak power required to form a soliton\n", + "b3=S*(lambdaa**2/(2*math.pi*c))+D*(lambdaa**3/(2*math.pi**2*c**2));\n", + "b2=-(D*lambdaa**2)/(2*math.pi*c);\n", + "o=2*math.pi*(c/lp-c/lc);\n", + "d=(b2*o)+(b3*o**2)/2;\n", + "n=alpha**2/alpha**2*r*4*d**2*(1+(4*(math.sin(r*d*l))**2*math.e**(-alpha*l))/(1-math.e**(-alpha*l)**2));\n", + "n=n*10**-18;\n", + "# Displaying results in the command window \n", + "print \"\\n XPM efficiency = \",round(n,3),\" *10**-3\"\n", + "\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.5:pg-453" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The efficiency of the non-degenerate FWM tone at −2Δf (beta2 = −4ps**2/km) = 3.4 X 10**(-3) \n", + "\n", + "\n", + " The efficiency of the non-degenerate FWM tone at −2Δf (beta2 = 0ps**2/km) = 1.0\n" + ] + } + ], + "source": [ + "# Example 10.5\n", + "# Calculate the efficiency of the non-degenerate FWM tone at −2Δf if (a) beta2 = −4ps**2/km, (b) beta2 = 0ps**2/km.\n", + "# Page no 453\n", + "\n", + "\n", + "import math\n", + "\n", + "\n", + "#Given data\n", + "f=50*10**9; # The bandwidth\n", + "alpha= 0.046*10**-3; # The fiber loss coefficient\n", + "L=40*10**3; # The fiber length\n", + "\n", + "Leff=(1-math.exp(-(alpha*L)))/alpha; # Effective fiber length\n", + "\n", + "# (a) Calculate the efficiency of the non-degenerate FWM tone at −2Δf beta2 = −4ps**2/km\n", + "bet21=-4*10**(-12);\n", + "j=-1;\n", + "k=0;\n", + "l=1;\n", + "n=j+k-l;\n", + "\n", + "bet1=bet21*10**(-12)/10**(3)*(2*math.pi*f)**2*n;\n", + "\n", + "#The efficiency of the non-degenerate FWM tone\n", + "neta1=(alpha**2+4*math.exp(-alpha*L*10**3)*(math.sin(radians(bet1*(L*10**3)/2))/Leff**2))/(alpha**2+bet1**2)\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The efficiency of the non-degenerate FWM tone at −2Δf (beta2 = −4ps**2/km) = \",round(neta1*10**3,1),\" X 10**(-3) \"\n", + "\n", + "# (b) Calculate the efficiency of the non-degenerate FWM tone at −2Δf beta2 = 0ps**2/km\n", + "bet22=0*10**(-12);\n", + "j=-1;\n", + "k=0;\n", + "l=1;\n", + "n=j+k-l;\n", + "\n", + "bet2=bet22*10**(-12)/10**(3)*(2*math.pi*f)**2*n;\n", + "\n", + "#The efficiency of the non-degenerate FWM tone\n", + "neta2=(alpha**2+4*math.exp(-alpha*L*10**3)*(sin(radians(bet2*(L*10**3)/2))/Leff**2))/(alpha**2+bet2**2);\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n\\n The efficiency of the non-degenerate FWM tone at −2Δf (beta2 = 0ps**2/km) = \",round(neta2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.6:pg-469" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The nonlinear phase shift at the center of the pulse = 0.1206 rad \n", + "\n", + "\n", + " Amplitude shift using first order = 1.007\n", + "\n", + " Non-linear shift using first order = 0.12002 rad\n", + "\n", + "\n", + " Amplitude shift using second order = 1.00003\n", + "\n", + " Non-linear shift using second order = 0.1209 rad\n" + ] + } + ], + "source": [ + "# Example 10.6\n", + "# to find the nonlinear phase shift at the center of the pulse. Compare the exact results with those obtained using first and second-order perturbation theory\n", + "# Page no 469\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "P=6*10**(-3); # The peak power of rectangular pulse\n", + "L=40*10**3; # Fiber of length\n", + "Floss=0.2; # The fiber loss (dB/Km)\n", + "gamm=1.1*10**(-3);\n", + "\n", + "alpha=Floss/4.343; # Attenuation coefficient\n", + "Zeff=(1-math.exp(-alpha*10**(-3)*L))/alpha*10**3;\n", + "\n", + "# The nonlinear phase shift at the center of the pulse\n", + "phi=gamm*P*Zeff; # Nonlinear phase shift\n", + "\n", + "#Displaying results in the command window\n", + "print \"\\n The nonlinear phase shift at the center of the pulse = \",round(phi,4),\" rad \"\n", + "\n", + "\n", + "# Results using first order\n", + "B01=math.sqrt(1+gamm**2*P**2*(Zeff)**2); # Amplitude shift \n", + "thet1=math.atan(gamm*P*Zeff); # Non-linear phase shift \n", + "\n", + "#Displaying results in the command window\n", + "print \"\\n\\n Amplitude shift using first order = \",round(B01,3)\n", + "print \"\\n Non-linear shift using first order = \",round(thet1,5),\" rad\"\n", + "\n", + "# Results using second order\n", + "x=1-((gamm)**2/2*P**2*Zeff**2);\n", + "y=gamm*P*Zeff;\n", + "thet2=math.atan(y/x); # Nonlinear phase shift\n", + "B02=x/math.cos(thet2); # Amplitude shift\n", + "\n", + "#Displaying results in the command window\n", + "print \"\\n\\n Amplitude shift using second order = \",round(B02,5) # Answer is varying due to round-off error\n", + "print \"\\n Non-linear shift using second order = \",round(thet2,5),\" rad\" # Answer is varying due to round-off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.7:pg-477" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The linear phase noise at the receiver = 1.5 rad**2 \n", + "\n", + " The nonlinear phase noise at the receiver = 1.6 rad**2 \n", + "\n", + " The total variance = 3.1 X 10**-3 rad**2 \n" + ] + } + ], + "source": [ + "# Example 10.7\n", + "# Calculation of the variance of (a) linear phase noise, (b) nonlinear phase noise at the receiver\n", + "# Page no 477\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "alpha=0.0461; # Loss coeffient\n", + "na=20; # No of amplifiers\n", + "L=80; # Amplifier spacing\n", + "tb=25*10**-12; # Pulse width\n", + "P=2*10**-3; # Peak power\n", + "c=3*10**8; # Velocity of light\n", + "lambdaa=1550*10**-9;\n", + "n=1.5; # Spontaneous emission factor\n", + "h=6.626*10**-34; # Planck constant\n", + "r0=1.1*10**-3; # Nonlinear coefficient\n", + "\n", + "# a) linear phase noise at the receiver\n", + "G=math.exp(alpha*L);\n", + "f=c/lambdaa;\n", + "R=h*f*(G-1)*n;\n", + "E=P*tb;\n", + "rl=(na*R)/(2*E);\n", + "rl=rl*10**3;\n", + "\n", + "# (b) nonlinear phase noise at the receiver\n", + "Le=(1-math.exp(-alpha*L))/alpha;\n", + "rnl=((na-1)*na*(2*na-1)*R*E*r0**2*Le**2)/(3*tb**2);\n", + "rnl=rnl*10**9;\n", + "\n", + "t=rl+rnl;\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The linear phase noise at the receiver = \",round(rl,2),\" rad**2 \"\n", + "print \"\\n The nonlinear phase noise at the receiver = \",round(rnl,2),\" rad**2 \"\n", + "print \"\\n The total variance = \",round(t,2),\" X 10**-3 rad**2 \"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.8:pg-480" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The Stokes signal power at the fiber output = 0.1447807958 mW \n" + ] + } + ], + "source": [ + "# Example 10.8\n", + "# Calculation of the Stokes signal power at the fiber output\n", + "# Page no 480\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "p1=20; # Input power pump\n", + "ps=-10; # Input Stokes’s signal power\n", + "alpha=0.08;\n", + "L=2; # Length of fiber\n", + "alpha1=0.046;\n", + "A=40*10**-12; # Effective area of fiber\n", + "g=1*10**-13; # Raman coefficient of the fiber\n", + "\n", + "# The Stokes signal power at the fiber output\n", + "p1=10**(p1/10);\n", + "ps=10**(ps/10);\n", + "Le=(1-math.exp(-alpha*L))/alpha;\n", + "s=(g*p1*Le)/A;\n", + "d=alpha1*L;\n", + "pd=ps*math.e**(-d+s);\n", + "\n", + "\n", + "\n", + "# Displaying results in the command window \n", + "print \"\\n The Stokes signal power at the fiber output = \",round(pd,15),\" mW \"\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter11_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter11_1.ipynb new file mode 100644 index 00000000..270dfbcb --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter11_1.ipynb @@ -0,0 +1,78 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11:Digital Signal Processing" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex11.1:pg-509" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The number of the taps = 47.0\n" + ] + } + ], + "source": [ + "# Example 11.1\n", + "# Calculation of the minimum number of taps needed to compensate for the fiber dispersion\n", + "# Page no 509\n", + "\n", + "import math\n", + "\n", + "# Given data\n", + "b=22*10**-27; # Power launched in port 1\n", + "l=800*10**3; # Power launched in port 2\n", + "T=50*10**-12; # Power launched in port 3 \n", + "\n", + "\n", + "# Bit rate of communication system\n", + "k=math.ceil((math.pi*b*l)/T**2);\n", + "n=(2*k)+1;\n", + "\n", + "\n", + "# Displaying results in the command window \n", + "print \"\\n The number of the taps = \",round(n,3)\n", + "# The answers vary due to round off error\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter1_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter1_1.ipynb new file mode 100644 index 00000000..0bb86cc8 --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter1_1.ipynb @@ -0,0 +1,216 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 01:Electromagnetics and Optics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.6:pg-25" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Refractive index of the glass = 1.5\n" + ] + } + ], + "source": [ + "\n", + "#To find refractive index of of the glass\n", + "import math\n", + "\n", + "# Given data\n", + "phi=0.7297; # Critical angle for glass-air interface\n", + "n2=1; # Refractive index of air\n", + "n1=n2/math.sin(phi); # Refractive index of glass\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Refractive index of the glass = \",round(n1,1)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.7:pg-25" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " \n", + "Speed of light in medium = 2.069 X 10^8 m/s',\n", + " \n", + "Wavelenght of laser in medium = 1.0889 micrometer\n", + "\n", + "Wavenumber in medium = 5.77 X 10^6 m^-1\n" + ] + } + ], + "source": [ + "\n", + "#To calculate a)the speed of light b) The wavelenght in medium c) The wavenumber in medium\n", + "import math\n", + "\n", + "\n", + "#a)The speed of light\n", + "c=3*10**8; #Speed of light in free space (m/s)\n", + "n=1.45; #Given refractive index of dielectric medium\n", + "v=(c/n); #Speed of light in medium (in m/s)\n", + "\n", + "#Displaying the result in command window\n", + "print\" \\nSpeed of light in medium =\",round(v*10**-8,3),\" X 10^8 m/s',\"\n", + "\n", + "#b) The wavelenght in medium \n", + "f=190*10**12; #Given operating frequency of laser\n", + "lambdam=(v/f); #Wavelenght in medium \n", + "\n", + "#Displaying the result in command window\n", + "print\" \\nWavelenght of laser in medium =\",round(lambdam*10**(6),4),\" micrometer\"\n", + "\n", + "#c) The wavenumber in medium\n", + "k=(2*math.pi)/lambdam; #Wavenumber in medium\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\nWavenumber in medium =\",round(k*10**-6,2),\" X 10^6 m^-1\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.8:pg-26" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Magnitude of the wave vector of the refracted wave is same as wave number = 5.77 X 10^6 m^-1\n", + "\n", + " z-component of the wave vector = 4.63 X 10^6 m**-1\n", + "\n", + " x-component of the wave vector = 3.45 X 10^6 m**-1\n" + ] + } + ], + "source": [ + "\n", + "# To calculate a)magnitude of the wave vector of the refracted wave b)x-component and z-component of the wave vector\n", + "\n", + "import math\n", + "#Given data\n", + "n1=1; # Refractive index of air\n", + "n2=1.45; # Refractive index of slap\n", + "theta1=math.pi/3; # Angle of incidence\n", + "lambdam=1.0889*10**(-6); # Wavelength in medium\n", + "theta2=math.asin(math.sin(theta1)/n2); # Angle of refraction\n", + "\n", + "# a)To calculate magnitude of the wave vector of the refracted wave\n", + "k=((2*math.pi)/lambdam); # Wavenumber\n", + "\n", + "# Displaying the result in command window\n", + "print\" Magnitude of the wave vector of the refracted wave is same as wave number =\",round(k*10**(-6),2),\" X 10^6 m^-1\"\n", + "\n", + "# b)To calculate x-component and z-component of the wave vector\n", + "kx=k*math.sin(theta2); # x-component of the wave vector\n", + "kz=k*math.cos(theta2); # z-component of the wave vector\n", + "\n", + "# Displaying the result in command window\n", + "print\"\\n z-component of the wave vector =\",round(kz*10**(-6),2),\" X 10^6 m**-1\"\n", + "print\"\\n x-component of the wave vector = \",round(kx*10**(-6),2),\" X 10^6 m**-1\"\n", + "# The answer is varrying due to round-off error \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.9:pg-30" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Length of the medium = 500.0 m\n" + ] + } + ], + "source": [ + "#To find length of the medium\n", + "import math\n", + "\n", + "\n", + "bandwidth=100*10**9; #Bandwidth of optical signal\n", + "w=2*math.pi*bandwidth; #Bandwidth of optical signal in rad/s\n", + "T=3.14*10**(-12); #Delay between minimum and maximum frequency component\n", + "beta2=10*(10**(-12))**2/10.0**3; #Group velocity dispersion parameter in s^2/km\n", + "L=T/(beta2*w); #Length of the medium\n", + "\n", + "# Displaying the result in command window\n", + "print\" Length of the medium =\",round(L),\" m\"\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter2_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter2_1.ipynb new file mode 100644 index 00000000..deec22bd --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter2_1.ipynb @@ -0,0 +1,722 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 02:Optical Fiber Transmission" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.1:pg-38" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The numerical aperture = 0.2417\n", + "\n", + " The acceptance angle = 0.2441 Radian\n", + "\n", + " The relative index difference = 0.0136\n" + ] + } + ], + "source": [ + "# Example no. 2.1\n", + "# To find a)The numerical aperture b)The acceptanca angle c)The relative index defference\n", + "# Page no. 38\n", + "\n", + "\n", + "import math\n", + "\n", + "# Given data\n", + "n1=1.47; # Refractive index of core\n", + "n2=1.45; # Refractive index of cladding\n", + "\n", + "# a)The numerical aperture\n", + "NA=(n1**2-n2**2)**(1/2.0); # Numerical aperture\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The numerical aperture = \",round(NA,4)\n", + "\n", + "# b)The acceptanca angle\n", + "imax=math.asin(NA); # The acceptanca angle\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The acceptance angle = \",round(imax,4),\" Radian\"\n", + "\n", + "# c)The relative index defference\n", + "delta=(n1-n2)/n1; # Relative index defference\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The relative index difference = \",round(delta,4)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.2:pg-41" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Refractive index of cladding = 1.4454\n", + "\n", + " Delay = 49 ns\n", + "\n", + " Approximate delay = 50 ns\n", + "\n", + " Maximum bit-rate distance product = 20.3 Mb/(s.km)\n" + ] + } + ], + "source": [ + "# Example no. 2.2\n", + "# To find maximum bit-rate distance product\n", + "# Page no. 41\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "n1=1.46; # Refractive index of core\n", + "delta=0.01; # Relative difference of refractive index\n", + "L=1*10**3; # Fiber length\n", + "c=3*10**(8); # Speed of ligth in km/sec\n", + "\n", + "n2=n1*(1-delta); # Refractive index of cladding\n", + "deltaT=(n1**2*L*delta)/(c*n2); # Delay in sec\n", + "BL=(((c*n2)/(n1**2*delta))/10**3)*10**-6; # maximum bit-rate distance product in Mb/s.km\n", + "deltaT=((n1**2*L*delta)/(c*n2))*10**9; # Delay in ns\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Refractive index of cladding = \",round(n2,4)\n", + "print \"\\n Delay =\",int(deltaT),\"ns\"\n", + "print \"\\n Approximate delay = \",int(deltaT+1),\"ns\"\n", + "print \"\\n Maximum bit-rate distance product = \",round(BL,1),\" Mb/(s.km)\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.3:pg-43" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Pulse width for step index fiber = 67.59 ns\n", + "Pulse width for parabolic index fiber = 0.1667 ns\n", + "Thus, the intermodal dispersion can be significantly reduced by using parabolic-index fiber\n" + ] + } + ], + "source": [ + "# Example no.2.3\n", + "# To compare deltaT for step index fiber with parabolic-index fiber\n", + "# Page no. 43\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "n1=1.47; # Refractive index of core\n", + "n2=1.45; # Refractive index of cladding\n", + "L=1*10.0**3; # Length of medium in meter\n", + "c=3*10**8; # speedof ligth in (m/s)\n", + "delta=(n1-n2)/n1;\n", + "\n", + "# The deltaT for step index fiber\n", + "deltaTSIF=((n1**2*L*delta)/(c*n2))*10**9; #Pulse width for step index fiber\n", + "\n", + "# deltaT for parabolic-index fiber\n", + "deltaTPIF=((n1**2*delta**2*L)/(8*c))*10**9; # Pulse width for parabolic-index fiber\n", + "\n", + "# Displaying the result in command window\n", + "print \"Pulse width for step index fiber = \",round(deltaTSIF,2),\" ns\"\n", + "print \"Pulse width for parabolic index fiber = \",round(deltaTPIF,4),\" ns\"\n", + "\n", + "# The answer of pulse width for parabolic index fiber is wrong in book\n", + "\n", + "print \"Thus, the intermodal dispersion can be significantly reduced by using parabolic-index fiber\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.4:pg-61" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Transmitted power = 10.79 dBm\n", + "\n", + " Received power = 0.3162 mW\n" + ] + } + ], + "source": [ + "# Example 2.4\n", + "# a)To convert transmitted power into dBm b)To convert received power into mW\n", + "# Page no. 61\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "Ptr=0.012; # Transmitted power in watt \n", + "PrdBm=-5; # Received power in dBm\n", + "\n", + "# a)To convert transmitted power into dBm\n", + "PtrdBm=10*math.log10(Ptr/(10.0**-3)); # Transmitted power in dBm\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Transmitted power = \",round(PtrdBm,2),\" dBm\"\n", + "\n", + "# b)To convert received power into mW\n", + "PrmW=10**(-5/10.0); # Received power in mW\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Received power = \",round(PrmW,4),\" mW\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.7:pg-69" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The core radius of step-index fiber = 2.907 micrometer\n", + "\n", + " Operating wavelength = 1.55 micrometer\n", + "\n", + " Cutoff wavelength = 1.1 micrometer\n", + "Since operating wavelength is greater than cutoff wavelength, it is single moded at this wavelength.\n" + ] + } + ], + "source": [ + "# Example no.2.7\n", + "# To find the core radius of step-index fiber\n", + "# Page no.69\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "n1=1.45; # Refractive index of core\n", + "delta=0.005;\n", + "n2=n1*(1-delta); # Refractive index of cladding\n", + "lambdac=1.1; # Cutoff wavelength in meter\n", + "lambdaa=1.55; # Operating wavelength in micrometer\n", + "a=((2.4048*lambdac*10**-6)/(2*math.pi*(n1**2-n2**2)**(1/2.0)))/10**-6; # Core radius\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\n The core radius of step-index fiber = \",round(a,3),\" micrometer\"\n", + "print \"\\n Operating wavelength = \",round(lambdaa,2),\" micrometer\"\n", + "print \"\\n Cutoff wavelength = \",round(lambdac,1),\" micrometer\"\n", + "\n", + "print \"Since operating wavelength is greater than cutoff wavelength, it is single moded at this wavelength.\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.8:pg-72" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Total loss in fiber = 16 dB\n", + "\n", + " Output power of fiber = -13 dBm\n", + "\n", + " Output power of fiber = 0.05 mW\n" + ] + } + ], + "source": [ + "# Example no 2.8\n", + "# To find the total loss and output power in mW and dBm in fiber\n", + "# Page no. 72\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "losscoe=0.046; # Loss coefficient in km**-1\n", + "L=80; # Length of fiber in km\n", + "PindBm=3; # Input power in dBm\n", + "\n", + "# To find total loss of fiber\n", + "loss=round(4.343*losscoe*L); # Total loss in fiber\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Total loss in fiber = \",int(loss),\" dB\"\n", + "\n", + "# To find output power \n", + "PoutdBm=PindBm-loss; # Output power in dBm\n", + "\n", + "PoutmW=10**(PoutdBm/10); # Output power in mW\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\n Output power of fiber =\",int(PoutdBm),\"dBm\"\n", + "print \"\\n Output power of fiber = \",round(PoutmW,2),\" mW\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.10:pg-77" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "We choose center of band (lambda_0) for large maximum allowable dispersion slope.\n", + "\n", + " Dispersion slope = 0.917 ps/nm**2/km\n" + ] + } + ], + "source": [ + "# Example no. 2.10\n", + "# To design single mode fiber such that absolute accumulated dispersion should not exceed 1100ps/nm\n", + "# Page no. 77\n", + "\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "lambda1=1530; # Left edge of wavelength range in nm\n", + "lambda2=1560; # Rigth edge of wavelength range in nm\n", + "lambda0=1545; # Center of the band in nm\n", + "L=80; # Fiber length in km\n", + "\n", + "print \"We choose center of band (lambda_0) for large maximum allowable dispersion slope.\"\n", + "\n", + "Dlambda2=1100.0/L; # Dispersion at rigth edge of band in ps/nm/km\n", + "S=Dlambda2/(lambda2-lambda0); # Dispersion slope in ps/nm**2/km\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Dispersion slope = \",round(S,3),\" ps/nm**2/km\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.11:pg-80" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Length of DCF = 12.9 km\n", + "\n", + " Output power of DCF = -19.95 dBm\n", + "\n", + " Gain of amplifier = 22.96 dBm\n" + ] + } + ], + "source": [ + "# Example no.2.11\n", + "# To find a)length of DCF b)power at the output of DCF c)gain of amplifier\n", + "# Page no.80\n", + "\n", + "\n", + "\n", + "import math\n", + "# Given data\n", + "LTF=80; # Length of transmission fiber\n", + "beta2TF=-21.0; # Dispersion of transmission fiber in ps**2/km\n", + "beta2DCF=130.0; # Dispersion of DCF in ps**2/km\n", + "Pin=2*10**(-3); # Input power of transmission fiber in W\n", + "DCFloss=0.5; # Losses of DCF in dB/km\n", + "TFloss=0.2; # Losses of TF in dB/km\n", + "spliceloss=0.5; # Splice loss in dB\n", + "\n", + "# a)To find length of DCF\n", + "LDCF=(-beta2TF*LTF)/beta2DCF; # Length of DCF in km\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Length of DCF = \",round(LDCF,1),\" km\"\n", + "\n", + "# b)To find power at the output of DCF\n", + "PindBm=10*math.log10(Pin/10**(-3)); # Input power of transmission fiber in dBm\n", + "Totalloss=TFloss*LTF+DCFloss*LDCF+spliceloss; # Total loss in fiber in dB\n", + "PoutdBm=PindBm-Totalloss; # Output power of DCF in dBm\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Output power of DCF = \",round(PoutdBm,2),\" dBm\"\n", + "\n", + "# c)To find gain of amplifier\n", + "gain=Totalloss; # gain of amplifier\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Gain of amplifier = \",round(gain,2),\" dBm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.12:pg-81" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The delay between the shortest and longest path = 91.95 ns\n" + ] + } + ], + "source": [ + "# Example no. 2.12\n", + "# To find the delay between the shortest and longest path.\n", + "# Page no. 81\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "NA=0.2; # Numerical aperture\n", + "L=2*10**3; # Fiber length in meters\n", + "n1=1.45; # Core refractive index\n", + "delta=(NA)**2/(2*n1**2); # Relative index difference\n", + "n2=n1; # since difference between core index and cladding index is smaller\n", + "c=3*10**8; # Speed of ligth in m/s\n", + "\n", + "# The delay between the shortest and longest path.\n", + "deltaT=((n1**2*L*delta)/(c*n2)); # the delay between the shortest and longest path.\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The delay between the shortest and longest path = \",round(deltaT*10**9,2),\" ns\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.13:pg-82" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The propagation constant at 1551nm wavelength = 5.9961 X 10**6 rad/s\n" + ] + } + ], + "source": [ + "# Example no. 2.13\n", + "# To calculate the propagation constant\n", + "# Page no. 82\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "lambda0=1550*10**-9; # wavelength in meter\n", + "beta0=6*10**6; # propagation constant in rad/m\n", + "lambda1=1551*10**-9; # wavelength in meter\n", + "beta1=0.5*10**-8; # inverse group velocity in sec/meter\n", + "beta2=-10*10**-24; # second-order dispersion coefficient in sec**2/km\n", + "c=3*10**8; # Speed of ligth in m/s\n", + "omega0=(2*math.pi*c)/lambda0; # Radial frequency at lambda0\n", + "omega1=(2*math.pi*c)/lambda1; # Radial frequency at lambda1\n", + "omega=omega1-omega0;\n", + "\n", + "# The propagation constant at 1551nm wavelength\n", + "betaomega1=(beta0+beta1*omega+beta2*omega**2/2.0); # Propagation constant at 1551nm wavelength\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The propagation constant at 1551nm wavelength = \",round(betaomega1*10**-6,4),\" X 10**6 rad/s\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.14:pg-83" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The lower limit on the transmitter power in dBm = -1.5\n", + "\n", + " The lower limit on the transmitter power in mW = 0.7079\n" + ] + } + ], + "source": [ + "# Example No. 2.14\n", + "# To calculate the lower limit on the transmitter power in dBm and mW units.\n", + "# Page No. 83\n", + "\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "l=80; # Length of fiber in km\n", + "F1=-0.2*l; # Fiber loss in dB\n", + "F2=-0.5; # Filter loss in dB\n", + "G=15; # Amplifier gain in dB\n", + "Pout=-3; # Minimum power required at the receiver in dBm\n", + "\n", + "# Lower limit on the transmitter power\n", + "Pin=Pout-F1-F2-G; # Lower limit on the transmitter power in dBm\n", + "PinmW=10**(0.1*Pin); # Lower limit on the transmitter power in mW\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The lower limit on the transmitter power in dBm = \",round(Pin,1)\n", + "print \"\\n The lower limit on the transmitter power in mW = \",round(PinmW,4)\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.16:pg-84" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The length of DCF so that the pulse width (FWHM) at the output of the DCF is twice the pulse width at the input of the TF \n", + " = 13.67 km\n", + " or = 12.17 km\n" + ] + } + ], + "source": [ + "# Example No. 2.16\n", + "# To find the length of DCF so that the pulse width (FWHM) at the output of the DCF is twice the pulse width at the input of the TF\n", + "# Page No. 84\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "beta2TF=-21*(10**(-12))**2; # Dispersion coefficient of transmission fiber in s**2/km\n", + "beta2DCF=130*(10**(-12))**2; # Dispersion coefficient of dispersion compensating fiber in s**2/km\n", + "LTF=80; # Length of transmission fiber in km\n", + "TFWHM=12.5*10**(-12); # Full-width at half-maximum\n", + "T0=TFWHM/1.665; # Half-width\n", + "\n", + "# The length of required DCF\n", + "LDCF1=(math.sqrt(3)*T0**2-beta2TF*LTF)/beta2DCF; # Length of dispersion compensating fiber in km\n", + "LDCF2=(-math.sqrt(3)*T0**2-beta2TF*LTF)/beta2DCF; # Length of dispersion compensating fiber in km\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The length of DCF so that the pulse width (FWHM) at the output of the DCF is twice the pulse width at the input of the TF \\n = \",round(LDCF1,2),\"km\"\n", + "\n", + "print \" or = \",round(LDCF2,2),\" km\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.17:pg-85" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The accumulated dispersion of the DCF should be less than -3380 ps/nm\n" + ] + } + ], + "source": [ + "# Example No. 2.17\n", + "# To find the accumulated dispersion of the DCF so that the net accumulated dispersion does not exceed 1100 ps/nm\n", + "# Page no. 85\n", + "\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "lambda0=1490; # Zero dispersion wavelength in nm\n", + "lambdaa=1560; # Upper limit of wavelength range in nm\n", + "Sc=0.08; # Dispersion slope of transmission fiber ps/nm2/km\n", + "LTF=800; # Length of transmission fiber in km\n", + "DTF=Sc*(lambdaa-lambda0); # Dispersion at 1560 nm in ps/nm/km\n", + "\n", + "# The accumulated dispersion of the DCF\n", + "DLDCF=1100-DTF*LTF; # The accumulated dispersion of the DCF in ps/nm\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The accumulated dispersion of the DCF should be less than \",int(DLDCF),\" ps/nm\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter3_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter3_1.ipynb new file mode 100644 index 00000000..9fe1cce3 --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter3_1.ipynb @@ -0,0 +1,654 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 03:Lasers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.1:pg-99" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Einstein coefficient A = 5.0 X 10**8 s**(-1)\n", + "\n", + " Einstein coefficient B = 7.75 X 10**21 m**3/J.s**2\n" + ] + } + ], + "source": [ + "# Example No. 3.1\n", + "# To calculate the Einstein A and B coefficients\n", + "# Page no.99\n", + "\n", + "\n", + "import math\n", + "\n", + "# Given data\n", + "tsp=2*10**-9; # Spontaneous lifetime associated with 2 → 1 transition in seconds\n", + "\n", + "deltaE=2.4*10**(-19); # The energy difference between the levels\n", + "h=1.054*10**(-34); # The distance between two levels\n", + "omega=deltaE/h; # Frequency in rad/sec\n", + "v=1.25*10**8; # The velocity of light in the medium in m/s\n", + "\n", + "# The Einstein A and B coefficients\n", + "A=(1/tsp)*10**-8; # Einstein coefficient A\n", + "B=(((1/tsp)*math.pi**2*v**3)/(h*omega**3))*10**-21; # Einstein coefficient B\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Einstein coefficient A = \",round(A),\" X 10**8 s**(-1)\"\n", + "print \"\\n Einstein coefficient B = \",round(B,2),\" X 10**21 m**3/J.s**2\"\n", + "\n", + "# The answers are varrying due to round off error \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.2:pg-100" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The wavelength of ligth emitted = 1.58 micrometer\n", + "\n", + " The ratio of spontaneous emission rate to stimulated emission rate = 1.65 X 10**13\n", + "\n", + " The ratio of stimulated emission rate to absorption rate = 6.06 X 10**-14\n", + "\n", + " The population density of the excited level = 6.06 X 10**5 cm**(-3)\n" + ] + } + ], + "source": [ + "# Example no. 3.2\n", + "# To calculate (a) the wavelength of light emitted, (b) the ratio of spontaneous emission rate to stimulated emission rate, (c) the ratio of stimulated emission rate to absorption rate, and (d) the population density of the excited level.\n", + "# Page no. 100\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "deltaE=1.26*10**-19; # The energy difference between two levels\n", + "h=1.054*10**(-34); # The distance between two levels\n", + "c=3*10**8; # The speed of ligth in m/s\n", + "kB=1.38*10**(-23); # The Boltzmann’s constant J/K\n", + "T=300; # The absolute temperature in Kelvin\n", + "N1=10**19; # The population density in the ground state in cm**(-3)\n", + "\n", + "# (a)The wavelength of light emitted\n", + "h=2*math.pi*h; # The distance between two levels in J.s\n", + "f=deltaE/h; # The frequency in Hz\n", + "lambdaa=(c/f)*10**6; # The wavelength of ligth emitted in micrometer\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The wavelength of ligth emitted = \",round(lambdaa,2),\" micrometer\"\n", + "\n", + "# The calculation of this answer is wrong in the book\n", + "\n", + "# (b)The ratio of spontaneous emission rate to stimulated emission rate\n", + "RspRst=(exp(deltaE/(kB*T))-1); # The ratio of spontaneous emission rate to stimulated emission rate\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The ratio of spontaneous emission rate to stimulated emission rate = \",round(RspRst*10**-13,2),\" X 10**13\"\n", + "\n", + "# The calculation of this answer is wrong in the book\n", + "\n", + "# (c)The ratio of stimulated emission rate to absorption rate\n", + "RstRab=(exp(-deltaE/(kB*T))); # The ratio of stimulated emission rate to absorption rate\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The ratio of stimulated emission rate to absorption rate = \",round(RstRab*10**14,2),\" X 10**-14\"\n", + "\n", + "# The calculation of this answer is wrong in the book\n", + "\n", + "# (d)The population density of the excited level\n", + "N2=(N1*exp(-deltaE/(kB*T))); # The population density of the excited level in cm**(-3)\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The population density of the excited level = \",round(N2*10**-5,2),\" X 10**5 cm**(-3)\"\n", + "\n", + "# The calculation of this answer is wrong in the book\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.3:pg-106" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The longitudinal mode spacing = 85.71 GHz\n", + "\n", + " The minimum gain required for laser oscillation per cm = 35.59 cm**-1\n" + ] + } + ], + "source": [ + "# Example No. 3.3\n", + "# To calculate the longitudinal mode spacing and the minimum gain required for laser oscillation\n", + "# Page no. 106\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "c=3*10**8; # The speed of ligth in air\n", + "L=500*10**(-6); # The distance between mirrors\n", + "n=3.5; # The refractive index\n", + "inlossdB=50; # The internal loss in dB/cm\n", + "R1=0.3; # The reflectivity of ligth wave which is reflected at A\n", + "R2=0.3; # The reflectivity of ligth wave which is reflected at B\n", + "\n", + "# The longitudinal mode spacing\n", + "deltaf=(c/(2*n*L))*10**-9; # The longitudinal mode spacing\n", + "L=0.05; # The distance between mirrors in cm\n", + "amir=(1/(2*L))*math.log(1/(R1*R2)); # The loss due to mirrors per cm\n", + "aint=math.log(10**(inlossdB/10)); # The coefficient of internal loss due to scattering\n", + "\n", + "# The minimum gain required\n", + "g=aint+amir; # The minimum gain required for laser oscillation\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The longitudinal mode spacing = \",round(deltaf,2),\" GHz\"\n", + "print \"\\n The minimum gain required for laser oscillation per cm = \",round(g,2),\" cm**-1\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.4:pg-107" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The energy density = 2.13 J/m**3\n" + ] + } + ], + "source": [ + "# Example no. 3.4\n", + "# To calculate the energy density.\n", + "# Page no. 107\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "P=20*10**(-3); # The mean power in W\n", + "A=100*10**(-12); # The area perpendicular to the direction of light propagation in m**2\n", + "n=3.2; # Refractive index of gain medium\n", + "c=3*10**8; # Speed of ligth in m/s\n", + "I=P/A; # The optical intensity in W/m**2\n", + "\n", + "# The energy density\n", + "u=(n*I)/c; # The energy density in J/m**3\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The energy density = \",round(u,2),\" J/m**3\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.5:pg-110" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The frequency of the electromagnetic wave emitted by stimulated emission = 24.0 GHz\n" + ] + } + ], + "source": [ + "# Example no.3.5\n", + "# To calculate the frequency of the electromagnetic wave emitted by stimulated emission.\n", + "# Page no.110\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "E=10**(-4); # The energy difference between two levels in eV\n", + "E=10**(-4)*1.602*10**(-19); # The energy difference between two levels in J\n", + "h=1.054*10**(-34); # The distance between two levels\n", + "\n", + "# The frequency of the electromagnetic wave emitted by stimulated emission.\n", + "f=(E/(2*math.pi*h))*10**-9; # The frequency of the electromagnetic wave emitted by stimulated emission in GHz\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The frequency of the electromagnetic wave emitted by stimulated emission = \",round(f),\" GHz\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.6:pg-123" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The band-gap energy = 1.93 X 10**-19 J\n" + ] + } + ], + "source": [ + "# Example 3.6\n", + "# To calculate the band-gap energy.\n", + "# Page no.123\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "m=9.109*10**(-31); # The electron rest mass in kg\n", + "meff1=0.07*m; # The effective mass of an electron in the conduction band\n", + "meff2=0.5*m; # The effective mass of an electron in the valence band\n", + "mr=(meff1*meff2)/(meff1+meff2); # The reduced mass\n", + "hkl=7.84*10**(-26); # The electron momentum in kg.m/s\n", + "lambdaa=0.8*10**(-6); # The wavelength of electromagnetic wave in m\n", + "h=1.054*10**(-34); # The distance between two levels\n", + "c=3*10**8; # Speed of ligth in m/s\n", + "hw=(h*2*math.pi*c)/lambdaa; # The poton energy in J\n", + "\n", + "# The band-gap energy.\n", + "Eg=hw-(hkl**2/(2*mr)); # The band-gap energy in J\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The band-gap energy = \",round(Eg*10**19,2),\" X 10**-19 J\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.7:pg-130" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The photon lifetime = 2.14 ps\n", + "\n", + " The threshold current = 57.7 mA\n", + "\n", + " The current required to generate a mean photon density of 8.5 × 10**21 m**-3 = 344.53 mA\n" + ] + } + ], + "source": [ + "# Example no.3.7\n", + "# To calculate (a) the photon lifetime, (b) the threshold current, and (c) the current required to generate a mean photon density of 8.5 × 10**21 m−3\n", + "# Page no.130\n", + "\n", + "\n", + "import math\n", + "\n", + "# Given data\n", + "w=3*10**(-6); # The active area width in meter\n", + "d=0.3*10**(-6); # The active area thickness in meter\n", + "L=500*10**(-6); # The length\n", + "Te=1*10**(-9); # Electron lifetime\n", + "Neth=0.8*10**(24); # Threshold electron density\n", + "aint=46*10**2; # Internal cavity loss in m**-1\n", + "n=3.5; # Refrective index of the medium\n", + "R1=0.65; # The reflectivity of ligth wave which is reflected at A\n", + "R2=0.65; # The reflectivity of ligth wave which is reflected at B\n", + "\n", + "# (a)The photon lifetime\n", + "amir=(1/(2*L))*math.log(1/(R1*R2)); # The loss due to mirrors per m\n", + "c=3*10**8; # Speed of ligth in m/s\n", + "v=c/n; # Speed of ligth in medium (m/s)\n", + "Tp=1/(v*(aint+amir)); # The photon lifetime in sec\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The photon lifetime = \",round(Tp*10**12,2),\" ps\"\n", + "\n", + "# (b)The threshold current\n", + "V=w*d*L; #The active volume in m**3\n", + "q=1.602*10**(-19); #The electron charge in C\n", + "Te=10**-9; #The electron lifetime in sec\n", + "Ith=(Neth*q*V)/Te; #The threshold current in mA \n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The threshold current = \",round(Ith*10**3,1),\" mA\"\n", + "\n", + "# The answer calculated in book is wrong\n", + "\n", + "# (c)The current required to generate a mean photon density of 8.5 × 10**21 m−3\n", + "Nph=8.5*10**21; #Mean photon density\n", + "Tph=Tp; #The photon lifetime in sec\n", + "I=(Ith+(Nph*q*V)/Tph); #The current required to generate a mean photon density of 8.5 × 10**21 m−3\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The current required to generate a mean photon density of 8.5 × 10**21 m**-3 = \",round(I*10**3,2),\" mA\"\n", + "\n", + "# The answer calculated in book is wrong\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.8:pg-133" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The wavelength of the light emitted = 1.44 micrometer\n" + ] + } + ], + "source": [ + "# Example no.3.8\n", + "# To find the wavelength of the light emitted\n", + "# Page no.133\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "RspRst=2*10**14; # The ratio of spontaneous emission rate to stimulated emission rate\n", + "T=30; # Temperature in degree celcius\n", + "kB=1.38*10**(-23); # The Boltzmann’s constant J/K\n", + "h=1.054*10**(-34); # The distance between two levels\n", + "c=3*10**8; # Speed of ligth in air\n", + "\n", + "T=T+273; # Temperature in Kelvin\n", + "w=(math.log(RspRst)*kB*T)/h; # Frequency in Rad\n", + "\n", + "# The wavelength of the light emitted\n", + "lambdaa=(2*math.pi*c)/w; # The wavelength of the light emitted\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The wavelength of the light emitted = \",round(lambdaa*10**6,2),\" micrometer\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.9:pg-133" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The frequency separation between modes = 142.9 GHz\n", + "\n", + " The wavelength separation between modes = 0.8 nanometer\n" + ] + } + ], + "source": [ + "# Example no.3.9\n", + "# To calculate a) the frequency separation between modes (b) the wavelength separation between modes\n", + "# Page no.133\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "lambdaa=1.3*10**-6; # Laser diode operating wavelength\n", + "L=300*10**-6; # Cavity length\n", + "n=3.5; # Refractive index of active region\n", + "c=3*10**8; # Speed of ligth in air (m/s)\n", + "\n", + "# a)The frequency separation between modes\n", + "deltaf=c/(2*n*L); # The frequency separation between modes in GHz\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The frequency separation between modes = \",round(deltaf*10**-9,1),\" GHz\"\n", + "\n", + "# (b)The wavelength separation between modes\n", + "deltalambda=(lambdaa**2*deltaf)/c; # The wavelength separation between modes\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The wavelength separation between modes = \",round(deltalambda*10**9,1),\" nanometer\"\n", + "\n", + "# The wrong unit is givan in book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.10:pg-134" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The effective mass of the electron in the valence band = 4.84 X 10**-31 kg\n" + ] + } + ], + "source": [ + "# Example no.3.10\n", + "# To calculate the effective mass of the electron in the valence band.\n", + "# Page no.134\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "# Given data\n", + "Eg=1.18; # Band gap in eV\n", + "Eg=1.18*1.602*10**-19; # Band gap in J\n", + "hk1=9*10**-26; # The crystal momentum in Kg.m/s\n", + "h=1.054*10**(-34); # The distance between two levels\n", + "f=3.94*10**14; # Light wave of frequency\n", + "m=9.109*10**(-31); # The electron rest mass in kg\n", + "\n", + "mr=(hk1)**2/(2*(h*2*math.pi*f-Eg)); # The reduced mass in kg\n", + "meff1=0.07*m; # The effective mass of an electron in the conduction band\n", + "\n", + "# The effective mass of the electron in the valence band.\n", + "meff2=(mr*meff1)/(meff1-mr); # The effective mass of the electron in the valence band.\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The effective mass of the electron in the valence band = \",round(meff2*10**31,2),\" X 10**-31 kg\"\n", + "# The answer is varrying due to round-off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.11:pg-135" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The optical gain coefficient = 4.28 X 10**3 m**-1\n", + "\n", + " The threshold electron density = 5.72 X 10**23 m**-3\n" + ] + } + ], + "source": [ + "# Example no.3.11\n", + "# To calculate (a) the optical gain coefficient Γg required to balance the cavity loss and (b) the threshold electron density Ne\n", + "# Page no.135\n", + "\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "L=320*10**-6; # Cavity length\n", + "R1=0.35; # The reflectivity of ligth wave which is reflected at A\n", + "R2=0.35; # The reflectivity of ligth wave which is reflected at B\n", + "aint=10**3; # Internal cavity loss in m**-1\n", + "c=3*10**8; # Speed of ligth in air\n", + "Go=1.73*10**-12; # Gain coefficient in m**3/s\n", + "Neo=3.47*10**23; # The value of the carrier density at which the gain coefficient becomes zero in m**-3\n", + "n=3.3; # Refractive index of medium\n", + "\n", + "# (a) the optical gain coefficient Γg required to balance the cavity loss\n", + "amir=(1/(2*L))*math.log(1/(R1*R2)); # The loss due to mirrors per m\n", + "acav=amir+aint; # The total cavity loss coefficient\n", + "gammag=acav; # The optical gain coefficient in m**-1\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The optical gain coefficient = \",round(gammag*10**-3,2),\" X 10**3 m**-1\"\n", + "\n", + "#(b) the threshold electron density Ne\n", + "v=c/n; # Velocity of ligth in medium\n", + "Tph=1/(v*acav); # The photon lifetime in sec\n", + "Neth=Neo+1/(Go*Tph); # The threshold electron density Ne\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The threshold electron density = \",round(Neth*10**-23,2),\" X 10**23 m**-3\"\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter4_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter4_1.ipynb new file mode 100644 index 00000000..73f077e8 --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter4_1.ipynb @@ -0,0 +1,76 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 04:Optical Modulators and Modulation Schemes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.2:pg-152" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The voltage required to introduce a phase shift of pi/2 = 0.48 V\n" + ] + } + ], + "source": [ + "# Example no.4.2\n", + "# To calculate the voltage required to introduce a phase shift of pi/2.\n", + "# Page no.152\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "lambda0=1530*10**-9; # An electro-optic modulator operating wavelength\n", + "d=10*10**-6; # Thickness\n", + "L=5*10**-2; # Length\n", + "n0=2.2; # Refractive index\n", + "r33=30*10**-12; # Pockel coefficient in m/V\n", + "deltaphi=math.pi/2; # Phase shift\n", + "V=(deltaphi*lambda0*d)/(math.pi*L*n0**3*r33); # The voltage required to introduce a phase shift of pi/2\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\n The voltage required to introduce a phase shift of pi/2 = \",round(V,2),\" V\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter5_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter5_1.ipynb new file mode 100644 index 00000000..30f42cd5 --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter5_1.ipynb @@ -0,0 +1,535 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 05:Optical Receivers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.1:pg-196" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The photon incidence rate = 2.77 X 10**9 photon/s\n", + "\n", + " The photon absorption rate = 2.63 X 10**9 photon/s\n", + "\n", + " The quantum efficiency = 0.855\n" + ] + } + ], + "source": [ + "# Example no.5.1\n", + "# To calculate (a) the photon incidence rate, (b) the photon absorption rate, and, (c) the quantum efficiency.\n", + "# Page no.196\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "lambdaa=550*10**(-9); # The wavelength of electromagnetic wave in m\n", + "c=3*10**8; # Speed of ligth in air\n", + "h=6.626*10**(-34); # Planck's constant\n", + "alpha=10**4; # absorption coefficient\n", + "W=3*10**-4; # width of the active region\n", + "Pi=1*10**-9; # optical power\n", + "eta=0.9; # the fraction of photocarriers that contribute to the photocurrent\n", + "Rp=0; # the power transmission coefficient at the air–semiconductor interface\n", + "\n", + "# (a) the photon incidence rate\n", + "Eph=(h*c)/lambdaa; # The energy of a photon\n", + "Rincident=Pi/Eph; # The photon incidence rate\n", + "\n", + "# Display result on command window\n", + "print \"\\n The photon incidence rate = \",round(Rincident*10**-9,2),\" X 10**9 photon/s\"\n", + "\n", + "# (b) the photon absorption rate\n", + "Rabs=(Rincident*(1-math.exp(-alpha*W))); # The photon absorption rate\n", + "\n", + "# Display result on command window\n", + "print \"\\n The photon absorption rate = \",round(Rabs*10**-9,2),\" X 10**9 photon/s\"\n", + "\n", + "#c) the quantum efficiency\n", + "neta=(1-Rp)*eta*(1-math.exp(-alpha*W)); # The quantum efficiency\n", + "\n", + "# Display result on command window\n", + "print \"\\n The quantum efficiency = \",round(neta,3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.2:pg-198" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The responsivity = 0.8 A/W\n", + "\n", + " The cutoff wavelength = 0.845 micrometer\n" + ] + } + ], + "source": [ + "# Example no.5.2\n", + "# To calculate (a) the responsivity R and (b) the cutoff wavelength \n", + "# Page no.198\n", + "\n", + "\n", + "\n", + "import math\n", + "# Given data\n", + "neta=0.9; # The quantum efficiency\n", + "Eg=1.42; # The band-gap energy in eV\n", + "lambdaa=1.1; # The operating (free-space) wavelength in micrometer\n", + "\n", + "# (a) The responsivity \n", + "R=(neta*lambdaa)/1.24; # The responsivity in A/W\n", + "\n", + "# Display result on command window\n", + "print \"\\n The responsivity = \",round(R,1),\" A/W\" #Wrong answer in book\n", + "\n", + "# (b) The cutoff wavelength \n", + "lambdac=1.2/Eg; #The cutoff wavelength in micrometer\n", + "\n", + "# Display result on command window\n", + "print \"\\n The cutoff wavelength = \",round(lambdac,3),\" micrometer\" #Wrong answer in book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.3:pg-199" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The quantum efficiency for 0.7 micrometer wavelength = 0.7086\n", + "\n", + " The quantum efficiency for reduced wavelength of 0.5 micrometer = 0.506\n" + ] + } + ], + "source": [ + "# Example no.5.3\n", + "# To find quantum efficiency at different wavelength and same responsivity\n", + "# Page no.199\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "lambda1=0.7; # The radiation wavelength in micrometer\n", + "R=0.4; # The responsivity in A/W\n", + "lambda2=0.5; # The reduced wavelength in micrometer\n", + "neta1=(R*1.24)/lambda1; # The quantum efficiency for 0.7micrometer wavelength\n", + "neta2=neta1*(lambda2/lambda1); # The quantum efficiency for reduced wavelength 0.5micrometer \n", + "\n", + "# Display result on command window\n", + "print \"\\n The quantum efficiency for 0.7 micrometer wavelength = \",round(neta1,4)\n", + "print \"\\n The quantum efficiency for reduced wavelength of 0.5 micrometer = \",round(neta2,3)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.4:pg-199" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Refractive index of antireflection coating = 1.9\n", + "\n", + " Thickness of antireflection coating = 90.0 nm\n" + ] + } + ], + "source": [ + "# Example no.5.4\n", + "# To determine the refractive index and thickness of the antireflection coating\n", + "# Page no.199\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "lambdaa=680*10**-9; # Wavelength of red ligth in meter\n", + "nair=1; # Refractive index of air\n", + "nsilicon=3.6; # Refractive index of silicon\n", + "nAR=math.sqrt(nair*nsilicon); # Refractive index of antireflection coating\n", + "tAR=lambdaa/(4*nAR); # Thickness of antireflection coating\n", + "\n", + "# Display result on command window\n", + "print \"\\n Refractive index of antireflection coating = \",round(nAR,1)\n", + "print \"\\n Thickness of antireflection coating = \",round(tAR*10**9),\" nm\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.5:pg-216" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Resonator length = 486.0 nm\n", + "\n", + " The inaccuracy in length with which resonator should be fabricated = 4.0 nm\n" + ] + } + ], + "source": [ + "# Example 5.5\n", + "# To calculate the inaccuracy with which resonator should be fabricated\n", + "# Page no.216\n", + "\n", + "\n", + "import math\n", + "\n", + "# Given data\n", + "R1=0.9; # Reflectivity at point A\n", + "integer=4;\n", + "n=3.5; # Reflection index of silicon\n", + "F=math.pi/(1-math.sqrt(R1)); # The finesse of the resonator and also called as the ratio of the free spectral range\n", + "lambda0=850; # Wavelength in nanometer\n", + "L=integer*lambda0/(2*n); # Resonator length in nanometer\n", + "\n", + "# The inaccuracy with which resonator should be fabricated\n", + "deltaL=L*0.5/F;\n", + "\n", + "# Display result on command window\n", + "print \"\\n Resonator length = \",round(L),\"nm\"\n", + "print \"\\n The inaccuracy in length with which resonator should be fabricated = \",round(deltaL),\" nm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.6:pg-229" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The peak current at LO power 10dBm = 1.133 mA\n", + "\n", + " The peak current after ignoring the d.c. term = 1.204 mA\n", + "\n", + " The peak current at LO power -10dBm = 0.1133 mA\n", + "\n", + " The peak current after ignoring the d.c. term = 0.1846 mA\n" + ] + } + ], + "source": [ + "# Example no.5.6\n", + "# To find the peak current if (a) LO power = 10 dBm, (b) LO power = −10 dBm for the single-branch receiver\n", + "# Page no.229\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "L=100; # Length of fiber\n", + "loss=0.2*L; # Total fiber loss\n", + "PtdBm=12; # The peak power of the signal at the transmitter\n", + "R=0.9; # Responsivity in A/W\n", + "PrdBm=PtdBm-loss; # The power at the receiver\n", + "\n", + "# (a) the peak current LO power = 10 dBm\n", + "PLO1dBm=10; # Power at local oscillator in dBm\n", + "PLO1=10**(0.1*PLO1dBm); # Power at local oscillator in mW\n", + "Pr=10**(0.1*PrdBm); # Power at receiver in mW\n", + "Id1=R*math.sqrt(Pr*PLO1); # The peak current at LO power = 10dBm\n", + "I1=R*Pr/2+R*math.sqrt(Pr*PLO1); # The peak current after ignoring the d.c. term\n", + "\n", + "# Display result on command window\n", + "print \"\\n The peak current at LO power 10dBm = \",round(Id1,4),\" mA\"\n", + "print \"\\n The peak current after ignoring the d.c. term = \",round(I1,3),\" mA\"\n", + "\n", + "# (b) the peak current LO power = -10 dBm\n", + "PLO2dBm=-10; # Power at local oscillator in dBm\n", + "PLO2=10**(0.1*PLO2dBm); # Power at local oscillator in mW\n", + "Id2=R*math.sqrt(Pr*PLO2); # The peak current at LO power = -10dBm\n", + "I2=R*Pr/2+R*math.sqrt(Pr*PLO2); # The peak current after ignoring the d.c. term\n", + "\n", + "# Display result on command window\n", + "print \"\\n The peak current at LO power -10dBm = \",round(Id2,4),\" mA\"\n", + "print \"\\n The peak current after ignoring the d.c. term = \",round(I2,4),\" mA\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.7:pg-234" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The peak current for LO power 10 dBm = 2.2661 mA\n", + "\n", + " The peak current for LO power -10 dBm = 0.2266 mA\n", + "\n", + " A single-branch receiver would have a significant amount of cross-talk. In contrast, for a balanced receiver, intermodulation \n", + " cross-talk is canceled out due to the balanced detection.\n" + ] + } + ], + "source": [ + "# Example no.5.7\n", + "# To find the peak current if (a) LO power = 10 dBm, (b) LO power = −10 dBm for the balanced receiver\n", + "# Page no.234\n", + "\n", + "\n", + "import math\n", + "\n", + "# Given data\n", + "L=100; # Length of fiber\n", + "loss=0.2*L; # Total fiber loss\n", + "PtdBm=12; # The peak power of the signal at the transmitter\n", + "R=0.9; # Responsivity in A/W\n", + "PrdBm=PtdBm-loss; # The power at the receiver\n", + "\n", + "# (a) the peak current LO power = 10 dBm\n", + "PLO1dBm=10; # Power at local oscillator in dBm\n", + "PLO1=10**(0.1*PLO1dBm); # Power at local oscillator in mW\n", + "Pr=10**(0.1*PrdBm); # Power at receiver in mW\n", + "Id1=2*R*math.sqrt(Pr*PLO1); # The peak current LO power = 10 dBm\n", + "\n", + "# Display result on command window\n", + "print \"\\n The peak current for LO power 10 dBm = \",round(Id1,4),\" mA\"\n", + "\n", + "# (b) the peak current LO power = -10 dBm\n", + "PLO2dBm=-10; # Power at local oscillator in dBm\n", + "PLO2=10**(0.1*PLO2dBm); # Power at local oscillator in mW\n", + "Id2=2*R*math.sqrt(Pr*PLO2); # The peak current LO power = -10 dBm\n", + "\n", + "# Display result on command window\n", + "print \"\\n The peak current for LO power -10 dBm = \",round(Id2,4),\" mA\"\n", + "\n", + "# comment on the intermodulation cross-talk in a single-branch receiver and the balanced receiver\n", + "print \"\\n A single-branch receiver would have a significant amount of cross-talk. In contrast, for a balanced receiver, intermodulation \\n cross-talk is canceled out due to the balanced detection.\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.8:pg-238" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The in-phase component of the current = -0.8012 mA\n", + "\n", + " The quadrature component of the current = -0.8012 mA\n" + ] + } + ], + "source": [ + "# Example no.5.8\n", + "# To find the in-phase and quadrature components of the current of a balanced IQ receiver.\n", + "# Page no.238\n", + "\n", + "import math\n", + "import numpy\n", + "\n", + "\n", + "\n", + "# Given data\n", + "PLO=10; # Local oscillator power in mW from Example 5.7a\n", + "Pr=0.1585; # Power at receiver in mW\n", + "R=0.9; # Responsivity in A/W\n", + "st=complex((-1/math.sqrt(2)),(1/math.sqrt(2))); # The QPSK transmitted signal\n", + "Ii=R*math.sqrt(Pr*PLO)*numpy.real(st); # The in-phase component of the current in mA\n", + "Iq=-R*math.sqrt(Pr*PLO)*numpy.imag(st); # The quadrature component of the current in mA\n", + "\n", + "# Display result on command window\n", + "print \"\\n The in-phase component of the current = \",round(Ii,4),\" mA\"\n", + "print \"\\n The quadrature component of the current = \",round(Iq,4),\" mA\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.9:pg-241" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " In-phase component of phtocurrent corresponding to x-polarization = 1.2426 mA\n", + "\n", + " Quadrature component of phtocurrent corresponding to x-polarization = -0.0 mA\n", + "\n", + " In-phase component of phtocurrent corresponding to y-polarization = 28.754 mA\n", + "\n", + " Quadrature component of phtocurrent corresponding to y-polarization = -0.0 mA\n" + ] + } + ], + "source": [ + "# Example 5.9\n", + "# To find the in-phase and quadrature components of the current of a polarization modulated (PM) QPSK signal\n", + "# Page no. 241\n", + "\n", + "\n", + "\n", + "import math\n", + "import numpy\n", + "\n", + "# Given data\n", + "theta1=math.pi/4.0;\n", + "Sx=math.exp(theta1); # Signal data in x-polarization\n", + "theta2=(5*math.pi)/4;\n", + "Sy=math.exp(1*theta2); # Signal data in y-polarization\n", + "PLO=10; # Local oscillator power in mW from Example 5.8\n", + "Pr=0.1585; # Power at receiver in mW from Example 5.8\n", + "R=0.9; # Reflectivity\n", + "\n", + "# The complex photocurrent corresponding to x-polarization \n", + "Ix= (R*math.sqrt(Pr*PLO))*Sx/2; # The complex photocurrent corresponding to x-polarization\n", + "Iix=numpy.real(Ix); # In-phase component of phtocurrent corresponding to x-polarization\n", + "Iqx=-numpy.imag(Ix); # Quadrature component of phtocurrent corresponding to x-polarization\n", + "\n", + "# The complex photocurrent corresponding to y-polarization \n", + "Iy= (R*math.sqrt(Pr*PLO))*Sy/2; # The complex photocurrent corresponding to y-polarization\n", + "Iiy=numpy.real(Iy); # In-phase component of phtocurrent corresponding to y-polarization\n", + "Iqy=-numpy.imag(Iy); # Quadrature component of phtocurrent corresponding to y-polarization\n", + "\n", + "# Display result on command window\n", + "print \"\\n In-phase component of phtocurrent corresponding to x-polarization = \",round(Iix,4),\" mA\"\n", + "print \"\\n Quadrature component of phtocurrent corresponding to x-polarization = \",round(Iqx,4),\" mA\"\n", + "print \"\\n In-phase component of phtocurrent corresponding to y-polarization = \",round(Iiy,4),\" mA\"\n", + "print \"\\n Quadrature component of phtocurrent corresponding to y-polarization = \",round(Iqy,4),\" mA\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter6_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter6_1.ipynb new file mode 100644 index 00000000..3805e6ef --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter6_1.ipynb @@ -0,0 +1,756 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 06:Optical Amplifiers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.1:pg-249" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Gain G = 150.0\n" + ] + } + ], + "source": [ + "# Example 6.1\n", + "# Calculation of the gain\n", + "# Page no 249\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "n=1.5; # Refractive ondex of air\n", + "lambdaa=1550*10**-9; # Wavelength \n", + "c=3*10**8; # Velocity of light\n", + "p=5.73*10**-17; # Power spectral density\n", + "h=6.63*10**-34 # Planck constant\n", + "\n", + "\n", + "# Gain\n", + "f=c/lambdaa;\n", + "\n", + "G=(p/(2*n*h*f))+1;\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n Gain G =\",round(G)\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.2:pg-255" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The variance of the signal–ASE beat noise current is = 2.33 x 10**-9 A**2\n" + ] + } + ], + "source": [ + "# Example 6.2\n", + "# Calculation of the variance of the signal–ASE beat noise\n", + "# Page no 255\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "#Given data\n", + "\n", + "a=1.3*10**-16; # PSD of an amplifier\n", + "f=7*10**9; # Cut off frequency\n", + "Pi=10*10**-6; # Input power\n", + "R=0.8; # Responsivity\n", + "G=20; # Gain of an amplifier\n", + "\n", + "# The variance of the signal–ASE beat noise\n", + "G=10**(G/10.0);\n", + "P=G*Pi;\n", + "\n", + "r=4*R**2*P*a*f;\n", + "r=r*10**9;\n", + "\n", + "\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The variance of the signal–ASE beat noise current is = \",round(r,2),\" x 10**-9 A**2\"\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.3:pg-257" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " (a) The variance of the signal–ASE beat noise current for Pin=-27dBm\n", + "\n", + " The variance of the signal–ASE beat noise current = 2.65 x 10**-8 A**2\n", + "\n", + " The variance of the ASE–ASE beat noise current = 5.59 x 10**-11 A**2\n", + "\n", + " The total variance = 2.659 x 10**-8 A**2\n", + "\n", + " \n", + " (b) The variance of the signal–ASE beat noise current for Pin=-60dBm\n", + "\n", + " The variance of the signal–ASE beat noise current = 1.33 x 10**-11 A**2\n", + "\n", + " The variance of the ASE–ASE beat noise current = 5.59 x 10**-11 A**2\n", + "\n", + " The total variance = 6.92 x 10**-11 A**2 \n" + ] + } + ], + "source": [ + "# Example 6.3\n", + "# Calculation of the (a) the variance of the signal–ASE beat noise current, (b) the variance of the ASE–ASE beat noise current, and (c) the total variance.\n", + "# Page no 257\n", + "\n", + "\n", + "import math\n", + "\n", + "\n", + "#Given data\n", + "\n", + "G=30; # Gain\n", + "\n", + "nsp=5;\n", + "R=0.8;\n", + "f1=16*10**9;\n", + "fe=9*10**9;\n", + "#Pi1=-60;\n", + "c=3*10**8; # Velocity of light\n", + "h=6.63*10**-34 # Planck constant\n", + "lambdaa=1530*10**-9; # Wavelegth\n", + "Pi1=-27; # Input power\n", + "Pi2=-60;\n", + "f0=16*10**9;\n", + "\n", + "\n", + "#(a) The variance of the signal–ASE beat noise current for Pin=-27dBm\n", + "Po=G+Pi1;\n", + "Po=10**(Po/10.0);\n", + "Po=Po*10**-3;\n", + "G=10**(G/10.0);\n", + "f=c/lambdaa;\n", + "r=nsp*h*f*(G-1);\n", + "B=8*10**9;\n", + "#B=min(f/2,fe);\n", + "r0=4*R**2*Po*r*B;\n", + "#r0=r0*10**12;\n", + "\n", + "#(b) The variance of the ASE–ASE beat noise current\n", + "\n", + "r1=R**2*r**2*((2*f0)-fe)*fe;\n", + "\n", + "#r1=r1*10**11;\n", + "# (c) The total variance.\n", + "\n", + "rt=r0+r1;\n", + "\n", + "# Displaying results in the command window \n", + "print \"\\n (a) The variance of the signal–ASE beat noise current for Pin=-27dBm\"\n", + "\n", + "print \"\\n The variance of the signal–ASE beat noise current = \",round(r0*10**8,2),\" x 10**-8 A**2\"\n", + "print \"\\n The variance of the ASE–ASE beat noise current = \",round(r1*10**11,2),\" x 10**-11 A**2\"\n", + "\n", + "print \"\\n The total variance = \",round(rt*10**8,3),\" x 10**-8 A**2\"\n", + "# The answers vary due to round off error\n", + "\n", + "\n", + "#Given data\n", + "\n", + "G=30; # Gain\n", + "nsp=5;\n", + "R=0.8; # \n", + "f1=16*10**9;\n", + "fe=9*10**9;\n", + "#Pi1=-60;\n", + "c=3*10**8; # Velocity of light\n", + "h=6.63*10**-34 # Planck constant\n", + "lambdaa=1530*10**-9; # Wavelegth\n", + "Pi1=-27; # Input power\n", + "Pi2=-60;\n", + "f0=16*10**9;\n", + "\n", + "#(b) The variance of the signal–ASE beat noise current for Pin=-60dBm\n", + "Po2=G+Pi2;\n", + "Po=10**(Po2/10);\n", + "Po=Po*10**-3;\n", + "G=10**(G/10);\n", + "f=c/lambdaa;\n", + "r=nsp*h*f*(G-1);\n", + "B=8*10**9;\n", + "#B=min(f/2,fe);\n", + "r0=4*R**2*Po*r*B;\n", + "#r0=r0*10**12;\n", + "\n", + "#(b) The variance of the ASE–ASE beat noise current\n", + "\n", + "r1=R**2*r**2*((2*f0)-fe)*fe;\n", + "\n", + "#r1=r1*10**11;\n", + "# (c) The total variance.\n", + "\n", + "rt=r0+r1;\n", + "\n", + "# Displaying results in the command window \n", + "print \"\\n \\n (b) The variance of the signal–ASE beat noise current for Pin=-60dBm\"\n", + "\n", + "print \"\\n The variance of the signal–ASE beat noise current = \",round(r0*10**11,2),\" x 10**-11 A**2\"\n", + "print \"\\n The variance of the ASE–ASE beat noise current = \",round(r1*10**11,2),\" x 10**-11 A**2\"\n", + "\n", + "print \"\\n The total variance = \",round(rt*10**11,2),\" x 10**-11 A**2 \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.4:pg-262" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The amplifier gain = 992.0\n" + ] + } + ], + "source": [ + "# Example 6.4\n", + "# Calculation of the amplifier gain\n", + "# Page no 262\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "Po=0; # Signal output of amplifier\n", + "#f=7*10**9; # Cut off frequency\n", + "B=7.5*10**9; # Bandwidth\n", + "R=0.9; # Responsivity\n", + "c=3*10**8; # Velocity of light\n", + "lambdaa=1550*10**-9; # Operating frequency\n", + "fn=4.5; # Noise figure\n", + "Ro=0.066*10**-3; # Beat noise current\n", + "h=6.626*10**-34; # Planck constant\n", + "\n", + "# The amplifier gain\n", + "P=10**(Po/10)*10**-3;\n", + "r=Ro**2/(4*R**2*B*P);\n", + "fn=10**(fn/10);\n", + "f=c/lambdaa;\n", + "G=(1/fn)*(((2*r)/(h*f))+1);\n", + "\n", + "\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The amplifier gain = \",round(G)\n", + "\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.5:pg-263" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The OSNR in a bandwidth of 12.49 GHz = 29.94 dB\n" + ] + } + ], + "source": [ + "# Example 6.5\n", + "# Calculation of the OSNR in a bandwidth of 12.49 GHz.\n", + "# Page no 263\n", + "\n", + "\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "G=25; # Gain\n", + "c=3*10**8; # Velocity of light\n", + "h=6.63*10**-34 # Planck constant\n", + "lambdaa=1545*10**-9; # Wavelegth\n", + "Pi=-22; # Input power\n", + "fn=6; \n", + "B=12.49*10**9;\n", + "\n", + "# The OSNR in a bandwidth of 12.49 GHz\n", + "Po=G+Pi;\n", + "Po=10**(Po/10.0);\n", + "Po=Po*10**-3;\n", + "fn=10**(fn/10.0);\n", + "G=10**(G/10.0);\n", + "f=c/lambdaa;\n", + "r=(G*fn-1)*(h*f/2.0);\n", + "O=Po/(2*r*B);\n", + "O=10*math.log10(O);\n", + "\n", + "# Displaying results in the command window \n", + "print \"\\n The OSNR in a bandwidth of 12.49 GHz = \",round(O,2),\" dB\"\n", + "\n", + "\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.6:pg-268" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Single pass gain Gs= 3.87 or\n", + "\n", + "Single pass gain Gs= 2.52\n", + "\n", + "The the 3-dB bandwidth = 6.39 GHz \n" + ] + } + ], + "source": [ + "# Example 6.6\n", + "# Calculation of the single-pass gain and 3-dB bandwidth\n", + "# Page no 268\n", + "\n", + "\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "c1=3*10**8; # Velocity of light\n", + "f=7*10**9; # Cut off frequency\n", + "L=500*10**-6; # Input power\n", + "Gp=15; # Peak gain\n", + "n=3.2;\n", + "Gs=2.52;\n", + "R=0.32;\n", + "a=0.1024;\n", + "b=-0.6546;\n", + "c=1;\n", + "\n", + "# The single-pass gain\n", + "\n", + "x1 =( -1*b+ math.sqrt ((b **2) -4*a*c)) /(2* a); # 1 s t r o o t\n", + "x2 =( -1*b- math.sqrt ((b **2) -4*a*c)) /(2* a); # 2nd r o o t\n", + "\n", + "# The 3-dB bandwidth\n", + "G=10**(Gp/10.0);\n", + "x=(1-(R*x2))/(2*math.sqrt(R*x2));\n", + "f=(c1/(math.pi*L*n))*math.asin(x);\n", + "# f=f*10**-9; \n", + "\n", + "# Displaying results in the command window \n", + "\n", + "print \"Single pass gain Gs= \",round(x1,2),\" or\"\n", + "print \"\\nSingle pass gain Gs= \",round(x2,2)\n", + "print \"\\nThe the 3-dB bandwidth = \",round(f*10**-9,2),\" GHz \"\n", + "\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.7:pg-273" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The saturation power Psat = 29.68 mW \n", + "\n", + " The bias current I = 50.204 mA \n" + ] + } + ], + "source": [ + "# Example 6.7\n", + "# Calculation of (a) the saturation power and (b) the bias current I\n", + "# Page no 273\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "\n", + "#Given data\n", + "\n", + "c=3*10**8; # Velocity of light\n", + "lambdaa=1530*10**-9; # Wavelength\n", + "t=0.3 # Overlap factor\n", + "r=7.3*10**-20; # Gain cross section\n", + "r0=1*10**-9; # Carrier lifetime\n", + "q=1.609*10**-19; \n", + "v=7.5*10**-16; # Active volume\n", + "h=6.63*10**-34 # Planck constant\n", + "A=5*10**-6; # Effective area\n", + "g=4.82*10**3; # Small signal gain coeffifient\n", + "N=3.5*10**23; # \n", + "\n", + "# (a) the saturation power and \n", + "\n", + "\n", + "f=c/lambdaa;\n", + "Ps=(h*f*A)/(t*r*r0);\n", + "Ps=Ps*10**-3;\n", + "\n", + "# (b) the bias current I\n", + "\n", + "I=(g/(r*r0)+N/r0)*q*v;\n", + "I=I*10**3;\n", + "# Displaying results in the command window \n", + "print \"\\n The saturation power Psat = \",round(Ps,3),\" mW \"\n", + "\n", + "print \"\\n The bias current I = \",round(I,3),\" mA \"\n", + "\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.9:pg-290" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The variance of the signal–ASE beat noise current = 8.14 x 10**-9 A**2 W/Hz\n" + ] + } + ], + "source": [ + "# Example 6.9\n", + "# Calculation of the variance of the signal–ASE beat noise current.\n", + "# Page no 290\n", + "\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "si=30.0; # Electrical SNRs at the amplifier input\n", + "so=25.0; # Electrical SNRs at the amplifier output\n", + "p=0; # Signal power at output \n", + "r=-126.0; # Signal power at input \n", + "R=0.9; # Planck constant\n", + "f=195*10.0**12; # Frequency\n", + "b=20*10.0**9; # Bandwidth\n", + "\n", + "# The variance of the signal–ASE beat noise current\n", + "p1=10**(p/10)*10**-3;\n", + "rn=10**(r/10)*10**-3;\n", + "r1=rn*b;\n", + "r0=2*R**2*p1*r1;\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The variance of the signal–ASE beat noise current = \",round(r0*10**9,2),\" x 10**-9 A**2 W/Hz\"\n", + "\n", + "\n", + "# The value of noise power given in example as -126 but for calculation it is taken as -128 in book. Therefore answer is varying.\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.12:pg-296" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The ASE power spectral density per polarization = 6.396 x 10**-18 W/Hz \n" + ] + } + ], + "source": [ + "# Example 6.12\n", + "# Calculation of the ASE power spectral density per polarization.\n", + "# Page no 296\n", + "\n", + "\n", + "import math\n", + "#Given data\n", + "\n", + "si=30.0; # Electrical SNRs at the amplifier input\n", + "so=25.0; # Electrical SNRs at the amplifier output\n", + "po=2; # Signal power at output \n", + "pi=-13; # Signal power at input \n", + "h=6.626*10**-34; # Planck constant\n", + "f=195*10**12;\n", + "\n", + "# The ASE power spectral density per polarization\n", + "fn=si-so;\n", + "fn=10**(fn/10);\n", + "G=po-pi;\n", + "G=10**(G/10.0);\n", + "r=(h*f*(G*fn-1))/2;\n", + "r=r*10**18;\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The ASE power spectral density per polarization = \",round(r,3),\" x 10**-18 W/Hz \"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.13:pg-296" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The geometric mean of the facet reflectivity R = 0.275\n" + ] + } + ], + "source": [ + "# Example 6.13\n", + "# Calculation of the geometric mean of the facet reflectivity R\n", + "# Page no 296\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "Gm=20.0;\n", + "G1=5.0;\n", + "\n", + "# The geometric mean of the facet reflectivity R\n", + "Gmax=10**(Gm/10); # Peak Gain\n", + "Gs=10**(G1/10); # Single pass gain\n", + "R=(math.sqrt(Gs)-10)/(math.sqrt(Gs)-Gs*10);\n", + "\n", + "\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The geometric mean of the facet reflectivity R = \",round(R,3)\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.14:pg-297" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The geometric mean of the facet reflectivity R = 214.29 GHz \n", + "\n", + " The upper bound on the single-pass gain Gs = 4.77 or \n", + "\n", + " The upper bound on the single-pass gain Gs = 2.33\n" + ] + } + ], + "source": [ + "# Example 6.14\n", + "# Calculation of the upper bound on the single-pass gain\n", + "# Page no 297\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "n=3.5; # Refractive index\n", + "c1=3*10**8; # Velocity of light\n", + "L=200*10**-6; # Amplifier length\n", + "a=0.09;\n", + "b=-(1.2*0.1805**2+0.6);\n", + "c=1;\n", + "\n", + "# The geometric mean of the facet reflectivity R\n", + "f=c1/(2*n*L);\n", + "\n", + "x1 =( -1*b+ math.sqrt ((b **2) -4*a*c)) /(2* a); # 1 s t r o o t\n", + "x2 =( -1*b- math.sqrt ((b **2) -4*a*c)) /(2* a); # 2nd r o o t\n", + "\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The geometric mean of the facet reflectivity R = \",round(f*10**-9,2),\" GHz \"\n", + "print \"\\n The upper bound on the single-pass gain Gs = \",round(x1,2),\" or \"\n", + "print \"\\n The upper bound on the single-pass gain Gs = \",round(x2,2)\n", + "\n", + "\n", + "# The answers vary due to round off error\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter7_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter7_1.ipynb new file mode 100644 index 00000000..90d8c1a2 --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter7_1.ipynb @@ -0,0 +1,592 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 07:Transmission System Design" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.1:pg-305" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The lower limit on the transmitter power = 7.23 mW\n", + "\n", + " The lower limit on the transmitter peak power is 7.23mW. If the transmitter peak power < 7.23mW, Q < 6.\n" + ] + } + ], + "source": [ + "# Example 7.1 \n", + "# Compuatation of the lower limit on the transmitter power\n", + "#\n", + "# Page no. 305\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "q=1.6*10**-19;\n", + "R=1;\n", + "B=7*10**9;\n", + "c=3*10**8; # Velocity of light\n", + "h=6.62*10**-34; # Planck constant\n", + "Q=6;\n", + "k=1.38*10**-23; # Boltzman constant\n", + "T=298;\n", + "Rl=50;\n", + "alpha=0.046; # Fiber loss coefficient\n", + "L=130; # Length\n", + "\n", + "\n", + "# The lower limit on the transmitter power\n", + "a=2*q*R*B;\n", + "b=(4*k*T*B)/Rl;\n", + "p=(2*math.sqrt(b)/R*Q)+((a*Q**2)/R**2);\n", + "Pi=p*math.exp(alpha*L);\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\n The lower limit on the transmitter power = \",round(Pi*10**3,2),\" mW\"\n", + "print \"\\n The lower limit on the transmitter peak power is 7.23mW. If the transmitter peak power < 7.23mW, Q < 6.\"\n", + "\n", + "# The answer vary due to round off error\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.2:pg-311" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Exact Q-factor if the signal is OOK = 3.7\n", + "\n", + " Approximate Q-factor if the signal is OOK = 3.8\n", + "\n", + " Exact Q-factor if the signal is PSK = 5.24\n", + "\n", + " Approximate Q-factor if the signal is PSK = 5.39\n" + ] + } + ], + "source": [ + "# Example no. 7.2\n", + "# To calculate exact and approximate Q-factor if the signal is (a)OOK, (b) PSK\n", + "# Page no. 311\n", + "\n", + "import math\n", + "\n", + "\n", + "# Given data\n", + "lambdaa=1.55*10**(-6); # Wavelength of given signal\n", + "meanPin=1; # Mean fiber launch power in dBm\n", + "alpha=0.2; # fiber loss in dB/km\n", + "l=240; # fiber length in km\n", + "neta=0.7; # quantum efficiency \n", + "T = 290; # Tempearture in K\n", + "RL=100; # Length resistance in Ω\n", + "PLOdBm = 10; # Power at local oscillator in dBm\n", + "Be = 7.5*10**9; # Efficient bandwidth of filter in Hz\n", + "c=3*10**8; # Speed of ligth in air in m/s\n", + "loss=alpha*l; # Total fiber loss\n", + "q=1.602*10**(-19); # Charge of electron\n", + "h=6.626*10**(-34); # Planck constant\n", + "kB=1.38*10**(-23); # Bolzman constant\n", + "\n", + "f=c/lambdaa; # mean frequency\n", + "R=(neta*q)/(h*f); # Responsivity\n", + "\n", + "#For OOK\n", + "Pin=10*math.log10(2)+meanPin; # peak power in dBm\n", + "P1rdBm=Pin-loss; # received peak power in dBm\n", + "P1r=(10**(P1rdBm/10))*10**(-3); # received peak power in W\n", + "PLO=(10**(PLOdBm/10))*10**(-3); # Power at local oscillator in W\n", + "I1=2*R*math.sqrt(P1r*PLO); # mean of bit 1\n", + "sigma1=2*q*Be*R*(P1r+PLO)+(4*kB*T*Be)/RL; # Square of variance of bit 1\n", + "I0=0; # mean of bit 0\n", + "sigma0=sigma1; # Square of variance of bit 0\n", + "Q1=(I1-I0)/(2*math.sqrt(sigma1)); # Exact Q-factor\n", + "Q2=math.sqrt((neta*P1r)/(2*h*f*Be)); # Approximate Q-factor\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Exact Q-factor if the signal is OOK = \",round(Q1,1)\n", + "print \"\\n Approximate Q-factor if the signal is OOK = \",round(Q2,1)\n", + "\n", + "# For PSK\n", + "P1rdBm=meanPin-loss; # received peak power in dBm\n", + "P1r=(10**(P1rdBm/10))*10**(-3); # received peak power in W\n", + "I1=2*R*math.sqrt(P1r*PLO); # mean of bit 1\n", + "sigma1=2*q*Be*R*(P1r+PLO)+(4*kB*T*Be)/RL; # Square of variance of bit 1\n", + "I0=-I1; # mean of bit 0\n", + "sigma0=sigma1; # Square of variance of bit 0\n", + "Q1=I1/math.sqrt(sigma1); # Exact Q-factor\n", + "Q2=math.sqrt((2*neta*P1r)/(h*f*Be)); # Approximate Q-factor\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Exact Q-factor if the signal is PSK = \",round(Q1,2)\n", + "print \"\\n Approximate Q-factor if the signal is PSK = \",round(Q2,2)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.3:pg-315" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Distance = 10.0 Km \n" + ] + } + ], + "source": [ + "# Example 7.3\n", + "# Calculation of the distance.\n", + "# Page no 315\n", + "\n", + "import math\n", + "\n", + "\n", + "\n", + "#Given data\n", + "B1=2.5*10**9; # Mean optical power\n", + "B2=10*10**9; # Split loss\n", + "L1=160*10**3; # Total system margin\n", + "\n", + "\n", + "\n", + "# Distance\n", + "L2=((B1/B2)**2*L1); \n", + "L2=L2*10**-3;\n", + "\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n Distance = \",round(L2),\" Km \"\n", + "\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.4:pg-321" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " OSNR is = 15.18 dB\n", + "\n", + " Q-factor is = 7.72\n" + ] + } + ], + "source": [ + "# Example 7.4 \n", + "# Compuatation of (a) OSNR in a reference bandwidth of 0.1 nm, (b) Q-factor.\n", + "# Page no. 321\n", + "\n", + "import math\n", + "\n", + "# Given data\n", + "\n", + "f=10*10**9;\n", + "n=1.5; #Refractive index\n", + "h=6.63*10**-34; # Planck constant\n", + "c=3*10**8; # Velocity of light\n", + "lambdaa=1.55*10**-6; #\n", + "q=1.6*10**-19; # Electron charge\n", + "d=0.1*10**-9; # Reference bandwidth\n", + "alpha=0.0461; # Fiber loss coefficient\n", + "L=80; # Spacing\n", + "Pi=-3; # Mean fiber launch power\n", + "N=80; # Identical amplifers\n", + "fe=7*10**9; # Electrical filter bandwidth\n", + "\n", + "\n", + "# Signal calculation\n", + "df=-((c*d)/lambdaa**2); #Reference frequency\n", + "G=math.exp(alpha*L);\n", + "G1=10*math.log10(G);\n", + "N1=10*math.log10(N);\n", + "Fn=2*n; #Noise figure\n", + "Fn=10*math.log10(Fn);\n", + "\n", + "O=Pi-N1-G1-Fn+58; #OSNR\n", + "Pi1=2*10**(-(3/10.0)); # Peak power in mW\n", + "f=c/lambdaa;\n", + "Q=math.sqrt((Pi1*10**-3)/(4*N*n*h*f*(G-1)*fe)); #Q-factor\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n OSNR is = \",round(O,2),\" dB\"\n", + "print \"\\n Q-factor is = \",round(Q,2)\n", + "\n", + "# The answer vary due to round off error\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.5:pg-325" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The transmission distance is = 19709.0 km\n" + ] + } + ], + "source": [ + "# Example 7.5 \n", + "# Compuatation of the transmission distance\n", + "# Page no. 325\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "fl=0.2 # Fiber loss\n", + "L=100; # Amplifeir spacing\n", + "n=1.4;\n", + "h=6.63*10**-34; # Planck constant\n", + "c=3*10**8; # Velocity of light\n", + "lambdaa=1.55*10**-6;\n", + "\n", + "q=1.6*10**-19; # Electron charge\n", + "R=0.9;\n", + "d=0.1*10**-9;\n", + "alpha=0.0461;\n", + "L=100; # Spacing\n", + "Pi=-3; # Mean fiber launch power\n", + "#N=80; # Identical amplifers\n", + "fe=7*10**9; # Electrical filter bandwidth\n", + "q=6;\n", + "B=5*10**9;\n", + "\n", + "\n", + "# The transmission distance\n", + "l=fl*L;\n", + "G=10**(l/10.0);\n", + "f=c/lambdaa;\n", + "# r=N*n*h*f*(G-1);\n", + "Pi=10**(-(2/10.0));\n", + "N=Pi/(q**2*n*h*f*(G-1)*B);\n", + "Td=N*L;\n", + "Td=Td*10**-3;\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\n The transmission distance is = \",round(Td),\" km\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.6:pg-327" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Q factor= 8.017\n" + ] + } + ], + "source": [ + "# Example 7.6 \n", + "# Compuatation of the Q-factor.\n", + "\n", + "# Page no. 327\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "alpha=0.18; # Fiber loss coefficient\n", + "L=190; # Fiber length\n", + "G=20; # Gain of preamplifier\n", + "lambdaa=1.55*10**-6; # Operating wavelength\n", + "h=6.63*10**-34; # Planck constant\n", + "n=1.409; \n", + "G1=10**(G/10.0); \n", + "f0=20*10.0**9; \n", + "R=1.1; \n", + "q=1.6*10.0**-19;\n", + "fe=7.5*10.0**9;\n", + "Pi=1; # Input power\n", + "c=3*10.0**8; # Velocity of light\n", + "k=1.38*10**-23;\n", + "T=298;\n", + "Rl=200;\n", + "\n", + "# The Q factor\n", + "l=alpha*L;\n", + "Po=Pi-l+G;\n", + "Po=10**(Po/10.0)*10**-3;\n", + "f=c/lambdaa;\n", + "r=h*f*(G1-1)*n;\n", + "fn=2*n;\n", + "fn=10**(fn/10.0);\n", + "I1=R*Po+2*r*f0;\n", + "I0=2*R*r*f0;\n", + "o1=(2*q*I1*fe)+((4*k*T*fe)/Rl)+(2*R**2*r*(2*Po*fe+r*(2*f0-fe)*fe));\n", + "o2=(2*q*I0*fe)+((4*k*T*fe)/Rl)+(2*R**2*r**2*(2*f0-fe)*fe);\n", + "Q=(I1-I0)/(math.sqrt(o1)+math.sqrt(o2));\n", + "\n", + "#Displaying the result in command window\n", + "\n", + "print \"\\n Q factor= \",round(Q,3)\n", + "\n", + "# The answer vary due to round off error\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.7:pg-329" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The optimum amplifier configuration by choosing Amp2 as the first amplifier = 5.531 dB\n", + "\n", + " The optimum amplifier configuration by choosing Amp1 as the first amplifier = 7.076 dB\n" + ] + } + ], + "source": [ + "# Example 7.7 \n", + "# Compuatation of the optimum amplifier configuration\n", + "\n", + "# Page no. 329\n", + "\n", + "import math\n", + "#Given data\n", + "\n", + "G1=8.0; # Amplifier gain 1\n", + "G2=16.0; # Amplifier gain 2\n", + "fn1=7.0; # Noise figure of amplifier 1\n", + "fn2=5.5; # Noise figure of amplifier 2\n", + "H=7.0; # Insertion loss of the DCF\n", + "#N=80.0; # Identical amplifers\n", + "fe=7*10.0**9; # Electrical filter bandwidth\n", + "# q=6;\n", + "\n", + "\n", + "# The optimum amplifier configuration\n", + "\n", + "fn1=10**(fn1/10);\n", + "fn2=10**(fn2/10);\n", + "G2=10**(G2/10);\n", + "H=10**(H/10);\n", + "Fna=fn2+(fn1/(G2*H));\n", + "Fna=10*math.log10(Fna);\n", + "G=G2+G1+H;\n", + "Fnb=fn1+(fn2/(G1*H));\n", + "\n", + "Fnb=10*math.log10(Fnb);\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\n The optimum amplifier configuration by choosing Amp2 as the first amplifier = \",round(Fna,3),\" dB\"\n", + "print \"\\n The optimum amplifier configuration by choosing Amp1 as the first amplifier = \",round(Fnb,3),\" dB\"\n", + "\n", + "# The answer vary due to round off error\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.9:pg-331" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The length of the DCF = 13.03 km\n", + "\n", + " Gain G2 = 8.52 dB\n", + "\n", + " Q factor= 6.2\n" + ] + } + ], + "source": [ + "# Example 7.9 \n", + "# Compuatation of the (a) the length of the DCF (b) the gain G2 and (c) the Q-factor.\n", + "\n", + "# Page no. 331\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "b=-21*10.0**-27;\n", + "L=100.0*10**3;\n", + "Lt=100.0;\n", + "l=0.18; # Loss\n", + "l1=0.5; # Dispersion coefficients of the TF\n", + "G1=16.0; # Amplifier gain\n", + "p=-2; # Mean transmitter output power\n", + "fe=7*10.0**9;\n", + "c=3*10.0**8; # Velocity of light\n", + "h=6.62*10**-34; # Planck constant\n", + "fn1=5.5; # Noise figure of amplifier 1\n", + "fn2=7.5; # Noise figure of amplifier 2\n", + "lambdaa=1.55*10**-6;\n", + "bd=145.0*10**-27; # Dispersion coefficients of the DCF\n", + "\n", + "# (a) The length of the DCF\n", + "st=b*L;\n", + "sd=-0.9*st;\n", + "Ld=sd/bd;\n", + "Ld=Ld*10**-3;\n", + "# (b) Gain G2\n", + "Ht=l*Lt;\n", + "Hd=l1*Ld;\n", + "G2=Ht+Hd-G1;\n", + "\n", + "# (c) Q factor\n", + "Ge=G1+G2+-Hd;\n", + "Ge=10**(Ge/10);\n", + "fn1=10**(fn1/10);\n", + "fn2=10**(fn2/10);\n", + "G1=10**(G1/10);\n", + "Hd=10**(-Hd/10);\n", + "Fe=fn1+(fn2/(G1*Hd))-(1/G1);\n", + "f=c/lambdaa;\n", + "r=70*h*f*(((Ge*Fe)-1)/2.0);\n", + "Pi=2*10**(p/10.0)*10**-3;\n", + "Q=math.sqrt(Pi/(4*r*fe));\n", + "\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\n The length of the DCF = \",round(Ld,2),\" km\"\n", + "print \"\\n Gain G2 = \",round(G2,2),\" dB\"\n", + "print \"\\n Q factor= \",round(Q,1)\n", + "\n", + "# The answer vary due to round off error\n", + "\n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter8_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter8_1.ipynb new file mode 100644 index 00000000..0887960e --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter8_1.ipynb @@ -0,0 +1,232 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 08:Performance Analysis" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.1:pg-354" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " For a balanced homodyne receiver with PSK signal = 4.91 X 10**-9 \n", + "\n", + " For a balanced homodyne receiver with PSK signal If the signal is OOK, = 2.07 X 10**-3\n", + "\n", + " For a balanced heterodyne receiver with PSK signal = 4.952 X 10**-9\n", + "\n", + " For a balanced heterodyne receiver with PSK signal If the signal is OOK,= 2.08 X 10**-3\n" + ] + } + ], + "source": [ + "# Example 8.1 \n", + "# Compuatation of error probability if the receiver is (a) a balanced homodyne or (b) a balanced heterodyne\n", + "# Page no. 354\n", + "\n", + "import math\n", + "\n", + "# Given data\n", + "Po=5.0; # Lunch peak power\n", + "fl=50.0; # Fiber loss\n", + "G=30.0; # Preamplifier Gain \n", + "f=10*10.0**9;\n", + "n=1.5;\n", + "h=6.63*10**-34; # Planck constant\n", + "c=3*10**8.0; # Velocity of light\n", + "lambdaa=1550.0*10**-9;\n", + "q=1.6*10**-19; # Electron charge\n", + "R=0.9;\n", + "\n", + "# Signal calculation\n", + "Pr=Po-fl+G;\n", + "Pr=10**(Pr/10)*10**-3;\n", + "\n", + "Tb=1/(f);\n", + "E=Pr*Tb;\n", + "f1=c/lambdaa;\n", + "G=10**(G/10);\n", + "r=n*h*f1*(G-1);\n", + "#rs=q*I;\n", + "N=r+(q/(2*R));\n", + "Nh=r/2+(q/(2*R));\n", + "\n", + "# Error probability\n", + "# (a) For a balanced homodyne receiver with PSK signal\n", + "Ps=1/2.0*math.erfc(math.sqrt(E/N));\n", + "E1=E/2;\n", + "# If the signal is OOK\n", + "Pso=1/2.0*math.erfc(math.sqrt(E1/(2*N)));\n", + "\n", + "#(b) For a balanced heterodyne receiver with PSK signal\n", + "Pb=1/2.0*math.erfc(math.sqrt(E/(2*Nh)));\n", + "#E1=E/2;\n", + "# If the signal is OOK\n", + "Pbo=1/2.0*math.erfc(math.sqrt(E1/(4*Nh)));\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\n For a balanced homodyne receiver with PSK signal = \",round(Ps*10**9,2),\" X 10**-9 \"\n", + "\n", + "print \"\\n For a balanced homodyne receiver with PSK signal If the signal is OOK, = \",round(Pso*10**3,2),\" X 10**-3\"\n", + "print \"\\n For a balanced heterodyne receiver with PSK signal = \",round(Pb*10**9,3),\" X 10**-9\"\n", + "print \"\\n For a balanced heterodyne receiver with PSK signal If the signal is OOK,= \",round(Pbo*10**3,2),\" X 10**-3\"\n", + "\n", + "# The answer vary due to round off error\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.3:pg-394" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The maximum transmission distance = 37050.07 km\n" + ] + } + ], + "source": [ + "# Example 8.3\n", + "# Calculation of the maximum transmission distance.\n", + "# Page no 394\n", + "\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "p=3.0; # Peak power\n", + "tb=40.0*10**9; # Bit rate\n", + "c=3.0*10**8; # Velocity of light\n", + "lambdaa=1550.0*10**-9; # Operating frequency\n", + "l=0.2; # Loss\n", + "d=80; # Distance\n", + "G=16 # Gain\n", + "h=6.626*10**-34 # Planck constant\n", + "n=1.0;\n", + "pb=10.0**-5; # Error probability\n", + "l1=80*10**3; # N spans\n", + "\n", + "\n", + "# The maximum transmission distance\n", + "\n", + "p=p+10*math.log10(1/2.0);\n", + "p=10**(p/10.0)*10**-3;\n", + "t=1/(tb);\n", + "E=p*t;\n", + "f=c/lambdaa;\n", + "fl=l*d;\n", + "G=10**(G/10.0);\n", + "r=n*h*f*(G-1); # Calculation is wrong in book.\n", + "#pb=1/2*(exp(-(E/r)));\n", + "N=-(E/(math.log(2*pb)*r));\n", + "\n", + "L=N*l1;\n", + "\n", + "# Displaying results in the command window \n", + "print \"\\n The maximum transmission distance = \",round(L*10**-3,2),\" km\"\n", + "\n", + "# In the book PSD per amplifier calcualation is wrong, therefore final answer is wrong.\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.6:pg-384" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " For a balanced homodyne receiver with PSK signal = 18.0\n", + "\n", + " For a balanced heterodyne receiver with PSK signal = 36.0\n" + ] + } + ], + "source": [ + "# Example 8.6\n", + "# To find the mean number of signal photons required in a shot noise-limited coherent communication system based on OOK for the following cases: (i) balanced homodyne receiver; (ii)balanced heterodyne receiver (a) a balanced homodyne or (b) a balanced heterodyne\n", + "# Page no. 384\n", + "\n", + "import math\n", + "from scipy.special import erfinv\n", + "\n", + "# Given data\n", + "Pb=1*10**-9; #Error probability\n", + "neta=1; #quantum efficiency\n", + "\n", + "#a)for balanced homodyne receiver\n", + "Ns=(erfinv(1-(2*neta*Pb)))**2;\n", + "\n", + "#(b)for balanced heterodyne receiver\n", + "Ns1=(erfinv(1-(2*neta*Pb))*math.sqrt(2))**2;\n", + "\n", + "#Displaying the result in command window\n", + "print \"\\n For a balanced homodyne receiver with PSK signal =\",round(Ns)\n", + "print \"\\n For a balanced heterodyne receiver with PSK signal = \",round(Ns1)\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter9_1.ipynb b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter9_1.ipynb new file mode 100644 index 00000000..134f0002 --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/Chapter9_1.ipynb @@ -0,0 +1,539 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 09:Channel Multiplexing Techniques" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.1:pg-392" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Channel spacing = 10.0 GHz \n", + "\n", + " Total bandwidth of the WDM signal = 120.0 GHz \n", + "\n", + " Total data rate = 720.0 Gb/s \n" + ] + } + ], + "source": [ + "# Example 9.1\n", + "# Calculation of the (a) the channel spacing, (b) the signal bandwidth in a channel and cther total bandwidth of the WDM signal, and (c) the total data rate.\n", + "# Page no 392\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "Bs=10*10**12; # Symbol rate\n", + "n=6; # Spectral efficiency\n", + "Fs=10*10**12; # Symbol rate\n", + "N=12; # No of channels\n", + "\n", + "\n", + "\n", + "# (a) Channel spacing\n", + "B=Bs*math.log(64,2);\n", + "f=B/n;\n", + "\n", + "# (b) Total bandwidth of the WDM signal\n", + "T1=(N-1)*f+(2*Fs)/2; \n", + "T1=T1*10**-12;\n", + "# (c) Total data rate\n", + "T2=N*B;\n", + "T2=T2*10**-12;\n", + "\n", + "# Displaying results in the command window \n", + "print \"\\n Channel spacing = \",round(f*10**-12),\" GHz \"\n", + "\n", + "print \"\\n Total bandwidth of the WDM signal = \",T1,\" GHz \"\n", + "print \"\\n Total data rate = \",T2,\" Gb/s \"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.2:pg-393" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The total power at the fiber output = 0.414 dBm \n" + ] + } + ], + "source": [ + "# Example 9.2\n", + "# Calculation of the total power at the fiber output.\n", + "# Page no 393\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "p=0; # Power per channel\n", + "fl=0.2; # Fiber loss\n", + "f=50; # Wavelength\n", + "\n", + "\n", + "# The total power at the fiber output.\n", + "pc=10**(0.1*p);\n", + "tp=pc*11;\n", + "tp1=10*math.log10(tp);\n", + "tfl=fl*f;\n", + "to=tp1-tfl;\n", + "\n", + "\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The total power at the fiber output = \",round(to,3),\" dBm \"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.3:pg-400" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The lengths of the adjacent waveguides = 107.04 micrometer \n", + "\n", + " The lengths of the adjacent waveguides = 117.74 micrometer\n", + "\n", + " Phase shift phi1 = 6.28 x 10**2 rad \n", + "\n", + " Phase shift phi2 = 6.91 x 10**2 rad\n" + ] + } + ], + "source": [ + "# Example 9.3\n", + "# Calculation of a) The lengths of the adjacent waveguides and b) phase shift phi1 and phi2.\n", + "# Page no 400\n", + "\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "\n", + "p=0; # Power per channel\n", + "fl=0.2; # Fiber loss\n", + "m1=100; # Wavelength\n", + "m2=110;\n", + "lambdaa1=1550*10**-9;\n", + "lambdaa2=1550.8*10**-9;\n", + "c=3*10**8; # Velocity of light\n", + "b0=5.87*10**6;\n", + "b1=4.86*10**-9;\n", + "\n", + "# a) The lengths of the adjacent waveguides\n", + "l1=(2*math.pi*m1)/b0;\n", + "l2=(2*math.pi*m2)/b0;\n", + "\n", + "\n", + "# b) Phase shift phi1 and phi2.\n", + "dfdl=-(c/lambdaa1**2);\n", + "dbdl=2*math.pi*b1*dfdl;\n", + "phi1=2*math.pi*m1+(lambdaa2-lambdaa1)*l1*dbdl;\n", + "phi2=2*math.pi*m2+(lambdaa2-lambdaa1)*l2*dbdl;\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The lengths of the adjacent waveguides = \",round(l1*10**6,2),\" micrometer \"\n", + "print \"\\n The lengths of the adjacent waveguides = \",round(l2*10**6,2),\" micrometer\"\n", + "print \"\\n Phase shift phi1 = \",round(phi1*10**-2,2),\" x 10**2 rad \"\n", + "print \"\\n Phase shift phi2 = \",round(phi2*10**-2,2),\" x 10**2 rad\"\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.4:pg-408" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The maximum reach up to which the carrier orthogonality is preserved = 926.0 km \n" + ] + } + ], + "source": [ + "# Example 9.4\n", + "# Calculation of the maximum reach up to which the carrier orthogonality is preserved.\n", + "# Page no 408\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "b=22*10**-27; # Power launched in port 1\n", + "T=1.28*10**-9; # Guard interval\n", + "N=128; # Subcarriers\n", + "f=78.125*10**6; # Frequency spacing between subcarriers\n", + "\n", + "# Bit rate of communication system\n", + "I=T/(b*2*math.pi*N*f);\n", + "I=I*10**-3;\n", + "\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The maximum reach up to which the carrier orthogonality is preserved = \",round(I),\" km \"\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.5:pg-410" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The maximum reach up to which the carrier orthogonality is preserved = 6.0 mm \n" + ] + } + ], + "source": [ + "# Example 9.5\n", + "# Calculation of the maximum reach up to which the carrier orthogonality is preserved.\n", + "# Page no 410\n", + "\n", + "import math\n", + "\n", + "\n", + "#Given data\n", + "d=30*10**-12; # Delay\n", + "b=0.5*10**-8; \n", + "\n", + "# The maximum reach up to which the carrier orthogonality is preserved\n", + "L=d/b;\n", + "L=L*10**3;\n", + "\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The maximum reach up to which the carrier orthogonality is preserved = \",round(L,3),\" mm \"\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.6:pg-411" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Bit interval for 10 Gb/s signal is = 100.0 ps \n", + "\n", + " Bit interval for 40 Gb/s signal is = 25.0 ps \n" + ] + } + ], + "source": [ + "# Example 9.6\n", + "# Calculation of the ODTM to multiplex data.\n", + "# Page no 411\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "f1=10*10**9;\n", + "f2=40*10**9;\n", + "\n", + "\n", + "# The ODTM to multiplex data\n", + "b1=1.0/(f1);\n", + "b2=1.0/(f2);\n", + "b1=b1*10**12;\n", + "b2=b2*10**12;\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n Bit interval for 10 Gb/s signal is =\",round(b1),\" ps \"\n", + "print \"\\n Bit interval for 40 Gb/s signal is = \",round(b2),\"ps \"\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.7:pg-413" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The total data rate = 5.376 Tb/s \n", + "\n", + " The spectral efficiency = 8.0 b/s/Hz \n" + ] + } + ], + "source": [ + "# Example 9.7\n", + "# Calculation of the (a) the total data rate and (b) the spectral efficiency.\n", + "# Page no 413\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "M=16;\n", + "np=2; # No of polarization\n", + "nc=24; # No of channels\n", + "bs=28*10**9; # Symbol rate per polarization\n", + "\n", + "# (a) The total data rate\n", + "B=bs*math.log(M,2);\n", + "T=B*np*nc;\n", + "\n", + "\n", + "# (b) The spectral efficiency\n", + "N=bs*nc;\n", + "s=T/N;\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The total data rate = \",round(T*10**-12,3),\" Tb/s \"\n", + "\n", + "print \"\\n The spectral efficiency = \",round(s,1),\" b/s/Hz \"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.8:pg-413" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The number of subcarriers required to transmit information = 247.0 \n" + ] + } + ], + "source": [ + "# Example 9.8\n", + "# Calculation of the number of subcarriers required to transmit information.\n", + "# Page no 413\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "M=4;\n", + "np=2; # No of polarization\n", + "nc=24; # No of channels\n", + "bs=10*10**9; # Symbol rate per polarization\n", + "d=5000*10**3; # Transmission distance\n", + "b=22*10**-27;\n", + "ts= 49.3*10**-9;\n", + "\n", + "# The total data rate\n", + "B=bs*math.log(M,2);\n", + "T=d*b*math.pi*bs;\n", + "#L=T/(b*2*math.pi*N*bs);\n", + "N=(bs*ts)/2;\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The number of subcarriers required to transmit information = \",round(N),\" \"\n", + "\n", + "# The answers vary due to round off error\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.9:pg-414" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The signal power/subcarrier/polarization at the fiber output = 5.791 x 10**-4 mW \n", + "\n", + " The data rate = 60.0 Gb/s \n", + "\n", + " The spectral efficiency = 12.0 b/s/Hz \n" + ] + } + ], + "source": [ + "# Example 9.9\n", + "# Calculation of the (a) the signal power/subcarrier/polarization at the fiber output, (b) the data rate and (c) the spectral efficiency\n", + "# Page no 414\n", + "\n", + "import math\n", + "\n", + "#Given data\n", + "fl=0.19; # Fiber loss\n", + "fg=70; # Fiber length\n", + "nc=24; # No of channels\n", + "ip=2;\n", + "bs=10*10**9; # Symbol rate per polarization\n", + "ts= 12.8*10**-9; # Symbol period\n", + "n=64; # No of subcarriers\n", + "np=2; # Launch power to the fiber\n", + "\n", + "\n", + "# (a) The signal power/subcarrier/polarization at the fiber output\n", + "T=fl*fg;\n", + "p=ip-T;\n", + "p1=10**(p/10);\n", + "s=p1/(np*n);\n", + "#s=s*10**4;\n", + "\n", + "# (b) The data rate\n", + "bs=1/ts;\n", + "B=math.log(n,2)*bs;\n", + "bt=B*2*n;\n", + "\n", + "# (c) the spectral efficiency\n", + "Tb=n*bs;\n", + "se=bt/Tb;\n", + "\n", + "\n", + "\n", + "\n", + "#Displaying results in the command window \n", + "print \"\\n The signal power/subcarrier/polarization at the fiber output = \",round(s*10**4,3),\" x 10**-4 mW \"\n", + "\n", + "print \"\\n The data rate = \",bt*10**-9,\"Gb/s \"\n", + "\n", + "print \"\\n The spectral efficiency = \",se,\" b/s/Hz \"\n", + "\n", + "# The answers vary due to round off error\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/screenshots/2.3_1.png b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/screenshots/2.3_1.png Binary files differnew file mode 100644 index 00000000..53df84ed --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/screenshots/2.3_1.png diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/screenshots/6.5_1.png b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/screenshots/6.5_1.png Binary files differnew file mode 100644 index 00000000..5a670d8f --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/screenshots/6.5_1.png diff --git a/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/screenshots/8.3_1.png b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/screenshots/8.3_1.png Binary files differnew file mode 100644 index 00000000..3731f7a6 --- /dev/null +++ b/Fiber_Optic_Communications:_Fundamentals_and_Applications_by_S._Kumar_and_M._J._Deen/screenshots/8.3_1.png |