Characterization of 1D diffractive optical elements by phase inversion