Wavelength measurement and calculation