summaryrefslogtreecommitdiff
path: root/Wireless_Communications_and_Networking_by_V._Garg/ch19.ipynb
blob: fee9ff0983b11a80b4aeb3a54770430473e22894 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:dd18f098648291d58cdb32b1739d692bc9e7a8620a737fa84a463a3efca95463"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 19: Wireless Personal Area Network - Bluetooth"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19.1, Page 666"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "SS=80.; #Frame length of HV3 voice packet\n",
      "R=64*10**3; #Data rate in bps\n",
      "TS=240; #No of bits carried in a slot\n",
      "\n",
      "#Calculations\n",
      "#From table 19.3:Bluetooth air interface details, we get Frequency hopping rate as 1600hopes/second\n",
      "\n",
      "#From table 19.5, we can note that for HV3, No of slots are 1 and carry in all(80(user voice sample)+160(parity bits))=240 bits in one slot packet\n",
      "HR=1600; #hopes/second\n",
      "Eff=SS/TS;\n",
      "x=R/SS;  #x is number of times a packet is sent\n",
      "\n",
      "#Results\n",
      "print 'Hopping rate is %d hopes/sec'%HR;\n",
      "print 'No of bits transmitted in one slot are %d'%TS;\n",
      "print 'Efficiency of packet transmission is %.4f'%Eff;\n",
      "print 'Number of times a packet is sent is equal to %d'%x;"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Hopping rate is 1600 hopes/sec\n",
        "No of bits transmitted in one slot are 240\n",
        "Efficiency of packet transmission is 0.3333\n",
        "Number of times a packet is sent is equal to 800\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19.2, Page 666"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "R=136.; # bits per slot\n",
      "SR=800; # no of slots per second\n",
      "\n",
      "#Calculations\n",
      "# A symmetric 1-slot DM1 link is setup  between a master and a slave\n",
      "AR=R*SR; #Data rate in bps\n",
      "\n",
      "#Result\n",
      "print 'Associated data rate is %0.1f kbps'%(AR/1000);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Associated data rate is 108.8 kbps\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}