added waveform generation