A spectra generator having an electrically programmable diffraction
grating. There may be a broad band light source that emits light which is
diffracted by the grating. Diffracting elements in the grating may be
individually adjustable so that generation of a specific spectrum or
spectra may be achieved. The diffracting elements may be adjusted
according to electrical signals of a program from a computer. The
generated synthetic spectra may be used for testing and calibration of
spectrometers or other devices. Synthetic spectra may also be used for
scene generation and other purposes.