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.55/EXAMPLE11_55.SCE | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 1895/CH11/EX11.55/EXAMPLE11_55.SCE (limited to '1895/CH11/EX11.55/EXAMPLE11_55.SCE') diff --git a/1895/CH11/EX11.55/EXAMPLE11_55.SCE b/1895/CH11/EX11.55/EXAMPLE11_55.SCE new file mode 100755 index 000000000..ea4cfd0bc --- /dev/null +++ b/1895/CH11/EX11.55/EXAMPLE11_55.SCE @@ -0,0 +1,25 @@ +//ANALOG AND DIGITAL COMMUNICATION +//BY Dr.SANJAY SHARMA +//CHAPTER 11 +//Information Theory +clear all; +clc; +printf("EXAMPLE 11.55(PAGENO 538)"); + +//given +P_x1 = 1/2//probability of first signal +P_x2 = 1/4//probability of second signal +P_x3 = 1/8//probability of third signal +P_x4 = 1/16//probability of fourth signal +P_x5 = 1/16//probability of fifth signal +n1 = 1//number of bits in code obtained from table given textbook +n2 = 2//number of bits in code obtained from table given textbook +n3 = 3//number of bits in code obtained from table given textbook +n4 = 4//number of bits in code obtained from table given textbook +n5 = 4//number of bits in code obtained from table given textbook + +//calculations +L = P_x1*n1 + P_x2*n2 + P_x3*n3 + P_x4*n4 + P_x5*n5;//Average number of bits per message + +//results +printf("\n\nAverage number of bits per message = %.2f bits",L); -- cgit