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
|
{
"metadata": {
"name": "",
"signature": "sha256:b47d42851a95b239c1a54b9b998eec602c81d678d0f92705fab117d580600a10"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 18: Information Theory, Coding And Data Communication"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 18.1, page no. 591"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variable Declaration\n",
"SNR_dB = 32.00 # Signal to Noise ratio (dB)\n",
"f1 = 300.00 # Lower Limit of Voice Frequency (Hz)\n",
"f2 = 3400.0 # Upper Limit of Voice Frequency (Hz)\n",
"\n",
"# Calculation\n",
"import math # Math Library\n",
"SNR = pow(10,SNR_dB/10) # Signal to Noise Ratio\n",
"C = (f2-f1)*math.log(1+SNR,2) # Capacity of Telephone Channel (bps)\n",
"\n",
"# Result\n",
"print \"The capacity of a standard 4 kHz telephone channel with 32 dB SNR is C =\",round(C,1),\"bits per second.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The capacity of a standard 4 kHz telephone channel with 32 dB SNR is C = 32956.3 bits per second.\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 18.2, page no. 591"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# Variable Declaration\n",
"SNR_dB = 28.00 \t # Signal to Noise ratio (dB)\n",
"BW1 = 4.00*pow(10,3) # System Bandwidth 1 (Hz)\n",
"BW2 = 8.00*pow(10,3) # System Bandwidth 2 (Hz)\n",
"\n",
"# Calculation\n",
"import math # Math Library\n",
"SNR1 = pow(10,SNR_dB/10) # Signal to Noise Ratio 1\n",
"C1 = BW1*math.log(1+SNR1,2) # Information Carrying Capacity (bps)\n",
"SNR2 = pow(10,SNR_dB/10)/2 # Signal to Noise Ratio 2\n",
"C2 = BW2*math.log(1+SNR2,2) # Information Carrying Capacity (bps)\n",
"\n",
"# Result\n",
"print \"(a) The information carrying capacity of a standard 4 kHz telephone channel with 28 dB SNR is C1 =\",round(C1),\"bits per second.\"\n",
"print \"(b) The information carrying capacity of a standard 8 kHz telephone channel with same signal power as in (a) is C2 =\",round(C2),\"bits per second.\"\n",
"print \" Also the ratio of the two quantities, C2/C1 =\",round(C2/C1,3)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a) The information carrying capacity of a standard 4 kHz telephone channel with 28 dB SNR is C1 = 37215.0 bits per second.\n",
"(b) The information carrying capacity of a standard 8 kHz telephone channel with same signal power as in (a) is C2 = 66448.0 bits per second.\n",
" Also the ratio of the two quantities, C2/C1 = 1.786\n"
]
}
],
"prompt_number": 5
}
],
"metadata": {}
}
]
}
|