Distortion of gaussian pulses by a diffraction grating