Calculate the frequency of the photon