I did not like the resultant output waveform with the NAN values and broken graph lines. I modified the vi to clip the original signal at the limit input value (to have a continuous output waveform) or replace with 'NaN' values. I also added the options to invert the resultant and original waveforms independently.