SlideShare a Scribd company logo
2
Most read
3
Most read
6
Most read
HUFFMAN CODING
By: Mr. Nihal Kumar(Ass. Professor)
INTRODUCTION
 Huffman coding is a lossless data encoding
algorithm
 This is a method of reducing complex code
into simpler sequences and is common in
video encoding.
 This is a variable length and prefix free
coding.
PROCESS
 The source symbols are arranged in order of
decreasing probabilities(frequencies)
 Then the two least probabilities are assigned
to bit 0 & 1.
 Then combine last two symbols and move
the combined symbol as high as possible.
 Repeat the above step until two symbols left.
 Code for each symbol is found by moving
backward
CALCULATION
 Length of code
L = 𝑖=1
𝑛
𝑙𝑖 𝑃𝑖
 Entropy
H= 𝑖=1
𝑛
𝑃𝑖 log2
1
𝑃 𝑖
 Efficiency
𝜂 =
𝐻
𝐿
 Redundancy
𝛾 = 1 − 𝜂
EXAMPLE:
 𝑋 𝜖 {𝐴, 𝐵, 𝐶, 𝐷} with probabilities {
1
2
,
1
4
,
1
8
,
1
8
}
encode using Huffman Coding.
Length
1
2
3
3
 Length
L=
1
2
∗ 1 +
1
4
∗ 2 +
1
8
∗ 3 +
1
8
∗ 3
=
14
8
 Entropy
H=
1
2
log2
1
1 2
+
1
4
log2
1
1 4
+
1
8
log2
1
1 8
+
1
8
log2
1
1 8
= 14/8
 So efficiency
𝜂 =
𝐻
𝐿
=
14 8
14 8
= 1
Redundancy
𝛾 = 1 − 𝜂
= 0

More Related Content

PDF
Verilog VHDL code Multiplexer and De Multiplexer
PPT
Digital to analog conversion
PPTX
Shannon Capacity Theorem
PPTX
Pulse code modulation and Demodulation
PPTX
Angle modulation .pptx
PPTX
Pulse code modulation (PCM)
PPTX
Lecture Notes: EEEC6440315 Communication Systems - Inter Symbol Interference...
PPT
Communication systems v4
Verilog VHDL code Multiplexer and De Multiplexer
Digital to analog conversion
Shannon Capacity Theorem
Pulse code modulation and Demodulation
Angle modulation .pptx
Pulse code modulation (PCM)
Lecture Notes: EEEC6440315 Communication Systems - Inter Symbol Interference...
Communication systems v4

What's hot (20)

PPTX
linear codes and cyclic codes
PDF
UNIT-4 Baseband Digital Modulation.pdf
PPTX
Source coding theorem
PDF
Introduction to communication systems
PPT
Data Communication And Networking - DATA RATE LIMITS
PPT
Pluse amplitude modulatiion
PPT
Digital Communication: Channel Coding
PPTX
Amplitude shift keying
PDF
Digital base band modulation
DOCX
ingles t7 (1).docx
PPTX
PPTX
Reed solomon codes
PDF
Linear modulation
PPT
Angle modulation
PPTX
Comparison of Amplitude Modulation Techniques.pptx
PPTX
Digital modulation techniques
PPTX
Convolutional Error Control Coding
PPTX
Reed solomon code
linear codes and cyclic codes
UNIT-4 Baseband Digital Modulation.pdf
Source coding theorem
Introduction to communication systems
Data Communication And Networking - DATA RATE LIMITS
Pluse amplitude modulatiion
Digital Communication: Channel Coding
Amplitude shift keying
Digital base band modulation
ingles t7 (1).docx
Reed solomon codes
Linear modulation
Angle modulation
Comparison of Amplitude Modulation Techniques.pptx
Digital modulation techniques
Convolutional Error Control Coding
Reed solomon code
Ad

Similar to Huffman coding (20)

PDF
Sunzip user tool for data reduction using huffman algorithm
PPT
Huffman Coding
PPT
Huffman coding
PPTX
Huffman Algorithm By Shuhin
PDF
Introduction to Source Coding.pdf
PDF
Data compression huffman coding algoritham
PPT
hufman coding for compression algorithm.ppt
PPT
hufman code presentation and how to compress data using hufman code
PPT
compression & huffman coder problem .ppt
PPT
Huffman coding.ppt
PDF
Huffman Encoding Algorithm - Concepts and Example
PPTX
Huffman ppt
PPT
Huffman code presentation and their operation
PDF
Module-IV 094.pdf
PDF
Huffman and Arithmetic coding - Performance analysis
PDF
Implementation of Lossless Compression Algorithms for Text Data
PDF
12_HuffmanhsjsjsjjsiejjssjjejsjCoding_pdf.pdf
PPT
huffman Codes + Programming 5TH (part1).ppt
PPT
huffman Codes +5TH Programming (part1).ppt
Sunzip user tool for data reduction using huffman algorithm
Huffman Coding
Huffman coding
Huffman Algorithm By Shuhin
Introduction to Source Coding.pdf
Data compression huffman coding algoritham
hufman coding for compression algorithm.ppt
hufman code presentation and how to compress data using hufman code
compression & huffman coder problem .ppt
Huffman coding.ppt
Huffman Encoding Algorithm - Concepts and Example
Huffman ppt
Huffman code presentation and their operation
Module-IV 094.pdf
Huffman and Arithmetic coding - Performance analysis
Implementation of Lossless Compression Algorithms for Text Data
12_HuffmanhsjsjsjjsiejjssjjejsjCoding_pdf.pdf
huffman Codes + Programming 5TH (part1).ppt
huffman Codes +5TH Programming (part1).ppt
Ad

Recently uploaded (20)

PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Construction Project Organization Group 2.pptx
PDF
PPT on Performance Review to get promotions
PPT
Mechanical Engineering MATERIALS Selection
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPT
Project quality management in manufacturing
PPTX
Welding lecture in detail for understanding
PDF
Digital Logic Computer Design lecture notes
PPTX
web development for engineering and engineering
PPTX
Geodesy 1.pptx...............................................
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
CH1 Production IntroductoryConcepts.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
bas. eng. economics group 4 presentation 1.pptx
Foundation to blockchain - A guide to Blockchain Tech
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Construction Project Organization Group 2.pptx
PPT on Performance Review to get promotions
Mechanical Engineering MATERIALS Selection
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Project quality management in manufacturing
Welding lecture in detail for understanding
Digital Logic Computer Design lecture notes
web development for engineering and engineering
Geodesy 1.pptx...............................................
Model Code of Practice - Construction Work - 21102022 .pdf

Huffman coding

  • 1. HUFFMAN CODING By: Mr. Nihal Kumar(Ass. Professor)
  • 2. INTRODUCTION  Huffman coding is a lossless data encoding algorithm  This is a method of reducing complex code into simpler sequences and is common in video encoding.  This is a variable length and prefix free coding.
  • 3. PROCESS  The source symbols are arranged in order of decreasing probabilities(frequencies)  Then the two least probabilities are assigned to bit 0 & 1.  Then combine last two symbols and move the combined symbol as high as possible.  Repeat the above step until two symbols left.  Code for each symbol is found by moving backward
  • 4. CALCULATION  Length of code L = 𝑖=1 𝑛 𝑙𝑖 𝑃𝑖  Entropy H= 𝑖=1 𝑛 𝑃𝑖 log2 1 𝑃 𝑖  Efficiency 𝜂 = 𝐻 𝐿
  • 6. EXAMPLE:  𝑋 𝜖 {𝐴, 𝐵, 𝐶, 𝐷} with probabilities { 1 2 , 1 4 , 1 8 , 1 8 } encode using Huffman Coding. Length 1 2 3 3
  • 7.  Length L= 1 2 ∗ 1 + 1 4 ∗ 2 + 1 8 ∗ 3 + 1 8 ∗ 3 = 14 8  Entropy H= 1 2 log2 1 1 2 + 1 4 log2 1 1 4 + 1 8 log2 1 1 8 + 1 8 log2 1 1 8 = 14/8
  • 8.  So efficiency 𝜂 = 𝐻 𝐿 = 14 8 14 8 = 1 Redundancy 𝛾 = 1 − 𝜂 = 0