Optical filtering by leaky waveguides