summaryrefslogtreecommitdiff
path: root/sample_notebooks/harikagunturu/Chapter_4_Angle_Modulation.ipynb
blob: de7d514c8fe893596422faebdc086d0908619efa (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
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 4 Angle Modulation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.1.A page.no: 286"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12000 the new deviation( in Hz)\n"
     ]
    }
   ],
   "source": [
    "Freq_dev=6; #Frequency Deviation in kHz\n",
    "Vm=3; #Modulating Voltage in V\n",
    "Dev=Freq_dev*10**3/Vm; \n",
    "# for Vm=6V\n",
    "Vm=6;\n",
    "Freq_dev_new=Dev*Vm;\n",
    "print Freq_dev_new,\"the new deviation( in Hz)\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.1 page.no: 287"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Instantaneous Frequency(in Hz) at (t=0.4 ms)N =  100290.574948\n",
      "Maximum Phase Deviation (in rad) =  3\n",
      "MAximum Frequency Deiation (in Hz)=  300.0\n"
     ]
    }
   ],
   "source": [
    "from math import pi,cos\n",
    "\n",
    "t1=0.4;# time in ms\n",
    "Ang_Freq =2*pi*10**5 +3*2*pi*100*cos(2*pi*100*(t1*10**(-3)));\n",
    "Freq=Ang_Freq/(2*pi);\n",
    "#change in answer due to calculation error in book\n",
    "print \"Instantaneous Frequency(in Hz) at (t=0.4 ms)N = \",Freq\n",
    "Max_pha_Dev=3; #max(3sin(2∗pi∗100t))\n",
    "print \"Maximum Phase Deviation (in rad) = \",Max_pha_Dev\n",
    "Max_fre_Dev=6*pi*100;  #max(6∗pi∗100∗cos(2∗pi∗100t))\n",
    "print \"MAximum Frequency Deiation (in Hz)= \",Max_fre_Dev/(2*pi)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.2.A page.no: 287"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Power Dissipated (in W) is  9.375\n"
     ]
    }
   ],
   "source": [
    "from math import pi,sqrt\n",
    "\n",
    "Wc=8*10**(8);# Angular Frequency of Carrier Signal\n",
    "fc=Wc/(2*pi);\n",
    "Wm=1300;#Angular Frequency of Message Signal\n",
    "fm=Wm/(2*pi);\n",
    "B=3;#Modulation Index\n",
    "R=12;\n",
    "Vc_rms=15/sqrt(2);\n",
    "Max_dev=B*fm;\n",
    "Power=Vc_rms**(2)/R;\n",
    "print \"Power Dissipated (in W) is \",Power"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.2 page.no: 287"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Peak Frequency Deviation(in Hz) is  12000\n",
      "modulation index  8.0\n"
     ]
    }
   ],
   "source": [
    "a=3;#amplitude in volts\n",
    "Dev_sen=4;# deviation sensitivity in KHz/volts\n",
    "fm=1.5;# frequency modulating signal in KHz\n",
    "f=Dev_sen*10**(3)*3;#peak frequency deviation\n",
    "B=f/(fm*10**3);\n",
    "print \"Peak Frequency Deviation(in Hz) is \",f\n",
    "print \"modulation index \",B"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.3.A page.no: 289"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Bandwidth (in Hz) is  72000\n"
     ]
    }
   ],
   "source": [
    "fm=3; #Modulating Frequency in kHZ\n",
    "Max_Dev=18; #MAximum Deviation in kHz\n",
    "B=Max_Dev/fm; # modulation index 7\n",
    "J=12;#from Bessel Table , for B=6\n",
    "Bw=fm*J*2*10**(3);\n",
    "print \"The Bandwidth (in Hz) is \",Bw"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.3 page.no: 289"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Peak Phase Deviation( in rad)  8.75\n"
     ]
    }
   ],
   "source": [
    "Dev_sen=3.5 # Deviation Sensitivity in rad/volt\n",
    "a=2.5; #amplitude in volts\n",
    "B=a*Dev_sen; # Peak Phase Deviation\n",
    "print \"Peak Phase Deviation( in rad) \",B"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.4.A page.no: 290"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Maximum Frequency Deviation (in Hz) is  18000\n",
      "Modulation Index is  5.99985864877\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "Wm=18850;#Angular Frequency of message signal\n",
    "fm=Wm/(2*pi);\n",
    "a=3;# amplitude of message signal\n",
    "Dev_sen=6;#Deviation Sensitivity in kHz/V\n",
    "Max_Freq_Dev=a*Dev_sen*10**(3);\n",
    "B=Max_Freq_Dev/(fm);\n",
    "print \"Maximum Frequency Deviation (in Hz) is \",Max_Freq_Dev\n",
    "print \"Modulation Index is \",B"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.4 page.no: 291"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Deviation Sensitivity(in kHz/V)  1333\n",
      "Modulation Index is  4\n",
      "Deviation Sensitivity for 5V (in Hz)  6665\n",
      "Modulation index 6\n",
      "Deviation Sensitivity for 10V (in Hz)  13330\n",
      "Modulation index is  33\n"
     ]
    }
   ],
   "source": [
    "a=3; #amplitude in Volts\n",
    "Dev=4;# Deviation in kHz\n",
    "fm=1;# modulating frequency in kHz\n",
    "Dev_sen=Dev*10**(3)/a; #Deviation Sensitivity\n",
    "B=Dev/fm; # Modulation Index\n",
    "print \"Deviation Sensitivity(in kHz/V) \",Dev_sen\n",
    "print \"Modulation Index is \",B\n",
    "#a)\n",
    "a=5;\n",
    "Dev_sen_1=a*Dev_sen;\n",
    "B=Dev_sen_1/(fm*10**(3));\n",
    "print \"Deviation Sensitivity for 5V (in Hz) \",Dev_sen_1\n",
    "print \"Modulation index\",B\n",
    "#b)\n",
    "a=10;\n",
    "fm=400;\n",
    "Dev_sen_2=a*Dev_sen;\n",
    "B=Dev_sen_2/fm;\n",
    "print \"Deviation Sensitivity for 10V (in Hz) \",Dev_sen_2\n",
    "print \"Modulation index is \",B"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.5.A page.no: 291"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "for B=2, The number of significant frequencies are 6\n",
      "They are J1,J2,J3,J4,J5 and J6\n",
      "Their amplitudes with carriers are \n",
      "they are (in V) 1.792 4.616 2.824 1.032 0.272 0.056 0.008\n"
     ]
    }
   ],
   "source": [
    "print \"for B=2, The number of significant frequencies are 6\"\n",
    "print \"They are J1,J2,J3,J4,J5 and J6\"\n",
    "print \"Their amplitudes with carriers are \"\n",
    "J0= 0.224*8;\n",
    "J1= 0.577*8;\n",
    "J2= 0.353*8;\n",
    "J3= 0.129*8;\n",
    "J4= 0.034*8;\n",
    "J5= 0.007*8;\n",
    "J6= 0.001*8;\n",
    "print\"they are (in V)\",J0,J1,J2,J3,J4,J5,J6"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.5 page.no: 292"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Bandwidth required (in Hz)  24000\n",
      "According to Carsons rule , Bandwidth (in Hz)  36000\n"
     ]
    }
   ],
   "source": [
    "fm=3; #Modulating Frequency in kHZ\n",
    "Max_dev=15;# Maximum Deviatin in kHZ\n",
    "B=Max_dev/fm; \n",
    "J=8; # Bessel table , the highest J coefficient\n",
    "BW=J*fm*10**(3);#Bandwidth in kHz\n",
    "BW1=2*(fm+Max_dev)*10**(3);# According to carson rule , BAndwidth\n",
    "print \"Bandwidth required (in Hz) \",BW\n",
    "print \"According to Carsons rule , Bandwidth (in Hz) \",BW1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.6.A page.no: 292"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Minimum Bandwidth (in Hz) is  72000\n",
      "Approximate Minimum Bandwidth is  36000\n"
     ]
    }
   ],
   "source": [
    "Max_Freq_Dev=12; #Maximum Frequency Deviation in kHZ\n",
    "fm=6; #Modulating frquency in kHz\n",
    "B=Max_Freq_Dev/fm;# Modulation index 7\n",
    "J=6;#From Bessel Table , for B=2\n",
    "Bw=2*J*6*10**(3);\n",
    "BW_carson=2*(fm + Max_Freq_Dev)*10**(3);\n",
    "print \"Minimum Bandwidth (in Hz) is \",Bw\n",
    "print \"Approximate Minimum Bandwidth is \",BW_carson"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.6.A page.no: 283"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "For B=5 from the Bessel table ,The Bessel Function is taken upto J9\n",
      "Hence the average power of the modulated signal (in W) is  9.936\n",
      "Hence, the average power of the modulated signal is equal to \n",
      "unmodulated carrier power\n"
     ]
    }
   ],
   "source": [
    "a=10; #Amplitude in V\n",
    "Pt=a*(0.18**2 +2*(0.33**2+0.05**2+0.36**2+0.39**2+0.26**2+0.13**2+0.05**2+0.02**2+0.01**2))\n",
    "print \"For B=5 from the Bessel table ,The Bessel Function is taken upto J9\"\n",
    "print \"Hence the average power of the modulated signal (in W) is \",Pt\n",
    "print \"Hence, the average power of the modulated signal is equal to \"\n",
    "print \"unmodulated carrier power\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.7.A page.no: 294"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Unmodulated Power Carrier ( in W) =  1\n",
      "Total Power in modulated wave(in W)=  1.06767573333\n",
      "Power in the modulated wave is equal to \n",
      "power in the unmodulated wave \n"
     ]
    }
   ],
   "source": [
    "a=8;# amplitude in V\n",
    "r=30; # resistance in ohms\n",
    "Pc_unmodulated=a**2/(2*r);\n",
    "Pt=1.792**2/(2*30)+2*(4.616)**2/(2*30)+2*(2.824**2)/(2*30) +2*(1.032) **2/(2*30) +2*(0.272) **2/(2*30) +2*(0.056)**2/(2*30)+2*(0.008)**2/(2*30);\n",
    "# change in answer due to approximations in the book\n",
    "print \"Unmodulated Power Carrier ( in W) = \",Pc_unmodulated\n",
    "print \"Total Power in modulated wave(in W)= \",Pt\n",
    "print \"Power in the modulated wave is equal to \"\n",
    "print \"power in the unmodulated wave \" \n",
    "#\"Small error due to rounded off values in Bessel functions\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.7 page.no: 295"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the Phase Modulation Function =  12.0*sin(3000.0*pi*t)\n",
      "The Modulated Wave Function =  12.0*sin(3000.0*pi*t) + 8*cos(20000*pi*t)\n"
     ]
    }
   ],
   "source": [
    "from sympy import symbols,sin,cos\n",
    "\n",
    "t,pi=symbols('t,pi') \n",
    "Pha_dev=3.; #Phase Deviation constant in rad/V 6\n",
    "# Phase Modulation Function\n",
    "Pha_function=Pha_dev*4*sin(2.*pi*1.5*10**3*t);\n",
    "Mod_wave=8*cos(2*pi*10**4*t)+Pha_function\n",
    "print \"the Phase Modulation Function = \",Pha_function\n",
    "print \"The Modulated Wave Function = \",Mod_wave"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.8 page.no: 295"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The outputs of the balanced modulator for these parameters\n",
      "are same as the inputs \n",
      "They remain unaltered \n",
      "At the output of the Multiplier , \n",
      "Fc(in kHz)=  9600 , Fm(in kHz)=  10 , B=  6.0\n",
      "Frequency Deviation ( in kHz)=  60\n"
     ]
    }
   ],
   "source": [
    "initial_Freq_Dev=5; # frequency in kHz\n",
    "B_initial=0.5; #modulation index\n",
    "fm_initial=10;# message signal frequency in kHz\n",
    "fc_initial=800; # carrier frequency in kHz\n",
    "print \"The outputs of the balanced modulator for these parameters\"\n",
    "print \"are same as the inputs \"\n",
    "print \"They remain unaltered \"\n",
    "#at the output of the multiplier 14\n",
    "m=12;# multiplication factor\n",
    "final_Freq_Dev=initial_Freq_Dev*m;\n",
    "B_final=0.5*m;\n",
    "fm_final=10; #modulating signal remains unaltered\n",
    "fc_final=800*m;\n",
    "print \"At the output of the Multiplier , \"\n",
    "print \"Fc(in kHz)= \",fc_final,\", Fm(in kHz)= \",fm_final,\", B= \",B_final\n",
    "print \"Frequency Deviation ( in kHz)= \",final_Freq_Dev"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.9.A page.no: 296"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a) MAster Oscillator Centre Frequency(in MHz) =  4.008\n",
      "b) Frequency Deviation at the output of modulator(in KHz)=  2.4\n",
      "c)Devaition ratio at the output of modulator  0.24\n",
      "d)deviation ratio at power amplifier 6.0\n"
     ]
    }
   ],
   "source": [
    "ft=100.2; #final carrier frequency in MHz\n",
    "Freq_Dev_ft=60.;# Frequency Deviation in KHz at power amplifier\n",
    "fm=10.;#modulating frequency in KHz\n",
    "m=25.;#multiplication factor\n",
    "#a)\n",
    "fc=ft/25.;\n",
    "#b)\n",
    "Freq_Dev=Freq_Dev_ft/25;\n",
    "#c)\n",
    "B=Freq_Dev/fm;\n",
    "#d)\n",
    "Bt=B*m;\n",
    "print \"a) MAster Oscillator Centre Frequency(in MHz) = \",fc\n",
    "print \"b) Frequency Deviation at the output of modulator(in KHz)= \",Freq_Dev\n",
    "print \"c)Devaition ratio at the output of modulator \",B\n",
    "print \"d)deviation ratio at power amplifier\",Bt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.10.A page.no: 297"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a) Frequency Deviation(in Hz)=  5954.92965855\n",
      "b) Devaition Ratio=  5.95492965855\n",
      "c) Phase Deviation( in rad)=  8\n",
      "d) Bandwidth( in Hz)=  13909.8593171\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#f(t)=5cos(Wc∗t+3sin(2000∗t)+5sin(2000∗pi∗t)) 5\n",
    "fm=2000*pi/(2*pi); #bandwidth is the highest frequency component\n",
    "#a) \n",
    "Freq_dev=(6000+10000*pi)/(2*pi); 11\n",
    "#b)\n",
    "B=Freq_dev/fm; \n",
    "#c)\n",
    "Phase_dev=8;#Highest value of[3sin(2000t)+5sin(2000∗ pi∗t)]\n",
    "#d)\n",
    "Bw= 2*(fm+Freq_dev);\n",
    "print \"a) Frequency Deviation(in Hz)= \",Freq_dev\n",
    "print \"b) Devaition Ratio= \",B\n",
    "print \"c) Phase Deviation( in rad)= \",Phase_dev\n",
    "print \"d) Bandwidth( in Hz)= \",Bw"
   ]
  }
 ],
 "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
}