Added TrapezoidalFilter function that allows the user to extract the maximum directly without looping over the waveform again.