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):

enter image description here (V1 represents the function generator)

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)

  • 1
    \$\begingroup\$ Have you tried different diodes? Your frequency isn't that high but 4001 isn't very fast either. \$\endgroup\$
    – winny
    Jun 15, 2016 at 10:59
  • 3
    \$\begingroup\$ You might want to try familiarizing with how diodes work in real life, what parameters matter and what those are for the specific diode you have at hand \$\endgroup\$
    – PlasmaHH
    Jun 15, 2016 at 11:02
  • 1
    \$\begingroup\$ If all you're trying to do is get a positive pulse from a function generator, surely you could just adjust the function generator's offset knob such that its square wave output is centered at half of the output amplitude (2.5V for a 5V pulse)? \$\endgroup\$
    – brhans
    Jun 15, 2016 at 11:15
  • \$\begingroup\$ how about adding a small (470pF or something like that) cap to smoothen the edge off your signal. Btw. how you got LTSpice to show these negative spikes. For fun I tried your model and I dont get them to show up. \$\endgroup\$ Jun 15, 2016 at 11:49
  • \$\begingroup\$ @KarlKarlsom the diode is: .model 1N4001 D(Is=14.11n N=1.984 Rs=33.89m Ikf=94.81 Xti=3 Eg=1.11 Cjo=25.89p M=.44 Vj=.3245 Fc=.5 Bv=75 Ibv=10u Tt=5.7u Iave=1 Vpk=50 mfg=GI type=silicon) \$\endgroup\$
    – user16307
    Jun 15, 2016 at 11:52

2 Answers 2


Look up the reverse recovery time in the diode datasheet. The 1N400x series sssslllllooooowwwww. These are meant for 50/60 Hz power rectification, not for fast signals.

Either use a fast signal diode like the 1N4148, or a Schottky. Due to the physics of Schottky diodes, their reverse recovery time is very fast. It can often be considered 0 in ordinary applications. The general downsides to Schottky diodes is that they aren't available for high reverse voltages, and they have much higher reverse leakage than full silicon diodes, especially at high temperatures.


You may get a better understanding of what is happening if you show the generator's output. I suspect that what is happening is that stray capacitance on the output is being charged during the conduction phase and is discharging via the resistor in the non conducting phase. Altering the resistors value will change the shape of the negative pulse, increasing its value will widen the pulse shape while decreasing it will make it narrower. Remember that you are working with a voltage range of _5 to +5 not 0 to +5


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.