summaryrefslogtreecommitdiff
path: root/Optical_Communication_by_Anasuya_Kalavar/chapter8.ipynb
blob: 11017e305dde90fa9994ae2869c7d03eceef591b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
{
 "metadata": {
  "name": "",
  "signature": "sha256:3deb63e976713f6e36585549e6b144389b0fc28fe2982a2838d929f3804cde18"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "chapter8 - Optical receiver operation"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2.1, page 8-6"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from numpy import log, sqrt, pi, log10\n",
      "P=10**-9     #probability of error\n",
      "eta=1       #ideal detector\n",
      "h=6.626*10**-34 #plank's constant\n",
      "c=3*10**8      #speed of light\n",
      "lamda=1*10**-6  #wavelength\n",
      "B=10**7      #bit rate\n",
      "Mn = -log(P) \n",
      "print \"The quantum limit at the receiver to maintain bit error rate 10**-9 is (%.1f*h*f)/eta.\" %Mn\n",
      "f=c/lamda\n",
      "Popt= 0.5*Mn*h*f*B/eta      #computing optical power\n",
      "Popt_dB = 10 * log10(Popt) + 30     #optical power in dbm\n",
      "Popt=Popt*10**12 \n",
      "print \"Minimum incident optical power is %.1f W or %.1f dBm.\" %(Popt,Popt_dB) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The quantum limit at the receiver to maintain bit error rate 10**-9 is (20.7*h*f)/eta.\n",
        "Minimum incident optical power is 20.6 W or -76.9 dBm.\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2.2, page 8-8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "SN_dB=60     #signal to noise ratio\n",
      "h=6.626*10**-34 #plank's constant\n",
      "c=3*10**8      #speed of light\n",
      "lamda=1.3*10**-6  #wavelength\n",
      "eta=1 \n",
      "B=6.5*10**6      #Bandwidth\n",
      "SN=10**(SN_dB/10) \n",
      "f=c/lamda\n",
      "Popt= 2*SN*h*f*B/eta      #computing optical power\n",
      "Popt_dB = 10 * log10(Popt) + 30     #optical power in dbm\n",
      "Popt=Popt*10**6 \n",
      "print \"Incident power required to get an SNR of 60 dB at the receiver is %.4f microWatt or %.3f dBm\" %(Popt,Popt_dB)\n",
      "#Calculation error in the book.They have take SN as 10**5 while calculating, which has lead to an error in final answer\n",
      "#answer in the book 198.1nW and -37.71 dBm"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Incident power required to get an SNR of 60 dB at the receiver is 1.9878 microWatt or -27.016 dBm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3.1, page 8-11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "lamda=0.85*10**-6 \n",
      "h=6.626*10**-34     #plank's constant\n",
      "c=3*10**8       #speed of light\n",
      "q=1.6*10**-19   #charge of electron\n",
      "eta=65/100  #quantum efficiency\n",
      "P0=300*10**-9   #optical power\n",
      "Id=3.5     #dark current\n",
      "B=6.5*10**6      #bandwidth\n",
      "K=1.39*10**-23  #Boltzman constant\n",
      "T=293       #temperature\n",
      "R=5*10**3      #load resister\n",
      "Ip= 10**9*eta*P0*q*lamda/(h*c) \n",
      "Its=10**9*(2*q*B*(Ip+Id)) \n",
      "Its=sqrt(Its) \n",
      "print \"rms shot noise current is %.2f nA.\" %(Its) \n",
      "It= 4*K*T*B/R \n",
      "It=sqrt(It) \n",
      "It=It*10**9 \n",
      "print \"Thermal noise is %.2f nA.\" %(It) \n",
      "#answer given in book for Thermal noise is wrong."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "rms shot noise current is 0.53 nA.\n",
        "Thermal noise is 4.60 nA.\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3.2, page 8-12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "lamda=0.85*10**-6 \n",
      "h=6.626*10**-34     #plank's constant\n",
      "c=3*10**8       #speed of light\n",
      "q=1.6*10**-19   #charge of electron\n",
      "eta=65/100  #quantum efficiency\n",
      "P0=300*10**-9   #optical power\n",
      "Id=3.5     #dark current\n",
      "B=6.5*10**6      #bandwidth\n",
      "K=1.39*10**-23  #Boltzman constant\n",
      "T=293       #temperature\n",
      "R=5*10**3      #load resister\n",
      "F_dB=3      #noise figure\n",
      "F=10**(F_dB/10) \n",
      "Ip=10**9*eta*P0*q*lamda/(h*c) \n",
      "Its=10**9*(2*q*B*(Ip+Id)) \n",
      "It1= 4*K*T*B*F/R \n",
      "SN= Ip**2/(Its+It1) \n",
      "SN_dB=10*log10(SN) \n",
      "SN=SN\n",
      "print \"SNR is %.2e or %.2f dB.\" %(SN,SN_dB) \n",
      "#answer given in the book is wrong."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "SNR is 6.25e+04 or 47.96 dB.\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4.1, page 8-14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "Cd=7*10**-12 \n",
      "B=9*10**6 \n",
      "Ca=7*10**-12 \n",
      "R=(2*3.14*Cd*B)**-1 \n",
      "B1=(2*3.14*R*(Cd+Ca))**-1 \n",
      "R=R/1000 \n",
      "B1=B1/10**6 \n",
      "print \"\"\"Thus for 9MHz bandwidth maximum load resistance is %.2f Kohm\n",
      "Now if we consider input capacitance of following amplifier Ca then Bandwidth is %.2fMHz\n",
      "Maximum post detection bandwidth is half.\"\"\"%(R,B1) \n",
      "#answer for resistance in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Thus for 9MHz bandwidth maximum load resistance is 2.53 Kohm\n",
        "Now if we consider input capacitance of following amplifier Ca then Bandwidth is 4.50MHz\n",
        "Maximum post detection bandwidth is half.\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Question 7, page 8.44"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "w=25*10**-6     #width\n",
      "v=3*10**4       #velocity\n",
      "t=w/v       #computing drift time\n",
      "BW=(2*pi*t)**-1         #computing bandwidth\n",
      "rt=1/BW     #response time\n",
      "rt=rt*10**9 \n",
      "print \"Maximum response time is %.2f ns.\" %(rt) \n",
      "#Answer in the book is wrong."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum response time is 5.24 ns.\n"
       ]
      }
     ],
     "prompt_number": 16
    }
   ],
   "metadata": {}
  }
 ]
}