From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1895/CH11/EX11.54/EXAMPLE11_54.SCE | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 1895/CH11/EX11.54/EXAMPLE11_54.SCE (limited to '1895/CH11/EX11.54') diff --git a/1895/CH11/EX11.54/EXAMPLE11_54.SCE b/1895/CH11/EX11.54/EXAMPLE11_54.SCE new file mode 100755 index 000000000..9dfaf057b --- /dev/null +++ b/1895/CH11/EX11.54/EXAMPLE11_54.SCE @@ -0,0 +1,23 @@ +//ANALOG AND DIGITAL COMMUNICATION +//BY Dr.SANJAY SHARMA +//CHAPTER 11 +//Information Theory +clear all; +clc; +printf("EXAMPLE 11.54(PAGENO 537)"); + +//given +P_x1 = 1/3//probability of first signal +P_x2 = 1/6//probability of second signal +P_x3 = 1/4//probability of third signal +P_x4 = 1/4//probability of fourth signal + +//calculations +I_x1 = -log2(P_x1); +I_x2 = -log2(P_x2); +I_x3 = -log2(P_x3); +I_x4 = -log2(P_x4); +H_x = P_x1*I_x1 + P_x2*I_x2 + P_x3*I_x3 + P_x4*I_x4 //entropy + +//results +printf("\n\nEntropy of the source = %.5f bits/symbol ",H_x) -- cgit