summaryrefslogtreecommitdiff
path: root/1895/CH11/EX11.1/EXAMPLE11_1.SCE
diff options
context:
space:
mode:
Diffstat (limited to '1895/CH11/EX11.1/EXAMPLE11_1.SCE')
-rwxr-xr-x1895/CH11/EX11.1/EXAMPLE11_1.SCE25
1 files changed, 25 insertions, 0 deletions
diff --git a/1895/CH11/EX11.1/EXAMPLE11_1.SCE b/1895/CH11/EX11.1/EXAMPLE11_1.SCE
new file mode 100755
index 000000000..d60e79a05
--- /dev/null
+++ b/1895/CH11/EX11.1/EXAMPLE11_1.SCE
@@ -0,0 +1,25 @@
+//ANALOG AND DIGITAL COMMUNICATION
+//BY Dr.SANJAY SHARMA
+//CHAPTER 11
+//Information Theory
+clear all;
+clc;
+printf("EXAMPLE 11.1(PAGENO 488)");
+//given
+
+Px_1=1/2;//probability 1
+Px_2=1/4;//probability 2
+Px_3=1/8;//probability 3
+Px_4=1/8;//probability 4
+
+//calculations
+Ix_1 = log2(1/(Px_1))//information content in first probability
+Ix_2 = log2(1/(Px_2))//information content in first probability
+Ix_3 = log2(1/(Px_3))//information content in first probability
+Ix_4 = log2(1/(Px_3))//information content in first probability
+
+//results
+printf("\n\ni. Information content of first symbol = %.2f bit",Ix_1);
+printf("\n\nii. Information content of second symbol = %.2f bits",Ix_2);
+printf("\n\niii. Information content of third symbol = %.2f bits",Ix_3);
+printf("\n\niV. Information content of fourth symbol = %.2f bits",Ix_4);