Fast peak detector with improved accuracy and linearity for high-frequency waveform processing