Wavelength measurement and conversion