A system for clock and data recovery includes a clock generator, a half-rate phase detector for receiving the input data, an encoder, a phase selector outputting recovered clock, a confidence counter, and a multiplexer outputting recovered data. The channel micromirrors are individually controllable and continuously pivotable to reflect the spectral channels into selected output ports. The pulse generator is coupled to the input clock for extracting a period of the input clock to generate a pulse, and the digital signal generator is coupled to the pulse generator for converting the pulse into a plurality of logic values. The multiplexer includes at least one control end receiving a selector signal for selecting one offset-correcting signal from the plurality of offset-correcting signals received according to the selector signal.