summaryrefslogtreecommitdiff
path: root/Electronic_Communication_by_D._Roddy/Chapter4_Noise_1.ipynb
blob: 748bcbf773b42287f86e535727690c5751b4b186 (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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 4 Noise"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.2.1,Pg.no 120"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of thermal noise power is 4.002e-15 W\n",
      "The value of RMS noise voltage is 0.89 uV\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt\n",
    "T=290.0\n",
    "BW=1*10**6          #Noise bandwidth in hertz\n",
    "k=1.38*10**-23      #Boltzman constant in J/K\n",
    "R=50.0              #Determination of thermal noise power Pn\n",
    "Pn=k*T*BW\n",
    "#Pn=round(Pn,1)\n",
    "print 'The value of thermal noise power is',Pn,'W'\n",
    "#Determination of RMS noise voltage\n",
    "En=sqrt(4*R*k*T*BW)\n",
    "En=En*(10**6)\n",
    "En=round(En,2)\n",
    "print 'The value of RMS noise voltage is',En,'uV'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.2.2,Pg.no.122"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a) i )The value of RMS noise voltage is 5.66 uV\n",
      "   ii)The value of RMS noise voltage is 8949245.77828 uV\n",
      "b)The value of RMS noise voltage is 10588890.4 uV\n",
      "c)The value of RMS noise voltage is 4783573.08 uV\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt\n",
    "R1=20000.0\n",
    "R2=50000.0\n",
    "k=1.38*10**-23              #Boltzman constant in J/K\n",
    "T=290.0\n",
    "BW=100*10**3       #Determination of thermal noise voltage for 20Kohm resistor\n",
    "En1=sqrt(4*R1*k*T*BW)\n",
    "En1=En1*(10**6)\n",
    "En1=round(En1,2)\n",
    "print 'a) i )The value of RMS noise voltage is',En1,'uV'\n",
    "#Determination of thermal noise voltage for 50 kohm resistor\n",
    "En2=En1*sqrt(R2/R1)\n",
    "En2=En2*10**6\n",
    "print '   ii)The value of RMS noise voltage is',En2,'uV'\n",
    "#Determination of thermal noise voltage for 20K & 50k resistor in series\n",
    "Rser=R1+R2           #Series combination of R1 & R2\n",
    "En3=En1*sqrt(Rser/R1)\n",
    "En3=En3*10**6\n",
    "En3=round(En3,2)\n",
    "print 'b)The value of RMS noise voltage is',En3,'uV'\n",
    "#Determination of thermal noise voltage for 20K & 50k resistor in parellel\n",
    "Rpar=(R1*R2)/(R1+R2)         #parallel combination of R1 & R2\n",
    "En4=En1*sqrt(Rpar/R1)\n",
    "En4=En4*10**6\n",
    "En4=round(En4,2)\n",
    "print 'c)The value of RMS noise voltage is',En4,'uV'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.2.3,Pg.no.128"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of Rd is 1.59 kohm\n",
      "The value of effective noise voltage is 0.02 uV\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt,pi\n",
    "f=120*10**6\n",
    "c=25*10**-12         #capacitance of 12 pF\n",
    "Q=30.0               #Q−factor of the ckt is 30\n",
    "BW=10*10**3          #channel BW of the receiver is 10 KHz\n",
    "k=1.38*10**-23       #Boltzman constant in J/K\n",
    "T=290.0              #Room temp\n",
    "#Determination of effective noise voltage Rd appearing at i /p at room temp\n",
    "Rd=Q/(2*pi*f*c)\n",
    "Rd=Rd/1000\n",
    "Rd=round(Rd,2)\n",
    "print 'The value of Rd is',Rd,'kohm'\n",
    "Vn=sqrt(4*Rd*k*T*BW)\n",
    "Vn=Vn*10**6\n",
    "Vn=round(Vn,2)\n",
    "print 'The value of effective noise voltage is',Vn,'uV'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.3.1,Pg.no.131"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of noise current In is 17.89 nA\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt\n",
    "Idc=10**-3\n",
    "Bn=10**6           #Effective noise BW=1 MHz\n",
    "q=1.6*10**-19      #Charge on electron in coulombs\n",
    "#Determination of noise component current In in DC current of Idc=1 mA\n",
    "In=sqrt(2*Idc*q*Bn)\n",
    "In=In*10**9\n",
    "In=round(In,2)\n",
    "print 'The value of noise current In is',In,'nA'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.11.1,Pg.no.135"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of shot noise current Ina is 4.0 nA\n",
      "The value of noise voltage across Rs is 600000000.0 uV\n",
      "The value of noise voltage across Rn is 6.93 uV\n",
      "The value of thermal noise voltage at Rs is 4.9 uV\n",
      "The value of total noise voltage Vn is 1000000.0 uV\n",
      "The value of signal to noise ratio is -220.0 dB\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from math import pi,sqrt\n",
    "#An amplifier is given\n",
    "Rn=300.0        #Equivalent noise resistance\n",
    "Ieq=5*10**-6    #Equivalent noise current is 5 uA\n",
    "Rs=150.0        #Amplifier fed from 150 ohm,10 uV rms sinusoidal source\n",
    "Vs=10*10**-6\n",
    "Bn=10*10**6     #Noise BW is 10 MHz\n",
    "#Assume the following\n",
    "kT=4*10**-21    #k is Boltzman constant in J/K & T is room temp\n",
    "q=1.6*10**-19   #Charge on electron in coloumbs\n",
    "#Determination of shot noise current\n",
    "Ina=sqrt(2*q*Ieq*Bn)\n",
    "Ina=Ina*(10**9)\n",
    "print 'The value of shot noise current Ina is',Ina,'nA'\n",
    "#Noise voltage developed by this across source resistance is\n",
    "V=Ina*Rs\n",
    "V=V*(10**6)\n",
    "V=round(V,2)\n",
    "print 'The value of noise voltage across Rs is',V,'uV'\n",
    "#Noise voltage developed across Rn resistance is\n",
    "Vna=sqrt(4*Rn*kT*Bn)*10**6\n",
    "Vna=round(Vna,2)\n",
    "print 'The value of noise voltage across Rn is',Vna,'uV'\n",
    "#Determination of thermal noise voltage from source\n",
    "Vns=sqrt(4*Rs*kT*Bn)*10**6\n",
    "Vns=round(Vns,2)\n",
    "print 'The value of thermal noise voltage at Rs is',Vns,'uV'\n",
    "#Determination of total noise voltage at input\n",
    "Vn=(((V)**2)+((Vna)**2)+((Vns)**2))**(1/2)\n",
    "Vn=Vn*(10**6)\n",
    "print 'The value of total noise voltage Vn is',Vn,'uV'\n",
    "#Determination of signal to noise ratio in dB\n",
    "SNR=20*(math.log10(Vs/Vn))\n",
    "print 'The value of signal to noise ratio is',SNR,'dB'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.12.1,Pg.no.136"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of output signal to noise ratio is 55.23 dB\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "SNR1=60.0\n",
    "l=3.0           #Determination of output signal to noise ratio\n",
    "SNR=(SNR1) -10*math.log10(l)\n",
    "SNR=round(SNR,2)\n",
    "print 'The value of output signal to noise ratio is',SNR,'dB'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.12.2,Pg.no.137"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of output signal to noise ratio is 40.0 dB\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "SNRdB1=60.0      #SNR is 60 dB for Ist link\n",
    "SNRdB2=60.0      #SNR is 60 dB for IInd link\n",
    "SNRdB3=40.0      #SNR is 40 dB for IIIrd link\n",
    "#Determination of power in watt\n",
    "snr1=10**(-SNRdB1/10)\n",
    "snr2=10**(-SNRdB2/10)\n",
    "snr3=10**(-SNRdB3/10)\n",
    "#Determination of overall SNR\n",
    "SNR=snr3\n",
    "#Determination of total SNR in dB\n",
    "SNRdB=10*(-math.log10(SNR))\n",
    "print 'The value of output signal to noise ratio is',SNRdB,'dB'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.13.1,Pg.no.139"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of output signal to noise ratio is 28.0 dB\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "SNRin=35.0 #SNR at i /p of amplifier\n",
    "F=7.0      #Noise figure of an amplifier\n",
    "#Determination of output SNR\n",
    "SNRout=SNRin-F\n",
    "print 'The value of output signal to noise ratio is',SNRout,'dB'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.14.1,Pg.no.140"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of input noise is 0.08 pW\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "f=13.0  #Noise figure of an amplifier\n",
    "Bn=1*10**6\n",
    "kT=4*10**-21   #k is Boltzman constant in J/K & T is room temp\n",
    "F=10**(f/10)\n",
    "#Determination of equivalent amplifier input noise\n",
    "Pna=(F-1)*kT*Bn*10**12\n",
    "Pna=round(Pna,2)\n",
    "print 'The value of input noise is',Pna,'pW'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.15.1,Pg.no.141"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The overall noise fig is 10.44 dB\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "f1=9.0     #Noise fig for amplifier\n",
    "f2=20.0    #Noise fig for mixer\n",
    "g=15.0     #power gain\n",
    "#Converting dB in power ratio\n",
    "F1=10**(f1/10)\n",
    "F2=10**(f2/10)\n",
    "G=10**(g/10)\n",
    "#Determination of overall noise fig . reffered at i / p\n",
    "F=F1+(F2-1)/G  #converting in dB\n",
    "FdB=10*math.log10(F)\n",
    "FdB=round(FdB,2)\n",
    "print 'The overall noise fig is',FdB,'dB'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.17.1,Pg.no.143"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of noise factor is 1\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "F=6.0      #Noise fig .=6 dB\n",
    "#Determination of noise factor\n",
    "Fn=10**(6/10)\n",
    "print 'The value of noise factor is',Fn"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.18.1,Pg.no.144"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of equivalent noise at room temp is 4306.19 k\n",
      "The value of equivalent noise at noise temp=90 is 90.04 K\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "f=12.0 \n",
    "Tm=290.0    #Room temp value\n",
    "T=90.0\n",
    "g=50.0      #calculating power ratio\n",
    "F=10**(f/10)\n",
    "G=10**(g/10)\n",
    "#Determination of equivalent noise at room temp\n",
    "Tem=(F-1)*Tm\n",
    "Tem=round(Tem,2)\n",
    "print 'The value of equivalent noise at room temp is',Tem,'k'\n",
    "#Determination of equivalent noise at 90 k temp\n",
    "Te=T+(Tem/G)\n",
    "Te=round(Te,2)\n",
    "print 'The value of equivalent noise at noise temp=90 is',Te,'K'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4.19.1,Pg.no.146"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of hot temp Th is 7574.47 k\n",
      "The value of equivalent noise temp Te is 759.14 K\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "enr=14.0\n",
    "To=290.0          #Room temp in K\n",
    "y=9.0             #Y−factor is 9 dB\n",
    "#converting dB in power ratio\n",
    "ENR=10**(enr/10)\n",
    "Y=10**(y/10)      #From def of ENR the hot temp is\n",
    "Th=To*(ENR+1)\n",
    "Th=round(Th,2)\n",
    "print 'The value of hot temp Th is',Th,'k'\n",
    "#Determination of equivalent noise temp\n",
    "Te=(Th-(Y*To))/(Y-1)\n",
    "Te=round(Te,2)\n",
    "print 'The value of equivalent noise temp Te is',Te,'K'"
   ]
  }
 ],
 "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.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}