PWM on phototransistor
I think that its not a spike, and because it is a photo transistor. The transistor is slow, after a spike, the photo transistor lowers the voltage/current. It is recommended to use a laser, just use a mosfet. Then connect it to a laser, and on the output, just put an led, right into a common transistor, (you might need an op amp to amplify the led signal)