modify the way to generate the waves usign phases