Optical device for generating pulsed light