Active-grating monochromator for the spectral selection of ultrashort pulses