This is what run-length encoding requires. Correspondingly, delta encoding followed by Huffman and/or run-length encoding is a common strategy for compressing signals. LZW compression is named after ...
LZW Encoding The LZW algorithm encodes variable length strings of symbols as single codes (see the Code Listing). It’s based on a progressive, grammatical analysis of incoming symbols. The coding ...