Wavelength demultiplexing using multilayer structures with frustrated total internal reflection