SOURCE ENCODER AND DECODER
Aim:
To select an information having in-equal probability of occurrence of each symbol or
having redundancy in the information and applying a source code using one of the
techniques i.e., Huffman coding, observing the size of the coded information, sending the
minimized packet, decoding at the receiving end getting back the full information sent.
Apparatus:
1. Source encoder and decoder kit
2. power supply
Theory:
when we have to transmit asset of symbols over a communication channels, normally
choose no. of bits to accommodate all the symbols for example 8 symbols can be coded using
3 bits, because 3 bits give us 2^3=8 combinations. With this type of normal binary
representation we can transfer any combination of symbols in any order. However if our
information to be transmitted has a set of symbols but the occurrence of symbols with
different frequencies we can employ a coding technique whereby we choose less number of
bits for the frequently occurring symbol and more bits for the less occurring symbol. This
way we can represent our information which is a sequence of symbols with less no. of bits
i.e., reduced size.
Huffman coding:
Huffman coding is based on the frequency of occurrence of a data item(pixel in images).
The principle is to use a lower number of bits to encode the data that occurs more frequently.
Codes are stored in a code book which may be constructed for each image or a set of images.
In all cases the code book plus the encoded data must be transmitted to enable decoding.
The Huffman algorithm is now briefly summarized:
A bottom up approach
1. Initialization: Put all the nodes in an open list,keep it stored at all times(e.g., ABCDE).
2. Repeat until the OPEN list has one node left:
(a) From OPEN pick two nodes having the lowest probabilities, create a parent node of them.
(b) Assign the sum of the childern’s probabilities to the parent node and insert it into OPEN.
(c) Assign code 0,1 to the two branches of the tree, and delete the children from OPEN.
Let us take an example that we wish to transmit a word ABRAKADABRA, Which has 5 types
of symbols A,B,R,K,D.
In normal coding to represent one of the 5 symbols we need 3 bits.
To transmit this 11 characters we will need 11*3=33 bits.
However by employing Huffman coding as below we can transmit the information using only
23 bits.
Circuit diagram:
Procedure:
1. Student has to observe the signal chain.
2. Then verify how many bits are taken to transmit ABRAKADABRA in normal and source
coded mode.
3. To send an input symbol, push any one of the input symbol keys, to transmit a letter A,
student has to press the key marked A.
4. Observe how many bits are being transmitted for this key. And the bit code for the same
and noted down the bits being transmitted on the LEDs.
5. Observe if the corresponding output LED is glows corresponding to the symbol pressed
at the input.
6. Pushing the demo mode switch will give a brief description of implementation of kit.
Observations:
Result:
Encoding and decoding operations of source encoding and decoding was observed using
HUFFMAN CODING technique.