added the waveform processing