Measurement of phase shift of photorefractive gratings by a novel method