blob: 1b0d7d0ff24f2c8003482b5dd5b1655bd26e273c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
//ANALOG AND DIGITAL COMMUNICATION
//BY Dr.SANJAY SHARMA
//CHAPTER 11
//Information Theory
clear all;
clc;
printf("EXAMPLE 11.19(PAGENO 502)");
//given
//from fig
P_X = [.5 .5]//x matrix
P_Xd = [.5 0; 0 .5]//diagonal x matrix
//calculations
P_YX = [.9 .1; .2 .8];//yx matrix representation of given fig
P_Y = P_X*P_YX//y matrix
P_XY = P_Xd * P_YX//xy matrix
//results
printf("\n\ni.Channel matrix of the channelP_YX ");
disp(P_YX);
printf("\n\nii.a.P(y1) = %.2f",P_Y(1,1));
printf("\n\n b.P(y2) = %.2f",P_Y(1,2));
printf("\n\niii.a.P(x1,y2) = %.2f",P_XY(1,2));
printf("\n\n b.P(x2,y1) = %.2f",P_XY(2,1));
|