Finished waveform generator algorithm