diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /1895/CH11/EX11.54 | |
download | Scilab-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.54')
-rwxr-xr-x | 1895/CH11/EX11.54/EXAMPLE11_54.SCE | 23 |
1 files changed, 23 insertions, 0 deletions
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)
|