A novel demodulation scheme for interferometers with optical phase modulation is described. The optical phase shift is measured by mixing a train of square digital pulses with a photodetector current and adjusting the pulse spacing by using an electronic closed loop. The optical phase shift is tracked with deviation less than 0.007 rad, which can be easily corrected by using a look-up table. An experimental optically open-loop fiberoptic gyroscope that uses this demodulation shows a linear scale factor in good agreement with theory.