summaryrefslogtreecommitdiff
path: root/Satellite_Communications_by_D_Roddy/10-Digital_Siganls.ipynb
blob: 158f019172c468808d6bbe744e39c512f9540001 (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
{
"cells": [
 {
		   "cell_type": "markdown",
	   "metadata": {},
	   "source": [
       "# Chapter 10: Digital Siganls"
	   ]
	},
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.1: determine_the_bit_error_rate.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"funcprot(0)\n",
"//Variable Declaration\n",
"PR=0.01  //The Average power received(watts)\n",
"Tb=0.0001  //Bit period(seconds)\n",
"N0=10**-7  //Noise power(joule)\n",
"//Calculations\n",
"Eb=PR*Tb  //Energy per bit received (joule)\n",
"x=sqrt(Eb/N0)\n",
"erf=integrate('exp(-t^2)','t',0,x)\n",
"erf1=erf*(2/%pi**0.5)\n",
"BER=(1-erf1)*(10**6)/2\n",
"printf('The Bit error rate is %.1f * 10^-6', BER)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.2: Calculate_the_required_C_N0.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"//Variable Declaration\n",
"Rb=61   //Transmission rate (Mb/s)\n",
"ENR=9.5 //Required Energy to noise ratio(dB)\n",
"//Calculation\n",
"Rb=10*log10(61*10**6)  //Converting Transmission rate to dB\n",
"CNR=Rb+ENR  //Carrier to noise ratio\n",
"//Results\n",
"printf('Required Carrier to noise ratio is %.2f dB', CNR)"
   ]
   }
,
{
		   "cell_type": "markdown",
		   "metadata": {},
		   "source": [
			"## Example 10.3: Calculate_the_Eb_N0_ratio_in_decibels.sce"
		   ]
		  },
  {
"cell_type": "code",
	   "execution_count": null,
	   "metadata": {
	    "collapsed": true
	   },
	   "outputs": [],
"source": [
"funcprot(0)\n",
"//Variable Declaration\n",
"BER=10**-5  //Maximum allowable bit error rate\n",
"//Calculation\n",
"x=linspace(8,10,11)  //Eb/N0 ratio represented by x\n",
"x1=x**0.5\n",
"for i = 1:11\n",
"   x(i)=10*log10(x(i))  //Converting x into decibels\n",
"end\n",
"erf=linspace(0,0,11)  //Initialization for erf function\n",
"Pe=linspace(0,0,11)   //Initialization for Probablity of error\n",
"for i = 1:10\n",
"   k=integrate('exp(-t**2)','t',0,x1(i))\n",
"   erf(i)=k(1)*(2/%pi**0.5)    \n",
"   Pe(i)=(1-erf(i))/2       //Probability of error\n",
"end\n",
"y=linspace(9,9.59,5)\n",
"z=linspace(BER,BER,5)\n",
"a=linspace(9.59,9.59,5)\n",
"b=linspace(0,BER,5)\n",
"plot(x,Pe)\n",
"plot(y,z)\n",
"plot(a,b)\n",
"xlabel('','xdB','Pe(x)')\n",
"x=9.6   //The Eb/N0 ratio for Maximum BER(dB) from the graph\n",
"EbN0=x+2 //Eb/N0 ratio with implementation margin\n",
"//Results\n",
"printf('The Eb/N0 ratio with allowable BER of 10^-5 and implementation margin of 2dB is %.1f dB',EbN0)"
   ]
   }
],
"metadata": {
		  "kernelspec": {
		   "display_name": "Scilab",
		   "language": "scilab",
		   "name": "scilab"
		  },
		  "language_info": {
		   "file_extension": ".sce",
		   "help_links": [
			{
			 "text": "MetaKernel Magics",
			 "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
			}
		   ],
		   "mimetype": "text/x-octave",
		   "name": "scilab",
		   "version": "0.7.1"
		  }
		 },
		 "nbformat": 4,
		 "nbformat_minor": 0
}