Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

BIRZEIT UNIVERSITY

Faculty of Engineering and technology


Electrical and computer Engineering Department

Information and Coding Theory (5304)


Project I
Channel encoding

Student’s Name.: Samer Mukhamiar Student’s No.: 1110727

Instructor.: Dr. Wasfi AlKafri Section No.: (“ 1“)

Date: 14/4/2015

The Question:
The Matrix
0.5 0.3 0.2
0.2 0.5 0.3
0.3 0.2 0.5
Encode this Channel?
Encode the second extension?

The main objective of the Project is Encode the channel and the second extension
of the channel

To Solve the Question


First the Joint probability As Given P (a1) =P (a2) =0.25 And P (a3) = 0.5
Using the Code below
symbols=[1:3]
p=[0.25 0.25 0.5]
[dict,avglen]=huffmandict(symbols,p)

The Average length were obtained from matlab


avglen = 1.5000

The code given


(The most probability has least code word)
P1 has code word of 1 1
P2 has code word of 1 0
P3 has code word of 0

To generate Message I will assume that I have trinary System


With these message signal [1,2,2,3,1,3,1,1,3,2,3,3,2] repeated 5 times

To Decode the data


sig=repmat([1,2,2,3,1,3,1,1,3,2,3,3,2],1,50)
symbols=[1:3]
p=[0.25 0.25 0.5]
[dict,avglen]=huffmandict(symbols,p)
hcode=huffmanenco(sig,dict)
plot(hcode)
the Input codes to the channel as seen in the figure below

Fig (1) The input signal

By plotting the decode Data this figure was obtained (Using Huffman Decoding)

Fig (2)The coded signal

Then this code was used to decode the channel to receive the original signal
dhsig=huffmandeco(hcode,dict)
Fig (3)The received signal

The second extension of the Matrix


By using the Kronecker tensor product

For second extension


The code below was used

a=[0.25 0.25 0.5];


c=kron(a,a)

The Matrix which means the second extension


c=[ 0.0625 0.0625 0.1250 0.0625 0.0625 0.1250 0.1250 0.1250 0.2500]

The Summation of c= 1 which means the second extension is right

The average length is equal to 3


And the coded given
1 [1,1,0,1]
2 [1,1,0,0]
3 [0,0,1]
4 [1,1,1,1]
5 [1,1,1,0]
6 [0,0,0]
7 [0,1,1]
8 [0,1,0]
9 [1,0]

The proof:
In order to proof we have to find to find the H(B/A)

The entropy for the first part= 0.9183 with average length 1.5
For the second extension = 1.5921 with average length 3

By the end of the project, we proof that the H(B/A)< Average length

You might also like