A general method of designing phase-shifting algorithms for grating lateral shearing interferometry