oscgen: finished code for processing waveforms