Code to perform trpezoidal filtering of digitized waveforms