A detector includes a light detecting layer and a grating structure. The
light detecting layer, which can be a photodiode, has an optical mode
that resonates in the light detecting layer, and the grating structure is
positioned to interact with the optical mode. The grating structure
further couples incident light having a resonant frequency into the
optical mode, and causes destructive interference to prevent light having
the resonant frequency from escaping the detecting layer. The light
detecting layer can be made transparent to light having other
frequencies, so that a stack of such detectors, each having a different
resonant frequency, can be integrated into a WDM detector that is compact
and efficient.