A new optical encoder system is presented for displacement measurement by the curve fitting method. In this paper, another pondering model is based on the previous development. That is the new measurement method using a homemade periodical gray level code, which can be used to replace the traditional doublet grating. A high precision is achieved by a fitting method with one single-frequency harmonic function. The experiment result shows that the concept is feasible.