how to find energy from frequency