In addition, check the output of Q 1 first, the signal amplitude should be large enough, and the rising edge and falling edge should be as steep as possible (the magnification should be large enough to allow clipping).
It is suggested that the circuit composed of 74LS00 be changed into a single Schmidt gate circuit.
Hysteresis comparator is recommended for shaping, and the reference circuit is as follows: