how to calculate frequency of a photon