summaryrefslogtreecommitdiff
path: root/Propagation_Engineering_in_Wireless_Communications_by_Abdollah_Ghasemi/Chapter1_1.ipynb
blob: d658688081df9841f6f775b8b6fe5070b1a36240 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:210d4209b2bf5bb89dd881d85f3fd691c9eeb52914bb6a1ab12008858853aedb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1 : Introduction to Radiowaves"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1, page 13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Initialisation\n",
      "fo=8387.5                                                 #frequency in MHz\n",
      "\n",
      "#Calculation\n",
      "\n",
      "#defining a function for 6 MHZ channels with 14 MHz separation\n",
      "def F(n):\n",
      "    fn=fo-108.5+(14*n);\n",
      "    return (fn)\n",
      "\n",
      "def F1(n):\n",
      "    fn=fo+10.5+(14*n);\n",
      "    return (fn)\n",
      "\n",
      "#defining a function for 12 MHZ channels with 7 MHz separation\n",
      "def F2(n):\n",
      "    fn=fo-108.5+(7*n);\n",
      "    return (fn)\n",
      "\n",
      "def F3(n):\n",
      "    fn=fo+17.5+(7*n);\n",
      "    return (fn)\n",
      "\n",
      "\n",
      "#Results\n",
      "print'(1) 6-RF channels with 14 MHz separation'\n",
      "print'    f1 = %d'%F(1)\n",
      "print'    f11 = %d'%F1(1)\n",
      "print'    f2 = %d'%F(2)\n",
      "print'    f21 = %d'%F1(2)\n",
      "print'    f3 = %d'%F(3)\n",
      "print'    f31 = %d'%F1(3)\n",
      "print'(2) 12-RF channels with 7 MHz separation'\n",
      "print'    f1 = %d'%F2(1)\n",
      "print'    f11 = %d'%F3(1)\n",
      "print'    f2 = %d'%F2(2)\n",
      "print'    f21 = %d'%F3(2)\n",
      "print'    f3 = %d'%F2(3)                                    #wrong value calculated in textbook\n",
      "print'    f31 = %d'%F3(3)                                    #wrong value calculated in textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1) 6-RF channels with 14 MHz separation\n",
        "    f1 = 8293\n",
        "    f11 = 8412\n",
        "    f2 = 8307\n",
        "    f21 = 8426\n",
        "    f3 = 8321\n",
        "    f31 = 8440\n",
        "(2) 12-RF channels with 7 MHz separation\n",
        "    f1 = 8286\n",
        "    f11 = 8412\n",
        "    f2 = 8293\n",
        "    f21 = 8419\n",
        "    f3 = 8300\n",
        "    f31 = 8426\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}