how energy related to frequency