I'm trying to obtain a pulse from a square-wave of a function generator. I thought it is an easy straightforward thing. So in this case the square-wave is +5V to -5V. I use a 1N4001 diode and a 220 Ohm series resistor.
As you see in the below simulation output will go to a comparator's input. Green plot is the output voltage (Out):
But I'm having those negative spikes during falling edges both in scope and in simulation.
My questions are:
1-) How can I prevent those negative spikes? I need around zero volt during OFF time of the pulse without such spikes. Why do these spikes occur?
2-) Is 220 Ohm okay or better to use 50 Ohm? (Im asking because at the output of the function generator it is written 50 Ohm)