SlideShare a Scribd company logo
1 of 27
Download to read offline
Introduction to Data communication
Topic : LZ Algorithms
Lecture #14
Dr Rajiv Srivastava
Director
Sagar Institute of Research & Technology (SIRT)
Sagar Group of Institutions, Bhopal
http://www.sirtbhopal.ac.in
Unit 1
Lecture 14
2
Lampel ZIV (LZ) code
 The Lempel-Ziv algorithm is a variable-to-fixed length
code
 Basically, there are two versions of the algorithm
 LZ77 and LZ78 are the two lossless data compression
algorithms published by Abraham Lempel and Jacob Ziv
in 1977 & 1978. They are also known as LZ1 and LZ2
respectively.
 These two algorithms form the basis for many variations
including LZW, LZSS, LZMA and others. Besides their
academic influence, these algorithms formed the basis of
several ubiquitous compression schemes, including GIF
and the DEFLATE algorithm used in PNG.
 They are both theoretically dictionary coders.
 LZ77 keeps track of last n-bytes seen of data & when a
phrase is encountered that already has been seen, it outputs
a pair of values corresponding to the position of pharase in
previously seen buffer data & it moves a fixed size window
over data. It does so by maintaining a sliding window
during compression. This was later shown to be equivalent
to the explicit dictionary constructed by LZ78—however,
they are only equivalent when the entire data is intended to
be decompressed.
 LZ78 decompression allows random access to the input as
long as the entire dictionary is available, while LZ77
decompression must always start at the beginning of the
input.
 If we compare it Huffman code then we find the major
disadvantage of the Huffman code is that the symbol
probabilities must be known or estimated if they are
unknown.
 In addition to this, the encoder and Decoder must know
the coding tree.
 Moreover in the modeling text, the storage requirement
prevent the Huffman code from capturing the higher
order relationship between words and phrases.
• So we have to compromise the efficiency of
code.
• These practical limitation of Huffman code
can be overcome by using the lampel ZIV
algorithm.
• It is adaptive and simpler to implement as
compared to Huffman coding.
• Principal of Lampel ZIV algorithm
• To illustrate this principle let us consider the
example of an input binary sequence specified
as :
000101110010
The encoding in this algorithm is accomplished by parsing
the source data stream into segments that are the shortest
substances not encountered previously.
• We assume that the binary symbols 0 and 1 are
already stored in this order in the code book.
Hence we write,
subsequences stored : 0, 1
Data to be parsed : 000101110010
• Now examine the data in above equation from
LHS and find the shortest subsequence which is
not encountered previously. It is 00. so we
include 00 as the next entry in the subsequence
and move00 from data to subsequence as follow :
Subsequences stored : 0, 1, 00
Data to be parsed : 010110010
• The next shortest Subsequences which is not
previously repeated is 01. In above equation
Note that we are examining from LHS. Hence
we write,
Subsequences stored : 0, 1, 00, 01
Data to be parsed : 01110010
• The next shortest Subsequences which is
previously not encountered is 011. so we
write,
Subsequences stored : 0, 1, 00, 01,011
Data to be parsed : 10010
• Similarly we can continue until the data
stream has been completely parsed. The code
book of binary Subsequences gets ready as
shown in figure
Code book of Sequence
• The first row in the codebook shows the
numerical position of various subsequence in
the codebook.
Numerical
Position
1 2 3 4 5 6 7
Subsequences 0 1 00 01 001 10 010
• Numerical representation :
• Let us now add third row to figure. This row is
called as numerical representation as shown
in figure
Numerical
Position
1 2 3 4 5 6 7
Subsequences 0 1 00 01 011 10 010
Numerical
representation
11 12 42 21 41
The sequences 0 and 1 are originally stored. So
consider the third Subsequences i.e. 00. this is the
first Subsequences in the data stream and it is
made up of concatenation of the first
Subsequences i.e. 0 with itself.
Hence it is represented by 11 in the row of
numerical representation in above figure
Similarly, subsequences 01 obtained by
concatenation of first and second subsequences so
we enter 12 below that.
The remaining subsequences are treated
accordingly.
• Binary Encoded Representation :
• The last (4th ) row added as shown in figure, is
the binary encoded representation of each
subsequence.
Numerical
Position
1 2 3 4 5 6 7
Subsequences 0 1 00 01 011 10 010
Numerical
representation
11 12 42 21 41
Binary encoded
blocks
0010 0011 1001 0100 1000
• The question is how to obtain binary encoded
blocks.
• the last symbol of each subsequence in the
second row of above figure (called as
codebook) is called as an innovation symbol.
• So the last bit in each binary encoded block
(4th row) is the innovation symbol of the
corresponding subsequence,
The remaining bits provide the equivalent
i a y ep ese tatio of the poi te to the
oot su se ue e that at hes the o e i
question except for the innovation symbol.
This can be explained as follow.
1. Consider Numerical position 3 in figure. The
binary encoded block is 0010.
2. Consider Numerical position 5 in figure. It is
partially reproduced below.
• Row 1: Numerical position 3
• Row 2: Subsequence
• Row 4: Binary encoded Block
0 0
Innovation
number
001 0
This is the first
subsequence
Take as it is
Binary equivalent of
1(this is called pointer)
• Row 1: Numerical position 5
• Row 2: Subsequence
• Row 4: Binary encoded Block
01 1
Innovation
number
This is the 4th
subsequence
100 1
Binary equivalent of 4.
(this is called pointer)
Take as it is
 Consider the numerical position 6 in figure.
It is partially reproduced below.
 Row 1: Numerical position 6
 Row 2: Subsequence
 Row 4: Binary encoded Block
 Similarly the other entries in the fourth row are made.
1 0
Innovation
number
This is the 2nd
subsequence
010 0
Take as it is
Binary equivalent of 2.
(this is called pointer)
• Decoder
• The decoding is as simple encoding. The steps
followed at the time of decoding are as follows :
• Step 1 : Take the binary encoded block.
For example consider the binary encoded block in
position 5 i.e. 1001
• Step 2 : use the pointer to identify the root
subsequence :
• Binary encoded block
• Append the innovation symbol to the subsequence in
step 2:
Append the innovation number i.e. 1 to the root
subsequence of 01 to get the subsequence 011
corresponding to position 5.
100 1
Innovation
numberPointer = 4
Pointer value 4 corresponds
to 4th subsequence i.e. 01
Example: Determine the Lempel ZIV code for the following bit
steram
01001111100101000001010101100110000
Recover the original sequence from the encoded stream
• Soln.
• Part 1 : Encoding
• We assume that the binary symbols 0 and1 are
already stored in the code book.
Subsequences stored : 0, 1
• Encoding is accomplished by parsing the
source data stream into segment that are
shortest substances, not encountered
previously.
• The given stream of bits can be parsed into
subsequence as shown below :
0, 1, 00, 11, 111, 001, 01, 000, 0010, 10, 101,
100, 110, 000
• The encoding table is as shown in table
Part II Decoding
Consider the code for example
Numerical Position 1 2 3 4 5 6 7 8 9 10 11 12
Subsequences 0 1 00 11 111 001 01 000 0010 10 101 100
Numerical
representation
- - 11 22 42 32 12 31 61 21 102 100
code 0 1 0010 0101 1001 0111 0011 0110 1100 010
0
1010
1
1010
0
• Corre
• Ss
corresponding subsequence is 00
• The decoding table is shown in table
001 0
Innovation number
(do not change)
Pointer = 1
This value corresponds to 1st
subsequence is 0
• Decoding table.
• Thus we get the original sequence back
Code 0010 0101 1001 0111 0011 0110 1100 0100 10101 10100
Innovation bit 0 1 1 1 1 0 0 0 1 0
Pointer 001 010 100 011 001 011 110 010 1010 1010
Decoded
subsequence
0 0 1 1 1 1 1 0 0 1 0 1 0 0 0 0 010 1 0 1 0 1 1 0 0
Thank You
Dr Rajiv Srivastava
Director
Sagar Institute of Research & Technology (SIRT)
Sagar Group of Institutions, Bhopal
http://www.sirtbhopal.ac.in

More Related Content

What's hot

Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standardsMazin Alwaaly
 
Wavelet transform in image compression
Wavelet transform in image compressionWavelet transform in image compression
Wavelet transform in image compressionjeevithaelangovan
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image CompressionKalyan Acharjya
 
Linear Block Codes
Linear Block CodesLinear Block Codes
Linear Block CodesNilaNila16
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancyNaveen Kumar
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformationsYahya Alkhaldi
 
Arithmetic coding
Arithmetic codingArithmetic coding
Arithmetic codingVikas Goyal
 
Data Communication & Computer Networks : Unipolar & Polar coding
Data Communication & Computer Networks : Unipolar & Polar codingData Communication & Computer Networks : Unipolar & Polar coding
Data Communication & Computer Networks : Unipolar & Polar codingDr Rajiv Srivastava
 
Fundamentals of Data compression
Fundamentals of Data compressionFundamentals of Data compression
Fundamentals of Data compressionM.k. Praveen
 
digital image processing
digital image processingdigital image processing
digital image processingAbinaya B
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computersBảo Hoang
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image CompressionMathankumar S
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation modelAnupriyaDurai
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 

What's hot (20)

Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
 
Wavelet transform in image compression
Wavelet transform in image compressionWavelet transform in image compression
Wavelet transform in image compression
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 
Linear Block Codes
Linear Block CodesLinear Block Codes
Linear Block Codes
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancy
 
Computer Arithmetic
Computer ArithmeticComputer Arithmetic
Computer Arithmetic
 
Data encoding
Data encodingData encoding
Data encoding
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformations
 
Arithmetic coding
Arithmetic codingArithmetic coding
Arithmetic coding
 
Binary parallel adder
Binary parallel adderBinary parallel adder
Binary parallel adder
 
Data Communication & Computer Networks : Unipolar & Polar coding
Data Communication & Computer Networks : Unipolar & Polar codingData Communication & Computer Networks : Unipolar & Polar coding
Data Communication & Computer Networks : Unipolar & Polar coding
 
Fundamentals of Data compression
Fundamentals of Data compressionFundamentals of Data compression
Fundamentals of Data compression
 
digital image processing
digital image processingdigital image processing
digital image processing
 
Stop-and-Wait ARQ Protocol
Stop-and-Wait ARQ ProtocolStop-and-Wait ARQ Protocol
Stop-and-Wait ARQ Protocol
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computers
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 

Similar to Data Communication & Computer Networks : LZ algorithms

Physics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gatesPhysics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gatesbiswanath dehuri
 
Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)SITI SABARIAH SALIHIN
 
Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:Asif Iqbal
 
dtei-180910104911-converted.pptx
dtei-180910104911-converted.pptxdtei-180910104911-converted.pptx
dtei-180910104911-converted.pptxdeepaMS4
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001aarunachalamr16
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2Dr.MAYA NAYAK
 
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...inventionjournals
 
digital-electronics lecture Ch 1and 2 -1.pptx
digital-electronics lecture Ch 1and 2 -1.pptxdigital-electronics lecture Ch 1and 2 -1.pptx
digital-electronics lecture Ch 1and 2 -1.pptxabelllll
 
EC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's ComplementEC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's ComplementAmberSinghal1
 
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...Arti Parab Academics
 
data representation
 data representation data representation
data representationHaroon_007
 
Chapter 1 number and code system sss
Chapter 1 number and code system sssChapter 1 number and code system sss
Chapter 1 number and code system sssBaia Salihin
 

Similar to Data Communication & Computer Networks : LZ algorithms (20)

Lz algorithm
Lz algorithmLz algorithm
Lz algorithm
 
Physics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gatesPhysics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gates
 
Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:
 
Representation Of Numbers and Characters
Representation Of Numbers and CharactersRepresentation Of Numbers and Characters
Representation Of Numbers and Characters
 
dtei-180910104911-converted.pptx
dtei-180910104911-converted.pptxdtei-180910104911-converted.pptx
dtei-180910104911-converted.pptx
 
Dpsd lecture-notes
Dpsd lecture-notesDpsd lecture-notes
Dpsd lecture-notes
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001a
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2
 
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
 
digital-electronics lecture Ch 1and 2 -1.pptx
digital-electronics lecture Ch 1and 2 -1.pptxdigital-electronics lecture Ch 1and 2 -1.pptx
digital-electronics lecture Ch 1and 2 -1.pptx
 
DCF QNA edited
DCF QNA editedDCF QNA edited
DCF QNA edited
 
EC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's ComplementEC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's Complement
 
Number codes students
Number codes studentsNumber codes students
Number codes students
 
Alu1
Alu1Alu1
Alu1
 
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
 
data representation
 data representation data representation
data representation
 
Chapter 1 number and code system sss
Chapter 1 number and code system sssChapter 1 number and code system sss
Chapter 1 number and code system sss
 

More from Dr Rajiv Srivastava

Placement at sagar group Bhopal | SIRT College Bhopal
Placement at sagar group Bhopal  | SIRT College Bhopal Placement at sagar group Bhopal  | SIRT College Bhopal
Placement at sagar group Bhopal | SIRT College Bhopal Dr Rajiv Srivastava
 
How to Prepare for Group Discussion
How to Prepare for Group DiscussionHow to Prepare for Group Discussion
How to Prepare for Group DiscussionDr Rajiv Srivastava
 
SAGE GROUP - BEST ENGINEERING COLLEGE IN BHOPAL MP
SAGE GROUP - BEST ENGINEERING COLLEGE IN BHOPAL MP SAGE GROUP - BEST ENGINEERING COLLEGE IN BHOPAL MP
SAGE GROUP - BEST ENGINEERING COLLEGE IN BHOPAL MP Dr Rajiv Srivastava
 
Topic : X.25, Frame relay and ATM
Topic :  X.25, Frame relay and ATMTopic :  X.25, Frame relay and ATM
Topic : X.25, Frame relay and ATMDr Rajiv Srivastava
 
Topic : ISDN(integrated services digital network) part 2
Topic : ISDN(integrated services digital network) part 2Topic : ISDN(integrated services digital network) part 2
Topic : ISDN(integrated services digital network) part 2Dr Rajiv Srivastava
 
Topic: ISDN (Integrated Services Digital Network)
Topic: ISDN (Integrated Services Digital Network)Topic: ISDN (Integrated Services Digital Network)
Topic: ISDN (Integrated Services Digital Network)Dr Rajiv Srivastava
 
Topic: Virtual circuit & message switching
Topic: Virtual circuit & message switchingTopic: Virtual circuit & message switching
Topic: Virtual circuit & message switchingDr Rajiv Srivastava
 
Introduction to switching & circuit switching
Introduction to switching & circuit switchingIntroduction to switching & circuit switching
Introduction to switching & circuit switchingDr Rajiv Srivastava
 
Topic:Terminal handling & polling
Topic:Terminal handling & pollingTopic:Terminal handling & polling
Topic:Terminal handling & pollingDr Rajiv Srivastava
 
Applications of Time Division multiplexing : statistical TDM
Applications of  Time Division multiplexing : statistical TDMApplications of  Time Division multiplexing : statistical TDM
Applications of Time Division multiplexing : statistical TDMDr Rajiv Srivastava
 
Multiplexing : Wave Division Multiplexing
Multiplexing : Wave Division MultiplexingMultiplexing : Wave Division Multiplexing
Multiplexing : Wave Division MultiplexingDr Rajiv Srivastava
 
Data Communication & Computer network: Shanon fano coding
Data Communication & Computer network: Shanon fano codingData Communication & Computer network: Shanon fano coding
Data Communication & Computer network: Shanon fano codingDr Rajiv Srivastava
 
Data Communication & Computer Networks : LZW compression method
Data Communication & Computer Networks : LZW compression methodData Communication & Computer Networks : LZW compression method
Data Communication & Computer Networks : LZW compression methodDr Rajiv Srivastava
 

More from Dr Rajiv Srivastava (20)

Trends of it
Trends of itTrends of it
Trends of it
 
Placement at sagar group Bhopal | SIRT College Bhopal
Placement at sagar group Bhopal  | SIRT College Bhopal Placement at sagar group Bhopal  | SIRT College Bhopal
Placement at sagar group Bhopal | SIRT College Bhopal
 
How to Prepare for Group Discussion
How to Prepare for Group DiscussionHow to Prepare for Group Discussion
How to Prepare for Group Discussion
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
SAGE GROUP - BEST ENGINEERING COLLEGE IN BHOPAL MP
SAGE GROUP - BEST ENGINEERING COLLEGE IN BHOPAL MP SAGE GROUP - BEST ENGINEERING COLLEGE IN BHOPAL MP
SAGE GROUP - BEST ENGINEERING COLLEGE IN BHOPAL MP
 
lecture on data compression
lecture on data compressionlecture on data compression
lecture on data compression
 
Topic : X.25, Frame relay and ATM
Topic :  X.25, Frame relay and ATMTopic :  X.25, Frame relay and ATM
Topic : X.25, Frame relay and ATM
 
Topic : B ISDN
Topic : B ISDNTopic : B ISDN
Topic : B ISDN
 
Topic : ISDN(integrated services digital network) part 2
Topic : ISDN(integrated services digital network) part 2Topic : ISDN(integrated services digital network) part 2
Topic : ISDN(integrated services digital network) part 2
 
Topic: ISDN (Integrated Services Digital Network)
Topic: ISDN (Integrated Services Digital Network)Topic: ISDN (Integrated Services Digital Network)
Topic: ISDN (Integrated Services Digital Network)
 
Topic: Virtual circuit & message switching
Topic: Virtual circuit & message switchingTopic: Virtual circuit & message switching
Topic: Virtual circuit & message switching
 
Topic Packet switching
Topic Packet switchingTopic Packet switching
Topic Packet switching
 
Introduction to switching & circuit switching
Introduction to switching & circuit switchingIntroduction to switching & circuit switching
Introduction to switching & circuit switching
 
Topic:Terminal handling & polling
Topic:Terminal handling & pollingTopic:Terminal handling & polling
Topic:Terminal handling & polling
 
Topic: Spread Spectrum
Topic: Spread SpectrumTopic: Spread Spectrum
Topic: Spread Spectrum
 
Applications of Time Division multiplexing : statistical TDM
Applications of  Time Division multiplexing : statistical TDMApplications of  Time Division multiplexing : statistical TDM
Applications of Time Division multiplexing : statistical TDM
 
Multiplexing : Wave Division Multiplexing
Multiplexing : Wave Division MultiplexingMultiplexing : Wave Division Multiplexing
Multiplexing : Wave Division Multiplexing
 
Multiplexing : FDM
Multiplexing : FDMMultiplexing : FDM
Multiplexing : FDM
 
Data Communication & Computer network: Shanon fano coding
Data Communication & Computer network: Shanon fano codingData Communication & Computer network: Shanon fano coding
Data Communication & Computer network: Shanon fano coding
 
Data Communication & Computer Networks : LZW compression method
Data Communication & Computer Networks : LZW compression methodData Communication & Computer Networks : LZW compression method
Data Communication & Computer Networks : LZW compression method
 

Recently uploaded

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Recently uploaded (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 

Data Communication & Computer Networks : LZ algorithms

  • 1. Introduction to Data communication Topic : LZ Algorithms Lecture #14 Dr Rajiv Srivastava Director Sagar Institute of Research & Technology (SIRT) Sagar Group of Institutions, Bhopal http://www.sirtbhopal.ac.in
  • 3. Lampel ZIV (LZ) code  The Lempel-Ziv algorithm is a variable-to-fixed length code  Basically, there are two versions of the algorithm  LZ77 and LZ78 are the two lossless data compression algorithms published by Abraham Lempel and Jacob Ziv in 1977 & 1978. They are also known as LZ1 and LZ2 respectively.  These two algorithms form the basis for many variations including LZW, LZSS, LZMA and others. Besides their academic influence, these algorithms formed the basis of several ubiquitous compression schemes, including GIF and the DEFLATE algorithm used in PNG.
  • 4.  They are both theoretically dictionary coders.  LZ77 keeps track of last n-bytes seen of data & when a phrase is encountered that already has been seen, it outputs a pair of values corresponding to the position of pharase in previously seen buffer data & it moves a fixed size window over data. It does so by maintaining a sliding window during compression. This was later shown to be equivalent to the explicit dictionary constructed by LZ78—however, they are only equivalent when the entire data is intended to be decompressed.  LZ78 decompression allows random access to the input as long as the entire dictionary is available, while LZ77 decompression must always start at the beginning of the input.
  • 5.  If we compare it Huffman code then we find the major disadvantage of the Huffman code is that the symbol probabilities must be known or estimated if they are unknown.  In addition to this, the encoder and Decoder must know the coding tree.  Moreover in the modeling text, the storage requirement prevent the Huffman code from capturing the higher order relationship between words and phrases.
  • 6. • So we have to compromise the efficiency of code. • These practical limitation of Huffman code can be overcome by using the lampel ZIV algorithm. • It is adaptive and simpler to implement as compared to Huffman coding.
  • 7. • Principal of Lampel ZIV algorithm • To illustrate this principle let us consider the example of an input binary sequence specified as : 000101110010 The encoding in this algorithm is accomplished by parsing the source data stream into segments that are the shortest substances not encountered previously.
  • 8. • We assume that the binary symbols 0 and 1 are already stored in this order in the code book. Hence we write, subsequences stored : 0, 1 Data to be parsed : 000101110010 • Now examine the data in above equation from LHS and find the shortest subsequence which is not encountered previously. It is 00. so we include 00 as the next entry in the subsequence and move00 from data to subsequence as follow :
  • 9. Subsequences stored : 0, 1, 00 Data to be parsed : 010110010 • The next shortest Subsequences which is not previously repeated is 01. In above equation Note that we are examining from LHS. Hence we write, Subsequences stored : 0, 1, 00, 01 Data to be parsed : 01110010
  • 10. • The next shortest Subsequences which is previously not encountered is 011. so we write, Subsequences stored : 0, 1, 00, 01,011 Data to be parsed : 10010 • Similarly we can continue until the data stream has been completely parsed. The code book of binary Subsequences gets ready as shown in figure
  • 11. Code book of Sequence • The first row in the codebook shows the numerical position of various subsequence in the codebook. Numerical Position 1 2 3 4 5 6 7 Subsequences 0 1 00 01 001 10 010
  • 12. • Numerical representation : • Let us now add third row to figure. This row is called as numerical representation as shown in figure Numerical Position 1 2 3 4 5 6 7 Subsequences 0 1 00 01 011 10 010 Numerical representation 11 12 42 21 41
  • 13. The sequences 0 and 1 are originally stored. So consider the third Subsequences i.e. 00. this is the first Subsequences in the data stream and it is made up of concatenation of the first Subsequences i.e. 0 with itself. Hence it is represented by 11 in the row of numerical representation in above figure Similarly, subsequences 01 obtained by concatenation of first and second subsequences so we enter 12 below that. The remaining subsequences are treated accordingly.
  • 14. • Binary Encoded Representation : • The last (4th ) row added as shown in figure, is the binary encoded representation of each subsequence. Numerical Position 1 2 3 4 5 6 7 Subsequences 0 1 00 01 011 10 010 Numerical representation 11 12 42 21 41 Binary encoded blocks 0010 0011 1001 0100 1000
  • 15. • The question is how to obtain binary encoded blocks. • the last symbol of each subsequence in the second row of above figure (called as codebook) is called as an innovation symbol. • So the last bit in each binary encoded block (4th row) is the innovation symbol of the corresponding subsequence,
  • 16. The remaining bits provide the equivalent i a y ep ese tatio of the poi te to the oot su se ue e that at hes the o e i question except for the innovation symbol. This can be explained as follow. 1. Consider Numerical position 3 in figure. The binary encoded block is 0010. 2. Consider Numerical position 5 in figure. It is partially reproduced below.
  • 17. • Row 1: Numerical position 3 • Row 2: Subsequence • Row 4: Binary encoded Block 0 0 Innovation number 001 0 This is the first subsequence Take as it is Binary equivalent of 1(this is called pointer)
  • 18. • Row 1: Numerical position 5 • Row 2: Subsequence • Row 4: Binary encoded Block 01 1 Innovation number This is the 4th subsequence 100 1 Binary equivalent of 4. (this is called pointer) Take as it is
  • 19.  Consider the numerical position 6 in figure. It is partially reproduced below.  Row 1: Numerical position 6  Row 2: Subsequence  Row 4: Binary encoded Block  Similarly the other entries in the fourth row are made. 1 0 Innovation number This is the 2nd subsequence 010 0 Take as it is Binary equivalent of 2. (this is called pointer)
  • 20. • Decoder • The decoding is as simple encoding. The steps followed at the time of decoding are as follows : • Step 1 : Take the binary encoded block. For example consider the binary encoded block in position 5 i.e. 1001 • Step 2 : use the pointer to identify the root subsequence :
  • 21. • Binary encoded block • Append the innovation symbol to the subsequence in step 2: Append the innovation number i.e. 1 to the root subsequence of 01 to get the subsequence 011 corresponding to position 5. 100 1 Innovation numberPointer = 4 Pointer value 4 corresponds to 4th subsequence i.e. 01
  • 22. Example: Determine the Lempel ZIV code for the following bit steram 01001111100101000001010101100110000 Recover the original sequence from the encoded stream • Soln. • Part 1 : Encoding • We assume that the binary symbols 0 and1 are already stored in the code book. Subsequences stored : 0, 1
  • 23. • Encoding is accomplished by parsing the source data stream into segment that are shortest substances, not encountered previously. • The given stream of bits can be parsed into subsequence as shown below : 0, 1, 00, 11, 111, 001, 01, 000, 0010, 10, 101, 100, 110, 000 • The encoding table is as shown in table
  • 24. Part II Decoding Consider the code for example Numerical Position 1 2 3 4 5 6 7 8 9 10 11 12 Subsequences 0 1 00 11 111 001 01 000 0010 10 101 100 Numerical representation - - 11 22 42 32 12 31 61 21 102 100 code 0 1 0010 0101 1001 0111 0011 0110 1100 010 0 1010 1 1010 0
  • 25. • Corre • Ss corresponding subsequence is 00 • The decoding table is shown in table 001 0 Innovation number (do not change) Pointer = 1 This value corresponds to 1st subsequence is 0
  • 26. • Decoding table. • Thus we get the original sequence back Code 0010 0101 1001 0111 0011 0110 1100 0100 10101 10100 Innovation bit 0 1 1 1 1 0 0 0 1 0 Pointer 001 010 100 011 001 011 110 010 1010 1010 Decoded subsequence 0 0 1 1 1 1 1 0 0 1 0 1 0 0 0 0 010 1 0 1 0 1 1 0 0
  • 27. Thank You Dr Rajiv Srivastava Director Sagar Institute of Research & Technology (SIRT) Sagar Group of Institutions, Bhopal http://www.sirtbhopal.ac.in