diff options
Diffstat (limited to '851/CH2/EX2.6')
-rwxr-xr-x | 851/CH2/EX2.6/Example2_6.sce | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/851/CH2/EX2.6/Example2_6.sce b/851/CH2/EX2.6/Example2_6.sce new file mode 100755 index 000000000..70a69f628 --- /dev/null +++ b/851/CH2/EX2.6/Example2_6.sce @@ -0,0 +1,20 @@ +//clear//
+//Caption:Channel Capacity of a Binary Symmetric Channel
+//Example2.6:Channel Capacity of Binary Symmetri Channel
+clear;
+close;
+clc;
+p = 0:0.01:0.5;
+for i =1:length(p)
+ if(i~=1)
+ C(i) = 1+p(i)*log2(p(i))+(1-p(i))*log2((1-p(i)));
+ elseif(i==1)
+ C(i) =1;
+ elseif(i==length(p))
+ C(i)=0;
+ end
+end
+plot2d(p,C,5)
+xlabel('Transition Probility, p')
+ylabel('Channel Capacity, C')
+title('Figure 2.10 Variation of channel capacity of a binary symmetric channel with transition probility p')
|