summaryrefslogtreecommitdiff
path: root/Propagation_Engineering_in_Wireless_Communications_by_Abdollah_Ghasemi_/Chapter5_1.ipynb
blob: 9a18598bd84812f3e59147b371097eafe7ebb762 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:98eb0c6e30cbee8cc73fe4fee57515eb52199d33e809700a3f6ef648557e06af"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 5: Propagation in 3 KHz to 30 MHz Band"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2, page 186"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initialisation\n",
      "f=5                                    #frequency in Hz\n",
      "er=15                                  #ground characteristics\n",
      "s=0.01                                 #for vertically polarized waves\n",
      "c=3*10**8                              #speed of light\n",
      "e0=8.85*10**-12                        #permitivity of free space\n",
      "d=80000                                #distance in m\n",
      "\n",
      "#Calculation\n",
      "a=5**0.333\n",
      "df=50/a                                 #distance in metre\n",
      "h=c*(f*10**6)**-1                       #wavelength\n",
      "b=s/(2*math.pi*f*e0*10**6)\n",
      "b1=math.sqrt(er**2+b**2)\n",
      "p=(math.pi*d)/(h*b1)\n",
      "\n",
      "#from fig 5.8\n",
      "As = 0.05                             #attenuation factor\n",
      "\n",
      "#Results\n",
      "print'p = %d'%p\n",
      "print'|As| = %.2f'%As"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "p = 107\n",
        "|As| = 0.05\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3, page 191"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initialisation\n",
      "c=3*10**8                              #speed of light\n",
      "f=10*10**6                             #frequency in Hz\n",
      "e0=8.85*10**-12                        #permitivity of free space\n",
      "er=10                                  #ground characteristics\n",
      "s=0.005\n",
      "d=30000\n",
      "pt=200                                  #transmitter power in watt\n",
      "gt=1                                     #gain of transmitter antenna\n",
      "gr=1                                     #gain of receiver antenna\n",
      "\n",
      "#Calculation\n",
      "h=c*f**-1                               #wavelength\n",
      "e=er*e0\n",
      "b=s/(2*math.pi*f*e)\n",
      "b1=math.sqrt(er**2+b**2)\n",
      "p=(math.pi*d)/(h*b1)                     #wrong value calculated in textbook\n",
      "i=((er*e0*2*3.14*f)/s)\n",
      "b2=math.atan(i)                 \n",
      "b3=b2*180/math.pi\n",
      "a1=((2+0.3*p)/(2+p+0.6*p**2))\n",
      "a2=math.sqrt(p/2)*(5*10**-82)*math.sin(-b3)\n",
      "As=a1-a2                                       #attenuation function\n",
      "pr=pt*gt*gr*h**2/(4*math.pi*d)**2\n",
      "pr1=pr*(2*As)**2                            #wrong value calculated in textbook \n",
      "\n",
      "#Results\n",
      "print'Received signal power Pr = %.2f pW'%(pr1*10**12)         #wrong value calculated in textbook\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Received signal power Pr = 13.35 pW\n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4, page 192"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initialisation\n",
      "f=0.5                               #frequency in MHz\n",
      "Pa=100                              #transmitter power\n",
      "Po=1000\n",
      "e120=68                            #from figure 5.10\n",
      "e220=85                            #from figure 5.9\n",
      "e230=80\n",
      "e330=60                             #from figure 5.10\n",
      "e380=48\n",
      "e350=50                            #from figure 5.10\n",
      "e250=75                            #from figure 5.9\n",
      "e260=73\n",
      "e160=60                            #from figure 5.10\n",
      "e180=48\n",
      "\n",
      "#Calculation\n",
      "ETR=e120-e220+e230-e330+e380\n",
      "ERT=e350-e250+e260-e160+e180                        #wrong value calculated in textbook\n",
      "ER=(ETR+ERT)/2                                      #field strength at the receiving end                   \n",
      "Ea=ER+(10*math.log10(Pa*Po**-1))\n",
      "lb=137.2+(20*math.log10(f))-ER\n",
      "\n",
      "#Results\n",
      "print'(1) Electric field = %.1f dB'%Ea              #wrong value calculated in textbook due to value ER\n",
      "print'(2) Basic loss path = %.1f dB'%lb             #wrong value calculated in textbook due to value ER"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1) Electric field = 33.0 dB\n",
        "(2) Basic loss path = 88.2 dB\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5, page 196"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initialisation\n",
      "f1=2.5                                  #frequency in MHz\n",
      "f2=6.3                                  #frequency in MHz\n",
      "K=1.1                                   # K factor\n",
      "\n",
      "#Calculation\n",
      "fse=1.05*f1*2                                  #frequency in MHz                        \n",
      "fsf=K*f2*2                                  #frequency in MHz\n",
      "\n",
      "#Results\n",
      "print'Frequency for E layer = %.2f MHz'%fse\n",
      "print'Frequency for F layer = %.2f MHz'%fsf"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Frequency for E layer = 5.25 MHz\n",
        "Frequency for F layer = 13.86 MHz\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7, page 201"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initialisation\n",
      "f=10                                   #frequency in MHz\n",
      "delta=14.5                              #in degree\n",
      "d=1750                                  #distance in Km\n",
      "re=6370                                #radius of earth in Km\n",
      "pt=100                                #transmitter power in watt\n",
      "lm=30                                   #in dB\n",
      "P11=3775                               #in Km\n",
      "\n",
      "#Calculation\n",
      "a=(delta+(d/(2*re)))*(180*3.14**-1)\n",
      "j=math.cos(a)\n",
      "a1=(d*(2*re)**-1)*(180*3.14**-1)\n",
      "j1=math.sin(a1)\n",
      "P=4*re*(j1*j**-1)                                   #path length\n",
      "pt1=10*math.log10(pt*10**-3)\n",
      "FSL=32.4+20*math.log10(f)+20*math.log10(3775)       #free space loss\n",
      "Et=136.6+pt1+20*math.log10(f)-FSL-lm                 #median value\n",
      "\n",
      "#Results\n",
      "print'(1) Path length = %d km'%P11\n",
      "print'(2) Median value = %.2f dB'%Et\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1) Path length = 3775 km\n",
        "(2) Median value = -7.34 dB\n"
       ]
      }
     ],
     "prompt_number": 87
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8, page 202"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initialisation\n",
      "et=20                                     #in dB\n",
      "gr=2                                     #antenna gain in dB\n",
      "f=15                                     #frequency in MHz\n",
      "\n",
      "\n",
      "#Calculation\n",
      "pr=et+gr-(20*math.log10(f))-107.2          #received signal power in dB\n",
      "pr1=10**(pr/10)                             #received signal power in W\n",
      "\n",
      "#Results\n",
      "print'Power Recieved signal = %.2f pW'%(pr1*10**12)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power Recieved signal = 13.42 pW\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.9, page 202"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initialisation\n",
      "pr=-108.7                                   #received signal power in dB\n",
      "fa=50                                       #noise tempreture\n",
      "b=2700                                      #frequency in Hz\n",
      "N=5                                         #noise figure in dB\n",
      "\n",
      "#Calculation\n",
      "snr=pr-fa-(10*math.log10(b))+204               #signal to noise ratio\n",
      "snr1=snr-N\n",
      "\n",
      "#Results\n",
      "print'Received signal to noise ratio = %.1f dB'%snr\n",
      "print'Output signal to noise ratio = %.1f dB'%snr1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Received signal to noise ratio = 11.0 dB\n",
        "Output signal to noise ratio = 6.0 dB\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.10, page 205"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initialisation\n",
      "d=3000                                    #distance in Km\n",
      "re=6370                                   #radius of earth in Km\n",
      "phi=72                                    #angle in degree\n",
      "N=5*10**11                                #electron density\n",
      "\n",
      "#Calculation\n",
      "teta=3000*(2*6370)**-1                    #in radian\n",
      "teta1=teta*180/math.pi                    #degree\n",
      "dt=90-teta1-phi                           #Elevation angle\n",
      "a=re/(math.sin(phi*math.pi/180))\n",
      "b=math.sin((teta1+phi)*math.pi/180)\n",
      "h=(a*b)-re                                 #Height in Km\n",
      "fc=9*math.sqrt(N)                          #frequency in MHz\n",
      "MUF=fc*(math.cos(phi*math.pi/180))**-1      #Maximum working frequency\n",
      "\n",
      "#Results\n",
      "print'(1) Elevation angle = %.1f degree'%dt\n",
      "print'(2) Height h = %.1f km'%h\n",
      "print'(3) MUF = %.1f MHz'%(MUF*10**-6)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1) Elevation angle = 4.5 degree\n",
        "(2) Height h = 307.1 km\n",
        "(3) MUF = 20.6 MHz\n"
       ]
      }
     ],
     "prompt_number": 67
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.11, page 208"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initialisation\n",
      "d=2500                                      #distance in Km\n",
      "re=6370                                     #radius of earth in Km\n",
      "dt=6                                        #elevation angle in degree\n",
      "f1=15                                       #frequency in MHz\n",
      "los1=42                                     #loss\n",
      "\n",
      "\n",
      "#Calculation\n",
      "teta=d*(2*re)**-1                    #in radian\n",
      "teta1=teta*180/math.pi               #in degree\n",
      "phi=90-dt-teta1\n",
      "l=(2*re*math.sin(teta))/math.sin(phi*math.pi/180)\n",
      "fsl=32.4+(20*math.log10(f1))+(20*math.log10(l))        #Free space loss\n",
      "pr=57+6-fsl-los1                                    #receving power in dB\n",
      "pr1=10**(pr/10)                                    #receving power in Watt\n",
      "\n",
      "#Results\n",
      "print'Power = %.2f pW'%(pr1*10**12)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power = 47.60 pW\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 19
    }
   ],
   "metadata": {}
  }
 ]
}