summaryrefslogtreecommitdiff
path: root/1895/CH11/EX11.4
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.4
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.4')
-rwxr-xr-x1895/CH11/EX11.4/EXAMPLE11_4.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/1895/CH11/EX11.4/EXAMPLE11_4.sce b/1895/CH11/EX11.4/EXAMPLE11_4.sce
new file mode 100755
index 000000000..3c1b451ae
--- /dev/null
+++ b/1895/CH11/EX11.4/EXAMPLE11_4.sce
@@ -0,0 +1,20 @@
+//ANALOG AND DIGITAL COMMUNICATION
+//BY Dr.SANJAY SHARMA
+//CHAPTER 11
+//Information Theory
+clear all;
+clc;
+printf("EXAMPLE 11.4(PAGENO 489)");
+//given
+Px_1 = 1/4//probability wrt to binary PCM '0'
+Px_2 = 3/4//probability wrt to binary PCM '1'
+
+//calculations
+Ix_1 = log2(1/Px_1)//amount of information of zero level with base 2
+Ix_2 = log2(1/Px_2)//amount of information of first level with base 2
+Ix_1= log(1/Px_1)/log(2)//amount of information content with base 10
+Ix_2= log(1/Px_2)/log(2)//amount of information content with base 10
+
+//results
+printf("\n\ni.Amount of information carried wrt to binary PCM 0 = %.2f bits",Ix_1);
+printf("\n\nii.Amount of information carried wrt to binary PCM 1 = %.2f bits",Ix_2);