A device comprising a light modulator including a plurality of elements wherein
each element is selectively operable such that the plurality of elements are dynamically
configurable to combine selected ones of a plurality of grating periods such that
selected portions of an incident light are directed into one or more distinct modes
wherein each distinct mode corresponds to a grating period. The device can be used
as a 1N wavelength selective switch and equalizer where N is the number of
output channels.