Frequency and wavelength calculation