The development of any data compression algorithm for a variety of data can be divided into two phases, which are Modeling and Coding.

Modeling
  • In this phase, we try to extract information about any redundancy or similarity that exists in the data and describe the redundancy of data in the form of a model.
  •  This model acts as the basis of any data compression algorithm and the performance of any algorithm will depend on how well the model is being formed.
Coding
  • This is the second phase. It is the description of the model and a description of how the data different from the model is encoded, generally encoding is done using binary digits.
  • For example, consider the following sequence of numbers: 9, 10, 11, 12, 13. By examining and exploiting the structure of data in a graph paper it seems to be a straight line, so we modeled it with the equation, x = n + 9, where n = 0,1,2,3...