Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Digital Communication GRP1 (1).pptx
1. DESCRIPTIONOF ITC MATLAB CODES
GROUP MEMBERS:
K BASAMMA-1DA21EC065
K GURUBASAVARAJ-1DA21EC066
KASHVI V-1DA21EC067
KAUSHIK REDDY S -1DA21EC068
KEERTHANA D – 1DA21EC069
KEERTHANA K – 1DA21EC070
KISHAN S P-1DA21EC72
KRISHNA B CHAVDA-1DA21EC073
KSHAMA R-1DA21EC074
LIKITH T S-1DA21EC075
2. HUFFMAN CODING
Huffman Code: is a way to encode information using
variable length string characters to represent the data
depending on how frequently they appear.
Huffman coding is a method of data compression which
works by looking at the data stream that makes up the file to
be compressed without losing any data. The data bytes that
occur most often are assigned a small code to represent
them. There are mainly two major parts in Huffman
Coding:
1. Build a Huffman Tree from input characters.
2. Traverse the Huffman Tree and assign codes to
characters.
3. In the Huffman tree an auxiliary
array is maintained. While
moving to the left ,we write 0 to
the array. While moving to the
right, we write 1 to the array. Next
we print the code in a top-bottom
approach.
Applications of Huffman Coding
1. They are used by conventional compression formats
like PKZIP, GZIP, etc.
2. They are used for transmitting fax and text.
3. Multimedia codes like JPEG, PNG, and MP3 use
Huffman encoding.
4. It is useful in cases where there is a series of frequently
occurring characters.
4. Algorithm of Huffman Coding
1. Start
2. Input the total number of possibilities
3. Arrange the messages in descending order of
probabilities.
4. Add the last two probabilities, and assign 0 and 1 bits to
them and sort out the total probabilities
5. If the addition is equal to the other probability, then put it
on the top
6. Repeat these steps until the addition is 1
7. To find a code for a particular symbol write the path of
the probability and its code ion a reverse approach
8. Find out its entropy, average code length and efficiency
9. Stop
13. HAMMING CODE
Hamming code is a set of error-correction codes that can
be used to detect and correct the errors that can occur
when the data is moved or stored from the sender to the
receiver. It encodes 4 bits of data into a 7 bit code word,
adding 3 parity bits for error detection and correction.
The parity bits are positioned at specific locations to
enable identification and correction of single bit errors.
Redundant bits:
Redundant bits are extra binary bits that are generated
and added to the information-carrying bits of data
transfer to ensure that no bits were lost during the data
transfer.
14. Parity bits:
A parity bit is a bit appended to a
data of binary bits to ensure that
the total number of 1’s in the
data is even or odd. Parity bits
are used for error detection.
Even parity bit: The number of 1’s are counted. If that
count is odd, the parity bit value is set to 1, making the total
count of occurrences of 1’s an even number. If the total
number of 1’s in a given set of bits is already even, the parity
bit’s value is 0.
Odd Parity bit: Here the number of 1’s are counted. If that
count is even, the parity bit value is set to 1, making the total
count of occurrences of 1’s an odd number. If the total
number of 1’s in a given set of bits is already odd, the parity
bit’s value is 0.
15. Features of Hamming Code
1. Error Detection and Correction
2. Redundancy
3. Efficiency
4. Widely Used
5. Single Error Correction
6. Limited Multiple Error Correction
16. Algorithm of Hamming code
1.Intialize the environment
2. Encode the data using Hamming (7,4) encoding
3. Simulate transmission errors by flipping bits in the
received data
4.Decode the received data using Hamming(7,4)
decoding
5.Display the original and the encoded data
6. Display the received data with the errors
7. Display the decoded data
8.End
17. MATLAB Program
Write a MATLAB program for encode binary data using a (7,4)
Hamming code and decode it.
data=[1 0 1 1;0 1 0 0;1 1 1 0;0 0 0 1];
Encoded_data=encode(data,7,4,'hamming/binary');
received_data=encoded_data;
received_data(1,3)=~received_data(1,3);
received_data(3,5)=~received_data(3,5);
decoded_data=decode(received_data,7,4,'hamming/binary');
disp('original data');
disp(data);
disp('encoded data');
disp(encoded_data);