For ultrasonic echo signals, to analyze the maximum peak ± 1 period error in the cross-correlation measurement of the finite sequence, to propose a method to increase the ratio of the maximum peak and the adjacent peak, and to avoid the periodic deviations in the maximum cross-correlation peaks. This method uses a dual-frequency excitation signal and a selective envelope with a triangular fast decay reference signal. it uses 70% of the positive and negative maximum allowable deviation values as the excitation signal frequencies f1 and f2, the first N cycles of pulse of the excitation signal is frequency f1, and the next N cycles of pulse is the frequency f2; The reference signal uses the a transcendental waveform with triangular fast decay envelope, which also has the dual-frequency characteristics with the first M cycles as the frequency f1, and the next M cycles as the frequency f2, to increase the ratio between maximum peak and adjacent peak, effectively avoiding the maximum peak ± 1 cycle error. The experimental data verify that the maximum peak and adjacent peak ratios can be increased from 1.0049 to 1.0561 under single frequency circumstances and the probability of periodic deviations is reduced from 20.0% to 1.0%. The periodic deviations in cross-correlation measurement can be completely solved with a simple sliding filter algorithm and the measurement reliability of cross-correlation algorithm can be improved.