Lempel-Ziv 77 source algorithm implementation. Where
encoded message (Mx3).
size of alphabet.
lookahead buffer size.
sliding window buffer size.
See also: lz77deco.
The following code
lz77enco ([0 0 1 0 1 0 2 1 0 2 1 0 2 1 2 0 2 1 0 2 1 2 0 0], 3, 9, 18)
Produces the following output
ans = 8 2 1 7 3 2 6 7 2 2 8 0
Package: communications