summaryrefslogtreecommitdiff
path: root/Electronic_Communication_Systems_by_Roy_Blake/Chapter4.ipynb
blob: 8b4034556787fa59d8f57d6cfc1cecfe5a85f320 (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 4 : Angle Modulation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1 : pg 139"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a)The value of o/p freq is  175.0045 MHz\n",
      "b)The value of o/p freq is  174.94 MHz\n"
     ]
    }
   ],
   "source": [
    "#page no 139\n",
    "#prob no. 4.1\n",
    "#Calculate the o/p frequency\n",
    "#An FM modulator is given with kf=30kHz/V operate at carrier freq 175MHz\n",
    "#given\n",
    "fc=175.*10**6;kf=30.*10**3;\n",
    "#a)Determination of o/p freq for modulating signal value em1=150mV \n",
    "em1=150*10**-3;\n",
    "#calculations and results\n",
    "fsig1=fc+(kf*em1);\n",
    "print 'a)The value of o/p freq is ',fsig1/(10**6),'MHz'\n",
    "#b)Determination of o/p freq for modulating signal value em2=-2V \n",
    "em2=-2;\n",
    "fsig2=fc+(kf*em2);\n",
    "print 'b)The value of o/p freq is ',fsig2/(10**6),'MHz'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2 : pg 140"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of deviation is  127.279 kHz\n"
     ]
    }
   ],
   "source": [
    "#page no 140\n",
    "#prob no. 4.2\n",
    "#calculate the value of deviation\n",
    "from math import sqrt\n",
    "#An FM modulator is given which is modulated by sine wave 3V\n",
    "#given\n",
    "v=3.;\n",
    "kf=30.*10**3;\n",
    "#calculations\n",
    "#Determination of peak value \n",
    "Em=v*sqrt(2);\n",
    "#Determination of deviation delta\n",
    "delta=kf*Em;\n",
    "#results\n",
    "print 'The value of deviation is ',round(delta/1000.,3),'kHz'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3 : pg 140"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a)The value of modulation index for fm=15kHz is  5.0\n",
      "b)The value of modulation index for fm=50Hz is  1500.0\n"
     ]
    }
   ],
   "source": [
    "#page no 140\n",
    "#prob no. 4.3\n",
    "#calculate the value of modulation index in both cases\n",
    "#An FM broadcaster transmitter operate at max deviatn of 75kHz\n",
    "#given\n",
    "delta=75.*10**3;\n",
    "#a)Determination of modulation index with modulating freq of signal =15kHz\n",
    "fm1=15.*10**3;\n",
    "#calculations and results\n",
    "mf1=delta/fm1;\n",
    "print 'a)The value of modulation index for fm=15kHz is ',mf1\n",
    "#b)Determination of modulation index with modulating freq of signal =50Hz\n",
    "fm2=50;\n",
    "mf2=delta/fm2;\n",
    "print 'b)The value of modulation index for fm=50Hz is ',mf2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4 : pg 141"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The rms voltage that cause deviation is  0.37 V\n"
     ]
    }
   ],
   "source": [
    " \n",
    "#page no 141\n",
    "#prob no. 4.4\n",
    "from math import pi, sqrt\n",
    "#calculate the rms voltage\n",
    "#A phase modulator is given with kp=2rad/V \n",
    "#given\n",
    "kp=2;\n",
    "#Peak phase deviation of 60 degree\n",
    "#calculations\n",
    "#Converting degree in radian \n",
    "phi=(2*pi*60)/360;\n",
    "#Determination of peak voltage that cause that deviation \n",
    "Vp=phi/kp;\n",
    "#Determination of rms voltage\n",
    "Vrms=Vp/(sqrt(2));\n",
    "#results\n",
    "print 'The rms voltage that cause deviation is ',round(Vrms,2),'V'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6 : pg 145"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The freq deviation produce is 6.0 kHz\n"
     ]
    }
   ],
   "source": [
    " \n",
    "#page no 145\n",
    "#prob no. 4.6\n",
    "#calculate the freq deviation \n",
    "#given\n",
    "#Phase modulator with sensitivity kp=3rad/V & sine wave i/p 2 V peak at 1kHz\n",
    "kp=3.;Vp=2.;f=1*10**3;\n",
    "#calculations\n",
    "#As max value of sine functn is 1, hence max value of phi is kp*Vp\n",
    "phi_max=kp*Vp;\n",
    "#phi_max is nothing but mp\n",
    "mp=phi_max;\n",
    "#value of mf is same as mp if signal is considered as freq modulation\n",
    "#Determination of freq deviation\n",
    "dev=mp*f;\n",
    "#results\n",
    "print 'The freq deviation produce is',dev/1000,'kHz'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7 : pg 149"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a)The rms signal voltage is 15.8113883008 V\n",
      "b)The rms voltage of side bands are\n",
      "Vc= 4.11\n",
      "V1= 5.38\n",
      "V2= 7.75\n",
      "V3= 0.0\n",
      "c)The 3 side bands at different freq. are \n",
      "f_usb1= 160.0\n",
      "f_usb2= 160.0\n",
      "f_usb3= 0.0\n",
      "f_lsb1= 160.0\n",
      "f_lsb2= 160.0\n",
      "f_lsb3= 0.0\n",
      "d)The power of each side band is\n",
      "Pc= 0.34\n",
      "P1= 0.58\n",
      "P2= 1.2\n",
      "P3= 0.0\n",
      "e)Percentage total power which is uncounted is 28.3697047497 % f)Power of each side bands in dBm is\n",
      "Pc(dBm)= 25.29\n",
      "P1(dBm)= 27.62\n",
      "P2(dBm)= 30.79\n",
      "P3(dBm)= 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0UlsAfb3O1MoBXQS0ROT7JNpWjCV0qFyUF15Cb15oRC+fmusTHmDe/2\nQuzqfQC/xHa4xRizA/iP16vmFGCTMWb/6P01yr/6ugvw9x93LtJfRFZ5fX2GeK+73RhT6N3+BngX\nn3twacJXSoVJpv1+DPCqiKwWke5l7l/vNZEDuJ4D7Q3WAleJyBEi8nPgv7zH3gOaiMjPxK71fTUH\nt0RARH6GbVuxyPu+HfYPSwugGXCeiFx4yDaNsCsIrszw+FKS6pq2SinlhIiswLYV+D9AbRF523to\noDHm1RRf5gJjzKcicgI28b/rjez/AIwTkfuBF4HvvedPBs4AVmOvJF8G7DXG/EdEemIble0F/ont\nS1TWDcAcc+Cq1vZAOy9uwbbZbgy84R1fTewV3X3Mwe24s04TvlIq0IztBol34rSrMea2DF7jU+/f\nHSLyPLbP/BvGmI3Ab7zXbwxc4T1vL9B3//YisgzY5D32MvCyd393bOIv6wbgjjLfC3ZhoEmHxuV9\nSpgDTDfGvJDucaVLp3SUUlFR7nSPiBxTpvqmBnbEXex9f4L3bxVgEPCU9/3RInKMd7sdtvX3hkO2\nqY1N7E+X2dfp2H5gK8qEMB+4zds3IlJfROp6j00G3jHGjK384SenI3ylVGiJyNXYipi6wEsiUmiM\nuUxE6gGTjDFXAj8FnhcRg815M4wxC7yX6CIivbBz/PnGmKne/T8B5ovIXmw74pvL7HasiJzrbfOA\nMea9Mo/9Drsq1Y+MMa96fwiWiwjA18D/FZEmwE1AkYis8V7vz8aYf2Thv6Zc2jxNKaViQqd0lFIq\nJjThK6VUTGjCV0qpmNCEr5RSMaEJXymlYkITvlJKxYQmfKWUiglN+EopFRP/H6SaK/GDr87+AAAA\nAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x3715da0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    " \n",
    "#page no 149\n",
    "#prob no. 4.7\n",
    "#calculate the rms voltage in all cases \n",
    "%matplotlib inline\n",
    "from math import sqrt, log10\n",
    "import numpy\n",
    "import matplotlib\n",
    "from matplotlib import pyplot\n",
    "#given\n",
    "#An FM signal has deviation 3kHz & modulating freq 1kHz with total power Pt=5W\n",
    "#developed across 50 ohm with fc=160 MHz\n",
    "dev = 3. * 10 ** 3\n",
    "fm = 10 ** 3\n",
    "Pt = 5.\n",
    "Rl = 50.\n",
    "fc = 160. * 10 ** 6\n",
    "#calculations and results\n",
    "#a)Determination of RMS signal voltage\n",
    "Vt = sqrt(Pt * Rl)\n",
    "print 'a)The rms signal voltage is',Vt,'V'\n",
    "######/b)Determination of rms voltage at carrier freq\n",
    "#for that modulation index needs to be found out\n",
    "mf = dev / fm\n",
    "#From bessel function table, the coeff for the carrier first 3 side bands\n",
    "J = ([0.26,0.34,0.49,0.31])\n",
    "V = numpy.zeros(4)\n",
    "print 'b)The rms voltage of side bands are'\n",
    "for i in range(0,3):\n",
    "    V[i] = J[i] * Vt\n",
    "\n",
    "print 'Vc=',round(V[0],2)\n",
    "print 'V1=',round(V[1],2)\n",
    "print 'V2=',round(V[2],2)\n",
    "print 'V3=',round(V[3],2)\n",
    "#####/c)Determination of freq of each side bands########\n",
    "print 'c)The 3 side bands at different freq. are '\n",
    "f_usb = numpy.zeros(3)\n",
    "for j in range(0,2):\n",
    "    f_usb[j] = fc / 10 ** 6 + (fm * j / 10 ** 6)\n",
    "\n",
    "print 'f_usb1=',round(f_usb[0],2)\n",
    "print 'f_usb2=',round(f_usb[1],2)\n",
    "print 'f_usb3=',round(f_usb[2],2)\n",
    "\n",
    "f_lsb = numpy.zeros(3)\n",
    "for j in range(0,2):\n",
    "    f_lsb[j] = fc / 10 ** 6 - (fm * j / 10 ** 6)\n",
    "\n",
    "print 'f_lsb1=',round(f_lsb[0],2)\n",
    "print 'f_lsb2=',round(f_lsb[1],2)\n",
    "print 'f_lsb3=',round(f_lsb[2],2)\n",
    "\n",
    "P = numpy.zeros(4)\n",
    "a = numpy.zeros(4)\n",
    "######d)Determination of power of each side band########/\n",
    "for i in range(0,3):\n",
    "    P[i] = ((V[i]) ** 2) / Rl\n",
    "    a[i] = (P[i]) / (10 ** -3)\n",
    "\n",
    "print 'd)The power of each side band is'\n",
    "print 'Pc=',round(P[0],2)\n",
    "print 'P1=',round(P[1],2)\n",
    "print 'P2=',round(P[2],2)\n",
    "print 'P3=',round(P[3],2)\n",
    "\n",
    "#####e)Determination of power that is uncounted\n",
    "P = P[0] + 2 * (P[2] + P[3] + P[1])\n",
    "#As total power is 5 W\n",
    "P_x = Pt - P\n",
    "#Percentage of total power uncounted\n",
    "Px = (P_x / P) * 100\n",
    "print 'e)Percentage total power which is uncounted is',Px,'%',\n",
    "#####f)Ploting the signal in freq domain##########/\n",
    "#Converting power in dBm\n",
    "P_dBm = numpy.zeros(4)\n",
    "for i in range(0,3):\n",
    "    #a(k)=(P(k))/(10**-3);\n",
    "   P_dBm[i] = 10 * log10(a[i]) \n",
    "\n",
    "print 'f)Power of each side bands in dBm is'\n",
    "print 'Pc(dBm)=',round(P_dBm[0],2)\n",
    "print 'P1(dBm)=',round(P_dBm[1],2)\n",
    "print 'P2(dBm)=',round(P_dBm[2],2)\n",
    "print 'P3(dBm)=',round(P_dBm[3],2)\n",
    "\n",
    "x = ([159.997,159.998,159.999,160.0,160.001,160.002,160.003])\n",
    "y = ([26.8,30.8,27.6,25.3,27.6,30.8,26.8])\n",
    "pyplot.plot(x,y);\n",
    "pyplot.show();\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 9 : pg 157"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The SNR at detector o/p is 33.979 dB\n"
     ]
    }
   ],
   "source": [
    " \n",
    "#page no 157\n",
    "#prob no. 4.9\n",
    "#calculate the SNR at detector o/p\n",
    "from math import log10\n",
    "#given\n",
    "#An FM signal has freq deviation of 5kHz modulating freq fm=1kHz with SNR at i/p is 20 dB\n",
    "#Converting dB in voltage ratio\n",
    "fm=1.*10**3;dev_s=5.*10**3;snr=20.;\n",
    "#calculations\n",
    "Es_En=10**(snr/20);\n",
    "#Since Es>>En then \n",
    "phi=1/(Es_En);\n",
    "m_fn=phi;#modulation index equal to phi_n\n",
    "dev_n=(m_fn)*fm;#Equivalent freq deviation due to noise\n",
    "#SNR as a voltage ratio is given as\n",
    "SNR=(dev_s)/(dev_n);\n",
    "#Converting this voltage ration in dB\n",
    "SNR_dB=20*(log10(SNR));\n",
    "#results\n",
    "print 'The SNR at detector o/p is',round(SNR_dB,3),'dB'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 10 : pg 163"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The freq is with in the acceptable range 2.083 kHz\n"
     ]
    }
   ],
   "source": [
    " \n",
    "#page no 163\n",
    "#prob no. 4.10\n",
    "#calculate whether the freq is with in the acceptable range\n",
    "#Refer the fig. 4.19\n",
    "#given\n",
    "# We know this transmitter is designed for voice frequencies,so we have to use trial \n",
    "#and error method to produce a carrier null for a deviation of 5kHz\n",
    "mf=2.4;# starting with the first null for mf=2.4\n",
    "dev=5;#in kHz\n",
    "#calculations and results\n",
    "fm=dev/mf;\n",
    "if (0.3 <= fm and 3>=fm):\n",
    "    print 'The freq is with in the acceptable range',round(fm,3),'kHz'\n",
    "else:\n",
    "    mf=5.5;\n",
    "    fm=dev/mf;\n",
    "    print 'The freq is with in the acceptable range',round(fm,3),'kHz'\n",
    "# for this calculated fm, set the function generator to the value of fm so that the deviation is 5kHz"
   ]
  }
 ],
 "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
}