The presence of harmonics in the fringe signal profile have different effects in the measured phase, depending on the algorithms used. The simultaneous presence of phase-shift error and harmonics will generate a phase error for all of the previous algorithms as well as for the standard N-sample algorithm, and make the problem more complicated. This paper presents a six-sample algorithm, which is almost insensitive to the phase-shift error, even if an important amount of second harmonics is present in the fringe signal.