how is the amplitude of a wave related to its energy