A phase calculation method using discrete Fourier series (DFS) is proposed to eliminate the effects of nonsinusoidal characteristics. In this method, the fundamental coefficients are extracted from continuous N samples in one cycle by DFS, with which four images with π/2 intervals are reconstructed, and then more accurate phase distribution can be further obtained. This method is applicable for improving the precision of the traditional phase-shifting algorithm. Its effectiveness and accuracy are verified by computer simulations and moiré fringe and projecting fringe experiments with about 85% of the phase error reduced compared with a four-step phase-shifting algorithm, about 70% reduction compared with a 16-step phase-shifting algorithm.