Add calculation of frequencies for plotting the energies.