Fig.1) The square wave signal should be smooth and without any distortion.
Fig.2,3)The CMPS falling(rising) edge is coincided with 3~5 tooth of the CKP from one longer signal(missing tooth)