Achieve -12~12V PWM Signal isolate
This circuit is for analog voltage with diode emission correction, to have precise analog isolation. 

For PWM signal you don't need something that fancy.

If you need an output with 0-5V, you have nothing to do, as the low edge will be blocked by the emitting diode, it would be 0 and thereof output 0, the positive edge will work as normal.

Just make sure the diode has a maximum reverse voltage above 12V, or add an additional external diode.