simplified wave so as to return :: Double -> Double