Trouble with rectifying a pulse with a diode
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.