Add check if wave is changed

Do not reset phase if waveform is the same as before