In: Computer Science
2. Assume that the Lempel-Ziv (Dictionary) is applied to a
source which emits
{1,2,3}. The source output is given by
1233221233112233344.
(a) Please apply the Lempel-Ziv coding, show how you applied?
(b) Please write down the transmission sequence?
(c) Please explain how you decode the transmission sequence that
you have in the pre-
vious part?
(a) After applying the lempel-Ziv coding we get the following output:-
1, 2, 3, 32, 21 ,23, 31, 12, 233, 34 ,4
the transmission is done according to the 3 bits as in the question it emits {1, 2, 3} which signifies 3-bit operation.
So, whenever we traverse the output string i.e
(1233221233112233344) we check for the previous occurrences and if there are no previous occurrences then we write n the following output code. so the first value is 1 and there is no previous 1 so we write 1and separate it with a comma 1, and next, we have the value 2 so we write 1, 2 and similarly after the output 1,2,3 we can see that is present before in the output so we check for another value including the previous value so here we have 32 and in the output, it is not present therefore the new sequence of output will be
1,2,3,32
and similarly, this process goes on until the last bit.
b) The transmission sequence is
1, 2, 3, 32, 21 ,23, 31, 12, 233, 34 ,4
c)
dictionary location - content(or transmission sequence ) - decoding(code word)
001 - 1 - 0001
010 - 2 - 0002
011 - 3 - 0003
100 - 32 - 0112
101 - 21 - 0101
110 - 23 - 0103
111 - 31 - 0111
12 - 0012
233 - 1103
34 - 0114
4 - 0004
As you can see that in the dictionary location at 000 no content is stored so we have taken the location from 001 and write it accordingly.
so for the 1,2,3 content values, we have to write the digit and there is no prefix present so write 000 for that so for one of the decoded values is 0001 similarly for 2 and 3 and now for 32, the suffix is 2 and prefix 3 is present on 011 dictionary location so our final output is 0112.
So this is the way how decoding works.
i hope you will like my response, and please don't forget to give thumbs up!!
if you have any query, do share in comment box!!
Stay safe and healthy!!
Thank you!!!