finding the amplitude of a wave