Photonic analog-to-digital converter based on wavelength sampling and quantizing