summaryrefslogtreecommitdiff
path: root/1895/CH11/EX11.13/EXAMPLE11_13.SCE
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1895/CH11/EX11.13/EXAMPLE11_13.SCE
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1895/CH11/EX11.13/EXAMPLE11_13.SCE')
-rwxr-xr-x1895/CH11/EX11.13/EXAMPLE11_13.SCE24
1 files changed, 24 insertions, 0 deletions
diff --git a/1895/CH11/EX11.13/EXAMPLE11_13.SCE b/1895/CH11/EX11.13/EXAMPLE11_13.SCE
new file mode 100755
index 000000000..9bd1a5cfa
--- /dev/null
+++ b/1895/CH11/EX11.13/EXAMPLE11_13.SCE
@@ -0,0 +1,24 @@
+//ANALOG AND DIGITAL COMMUNICATION
+//BY Dr.SANJAY SHARMA
+//CHAPTER 11
+//Information Theory
+clear all;
+clc;
+printf("EXAMPLE 11.13(PAGENO 495)");
+//given
+t_dot = .2//duration of dot symbol
+t_dash = .6//duration of dash symbol
+t_space = .2//time between the symbols
+//wkt sum of the probability is 1 i.e P_dot + P_dash = 1 hence
+//P_dot = 2*P_dash weget
+P_dot = 2/3//probality of dot symbol
+P_dash = 1/3//probality of dash symbol
+
+//calculations
+H_X = -P_dot*log2(P_dot)-P_dash*log2(P_dash);//entropy
+T_s = P_dot*t_dot + P_dash*t_dash +t_space;//average time per symbol
+r = 1/T_s;//average symbol rate
+R = r*H_X;//average information rate of the telegraph sourece
+
+//result
+printf("\n\ni.The average information rate of the telegraph source = %.4f bits/seconds",R);