Differential phase-shift keying (DPSK) has been widely implemented and developed in high-speed optical communication systems. The low error rate detection at high access rate is one of the considerable issues in practical engineering application. Balanced detection based on fiber Mach-Zehnder delay interferometer (MZDI) is the typical optical DPSK signal detecting method. It requires that the free spectrum range (FSR) of the MZDI equals the reciprocal of symbol period of the DPSK signal. For the reasons of ambient temperature variation and nonlinear phase noise, a dynamic frequency offset always exists between the FSR and the reciprocal of symbol period. That may introduce some optical signal-to-noise ratio (OSNR) costs and fault detections. Therefore, it is significant to inhibit the frequency offset on DPSK detection. In this paper, firstly, we discuss the effects of frequency offset on DPSK detection, and realize the conclusion that frequency offset is virtually equivalent to an additional phase difference between adjacent symbols. Secondly, through simulation, we analyze the feasibility of DPSK detection in the presence of a definite range of frequency offset, and present the quantitative computation of effective coverage, duty cycle, and optimal sampling time of symbol interference. Some issues which should be considered in practical implementation are also discussed. Finally, according to the relationship among phase difference, temperature and voltage, we propose a phase difference compensation scheme which can automatically adjust the voltage for optimal detections, and dynamically track the changing of ambient temperature and nonlinear phase noise. Furthermore, we ascertain the performance of the voltage requested for implementing the scheme. The scheme can be also developed to quadrature phase-shift keying (QPSK) and differential QPSK (DQPSK) modulation situations.