summaryrefslogtreecommitdiff
path: root/Electronic_Communication_Systems/Chapter1.ipynb
blob: 0fff555eaf8c388e7a00fdf94c4038978a397577 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:f852f2388a309880e4ed281d6cd6695038f25edc5aca1cbeddbb1a41de15396c"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1: Introduction to Communication Systems"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1, page no. 10 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# Variable Declaration\n",
      "T      = 1.00*pow(10,-3)                                             # Time (s)\n",
      "Tau    = 500.00*pow(10,-6)                                           # Pulse Width (s)\n",
      "A      = 10.00                                                       # Amplitude (V)\n",
      "\n",
      "# Calculation\n",
      "import math                                                          # Math Library\n",
      "Coeff1 = A*(Tau/T)     # Coefficient 1\n",
      "Coeff2 = 2*A*(Tau/T)*math.sin((Tau/T)*math.pi)/((Tau/T)*math.pi)     # Coefficient 2\n",
      "Coeff3 = 2*A*(Tau/T)*math.sin(2*(Tau/T)*math.pi)/(2*(Tau/T)*math.pi) # Coefficient 3\n",
      "Coeff4 = 2*A*(Tau/T)*math.sin(3*(Tau/T)*math.pi)/(3*(Tau/T)*math.pi) # Coefficient 4\n",
      "\n",
      "# Result\n",
      "print \"The Coefficients of First Four Terms in the Fourier Series are:\"\n",
      "print \"Coeff1 =\",round(Coeff1)\n",
      "print \"Coeff2 =\",round(Coeff2,3)\n",
      "print \"Coeff3 =\",round(Coeff3)\n",
      "print \"Coeff4 =\",round(Coeff4,3)\n",
      "print \"f(t) = [\",round(Coeff1),\"] + [\",round(Coeff2,3),\"cos(2pi*10^3*t) ] + [\",round(Coeff3),\"] + [\",round(Coeff4,3),\"cos(6pi*10^3*t)\",\"]\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Coefficients of First Four Terms in the Fourier Series are:\n",
        "Coeff1 = 5.0\n",
        "Coeff2 = 6.366\n",
        "Coeff3 = 0.0\n",
        "Coeff4 = -2.122\n",
        "f(t) = [ 5.0 ] + [ 6.366 cos(2pi*10^3*t) ] + [ 0.0 ] + [ -2.122 cos(6pi*10^3*t) ]\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2, page no. 12 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "\n",
      "# Variable Declaration\n",
      "f      = 0.50*pow(10,3)    # First Zero Crossing (Hz)\n",
      "Fw_max = 8.00*pow(10,-3)    # Amplitude (V)\n",
      "\n",
      "# Calculation\n",
      "import math                         # Math Library\n",
      "Tau    = 1/f                        # Pulse Duration (s)\n",
      "A      = Fw_max/Tau                 # Maximum Voltage (V)   \n",
      "\n",
      "# Result\n",
      "print \"The single pulse has a maximum voltage of\",round(A),\"V and a duration of\",round(Tau*pow(10,3)),\"ms.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The single pulse has a maximum voltage of 4.0 V and a duration of 2.0 ms.\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}