* SPICE netlist
V1 N001 0 PULSE(-305 305 0 8ms 8ms 2ms 20ms 50)
C1 N002 N001 100n
R1 N002 N001 1Meg
XU1 N004 0 N009 0 NC_01 4N25 ;pnba A)K)C)E)B
R2 N005 N009 10k
R3 N006 N009 100k
C2 N006 0 100n
V2 N005 0 3V3
V3 N012 0 SINE(0 100 50 4ms)
R5 N001 N012 1
XU2 N010 N006 N005 0 N007 LT1006 ;pnba In+)In-)V+)V-)OUT
R7 N007 N010 16k9
R6 N005 N010 10k
R8 N010 0 10k
R9 N008 N007 100
C3 N008 0 100n
V4 NC_02 0 PULSE(0 400 0.95 1u)
R10 N004 N003 470
R4 N003 N002 47
D3 N003 N011 D
D4 0 N003 D
V5 N011 0 9
.tran 0 1 0.9

* LTspice schematic (.asc)
Version 4
SHEET 1 2624 400
WIRE -1136 -184 -1312 -184
WIRE -944 -184 -1136 -184
WIRE -608 -184 -944 -184
WIRE -576 -184 -608 -184
WIRE -464 -184 -512 -184
WIRE -416 -184 -464 -184
WIRE -272 -184 -336 -184
WIRE -224 -184 -272 -184
WIRE 80 -184 -144 -184
WIRE 704 -184 384 -184
WIRE 784 -184 704 -184
WIRE 1312 -184 784 -184
WIRE 704 -168 704 -184
WIRE 384 -136 384 -184
WIRE -272 -120 -272 -184
WIRE -208 -120 -272 -120
WIRE -608 -104 -608 -184
WIRE -576 -104 -608 -104
WIRE -464 -104 -464 -184
WIRE -464 -104 -496 -104
WIRE -208 -88 -208 -120
WIRE 784 -72 784 -184
WIRE -1136 -56 -1136 -184
WIRE 752 -56 576 -56
WIRE 864 -40 816 -40
WIRE 896 -40 864 -40
WIRE 1008 -40 976 -40
WIRE 1312 -40 1312 -184
WIRE 80 -24 80 -184
WIRE 112 -24 80 -24
WIRE 384 -24 384 -56
WIRE 384 -24 304 -24
WIRE 448 -24 384 -24
WIRE 576 -24 576 -56
WIRE 576 -24 528 -24
WIRE 704 -24 704 -88
WIRE 752 -24 704 -24
WIRE -272 40 -272 -120
WIRE -208 40 -208 -24
WIRE 384 40 304 40
WIRE 1008 40 1008 -40
WIRE 576 56 576 -24
WIRE 704 56 704 -24
WIRE 736 56 704 56
WIRE 864 56 864 -40
WIRE 864 56 816 56
WIRE 112 72 80 72
WIRE -1136 88 -1136 24
WIRE -944 88 -944 -184
WIRE 704 88 704 56
WIRE -1312 200 -1312 168
WIRE -1136 200 -1136 168
WIRE -1136 200 -1312 200
WIRE -944 200 -944 168
WIRE -944 200 -1136 200
WIRE -832 200 -944 200
WIRE -272 200 -272 104
WIRE -272 200 -832 200
WIRE -208 200 -208 120
WIRE -208 200 -272 200
WIRE 80 200 80 72
WIRE 80 200 -208 200
WIRE 384 200 384 40
WIRE 384 200 80 200
WIRE 576 200 576 120
WIRE 576 200 384 200
WIRE 704 200 704 168
WIRE 704 200 576 200
WIRE 784 200 784 -8
WIRE 784 200 704 200
WIRE 1008 200 1008 104
WIRE 1008 200 784 200
WIRE 1312 200 1312 40
WIRE 1312 200 1008 200
FLAG -832 200 0
SYMBOL voltage -944 72 R0
SYMATTR InstName V1
SYMATTR Value PULSE(-305 305 0 8ms 8ms 2ms 20ms 50)
SYMBOL cap -512 -200 R90
SYMATTR InstName C1
SYMATTR Value 100n
SYMBOL res -480 -120 R90
SYMATTR InstName R1
SYMATTR Value 1meg
SYMBOL Optos\\4N25 208 40 R0
SYMATTR InstName U1
SYMBOL res 368 -152 R0
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL res 544 -40 R90
SYMATTR InstName R3
SYMATTR Value 100k
SYMBOL cap 560 56 R0
SYMATTR InstName C2
SYMATTR Value 100n
SYMBOL voltage 1312 -56 R0
SYMATTR InstName V2
SYMATTR Value 3V3
SYMBOL voltage -1136 72 R0
SYMATTR InstName V3
SYMATTR Value SINE(0 100 50 4ms)
SYMBOL res -1152 -72 R0
SYMATTR InstName R5
SYMATTR Value 1
SYMBOL Opamps\\LT1006 784 -104 R0
SYMATTR InstName U2
SYMBOL res 832 40 R90
SYMATTR InstName R7
SYMATTR Value 16k9
SYMBOL res 688 -184 R0
SYMATTR InstName R6
SYMATTR Value 10k
SYMBOL res 688 72 R0
SYMATTR InstName R8
SYMATTR Value 10k
SYMBOL res 992 -56 R90
SYMATTR InstName R9
SYMATTR Value 100
SYMBOL cap 992 40 R0
SYMATTR InstName C3
SYMATTR Value 100n
SYMBOL voltage -1312 72 R0
SYMATTR InstName V4
SYMATTR Value PULSE(0 400 0.95 1u)
SYMBOL res -128 -200 R90
SYMATTR InstName R10
SYMATTR Value 470
SYMBOL res -320 -200 R90
SYMATTR InstName R4
SYMATTR Value 47
SYMBOL diode -224 -88 R0
SYMATTR InstName D3
SYMBOL diode -256 104 R180
SYMATTR InstName D4
SYMBOL voltage -208 24 R0
SYMATTR InstName V5
SYMATTR Value 9