A clock and phase detect algorithm detects the best sample result for
back-end system to recover the sample clock from front-end system. The
algorithm of the present invention gets the sample result from ADC by
applying slope variation sum (SPVS), which is used in turning points of
sample result. The exact sample clock will always get the maximum SPVS
value no matter how special or difficult the pattern is. It can detect
not only most of normal patterns, but also the special patterns like
block, linear piece pattern. The use of SPVS result allows back-end
systems to distinguish which clock is the exact clock to sample the
analog signal, and make the back-end convert quality is almost the same
as the front-end. This function can be operated by system maker and
maintain the quality of display automatically, no manual operation is
need.