* SPICE netlist
Q1 CA INA N006 0 2N3904
R1 N006 N008 {Rfb}
R2 N007 N008 {Rfb}
Q2 CB INB N007 0 2N3904
R13 V+ CB {Rt}
R14 V+ CA {Rt}
VP V+ 0 {Va}
VN 0 V- {Va}
VINA INA 0 PWL file=ampl_train.pwl AC 0.5
VINB INB 0 0 AC -0.5
VP1 VCC 0 3.3
I1 N008 V- {Iset}
R3 N003 N002 {Rfb2}
R4 N004 N002 {Rfb2}
R5 0 OA {Rt2}
R6 0 OB {Rt2}
Q3 OB N005 N003 0 2N3906
Q4 OA N001 N004 0 2N3906
I2 V+ N002 {Iset2}
Q5 V+ CA N001 0 2N3904
Q6 V+ CB N005 0 2N3904
R7 N001 0 4.7k
R8 N005 0 4.7k
;.dc VINA -100m 100m 0.1m
.dc VINA -100m 100m 0.1m
;.step temp -25 125 25
;.step param Rfb 0.01m 100 10
.param Rfb=Rt/sqrt(sqrt(2)*gain)
.param Rt=Va/Iset
.param Iset = 7m
.param Va = 12
.param Rt2=cm_out*2/Iset2
;.step param Va 8 16 1
.param gain=40
.param Rfb2=Rt2/sqrt(sqrt(2)*gain)
.param cm_out=0.6
.param Iset2 = Iset
;.step param iset 5m 20m 1m

* LTspice schematic (.asc)
Version 4.1
SHEET 1 2032 2000
WIRE -968 -1000 -1016 -1000
WIRE -920 -1000 -968 -1000
WIRE -808 -1000 -856 -1000
WIRE -776 -1000 -808 -1000
WIRE -600 -1000 -680 -1000
WIRE -376 -1000 -600 -1000
WIRE -136 -1000 -184 -1000
WIRE -88 -1000 -136 -1000
WIRE -440 -936 -504 -936
WIRE -376 -936 -440 -936
WIRE -1016 -872 -1016 -1000
WIRE -856 -872 -856 -1000
WIRE -680 -872 -680 -1000
WIRE -504 -872 -504 -936
WIRE -184 -872 -184 -1000
WIRE -808 56 -856 56
WIRE -504 56 -808 56
WIRE -312 56 -504 56
WIRE 8 56 -312 56
WIRE 168 56 8 56
WIRE 584 56 168 56
WIRE 1016 56 584 56
WIRE 584 120 584 56
WIRE -504 136 -504 56
WIRE -312 136 -312 56
WIRE 8 216 8 56
WIRE -504 264 -504 216
WIRE -232 264 -504 264
WIRE -56 264 -232 264
WIRE 824 264 376 264
WIRE 584 328 584 200
WIRE 584 328 472 328
WIRE 664 328 584 328
WIRE 168 344 168 56
WIRE -312 392 -312 216
WIRE -232 392 -312 392
WIRE 104 392 -232 392
WIRE 472 392 472 328
WIRE 664 392 664 328
WIRE -504 440 -504 264
WIRE -312 440 -312 392
WIRE -888 488 -936 488
WIRE -568 488 -888 488
WIRE -152 488 -248 488
WIRE 472 520 472 472
WIRE 664 520 664 472
WIRE 8 536 8 312
WIRE 376 536 376 264
WIRE 376 536 8 536
WIRE 168 568 168 440
WIRE 408 568 168 568
WIRE 824 568 824 264
WIRE 824 568 728 568
WIRE -504 584 -504 536
WIRE -312 584 -312 536
WIRE 664 712 664 616
WIRE 744 712 664 712
WIRE 936 712 744 712
WIRE -504 728 -504 664
WIRE -392 728 -504 728
WIRE -312 728 -312 664
WIRE -312 728 -392 728
WIRE -888 760 -936 760
WIRE -152 760 -152 488
WIRE -152 760 -888 760
WIRE 8 760 8 536
WIRE 168 760 168 568
WIRE 472 792 472 616
WIRE 744 792 472 792
WIRE 968 792 744 792
WIRE -392 824 -392 728
WIRE 472 840 472 792
WIRE 664 840 664 712
WIRE 472 952 472 920
WIRE 568 952 472 952
WIRE 664 952 664 920
WIRE 664 952 568 952
WIRE -808 1000 -840 1000
WIRE -392 1000 -392 904
WIRE -392 1000 -808 1000
WIRE 8 1000 8 840
WIRE 168 1000 168 840
WIRE 568 1000 568 952
FLAG -888 488 INA
FLAG -888 760 INB
FLAG -808 56 V+
FLAG -808 1000 V-
FLAG -1016 -792 0
FLAG -680 -792 0
FLAG -856 -792 0
FLAG -504 -792 0
FLAG -968 -1000 V+
FLAG -808 -1000 V-
FLAG -600 -1000 INA
FLAG -440 -936 INB
FLAG -184 -792 0
FLAG -136 -1000 VCC
FLAG -232 264 CA
FLAG -232 392 CB
FLAG 744 792 OB
FLAG 744 712 OA
FLAG 568 1000 0
FLAG 8 1000 0
FLAG 168 1000 0
SYMBOL npn -568 440 R0
SYMATTR InstName Q1
SYMATTR Value 2N3904
SYMBOL res -520 568 R0
SYMATTR InstName R1
SYMATTR Value {Rfb}
SYMBOL res -328 568 R0
SYMATTR InstName R2
SYMATTR Value {Rfb}
SYMBOL npn -248 440 M0
SYMATTR InstName Q2
SYMATTR Value 2N3904
SYMBOL res -328 120 R0
SYMATTR InstName R13
SYMATTR Value {Rt}
SYMBOL res -520 120 R0
SYMATTR InstName R14
SYMATTR Value {Rt}
SYMBOL voltage -1016 -888 R0
SYMATTR InstName VP
SYMATTR Value {Va}
SYMBOL voltage -856 -776 R180
SYMATTR InstName VN
SYMATTR Value {Va}
SYMBOL voltage -680 -888 R0
SYMATTR Value2 AC 0.5
SYMATTR InstName VINA
SYMATTR Value PWL file=ampl_train.pwl
SYMBOL voltage -504 -888 R0
SYMATTR Value2 AC -0.5
SYMATTR InstName VINB
SYMATTR Value 0
SYMBOL voltage -184 -888 R0
SYMATTR InstName VP1
SYMATTR Value 3.3
SYMBOL current -392 824 R0
SYMATTR InstName I1
SYMATTR Value {Iset}
SYMBOL res 456 488 M180
SYMATTR InstName R3
SYMATTR Value {Rfb2}
SYMBOL res 648 488 M180
SYMATTR InstName R4
SYMATTR Value {Rfb2}
SYMBOL res 648 936 M180
SYMATTR InstName R5
SYMATTR Value {Rt2}
SYMBOL res 456 936 M180
SYMATTR InstName R6
SYMATTR Value {Rt2}
SYMBOL pnp 408 616 M180
SYMATTR InstName Q3
SYMATTR Value 2N3906
SYMBOL pnp 728 616 R180
SYMATTR InstName Q4
SYMATTR Value 2N3906
SYMBOL current 584 120 R0
SYMATTR InstName I2
SYMATTR Value {Iset2}
SYMBOL npn -56 216 R0
SYMATTR InstName Q5
SYMATTR Value 2N3904
SYMBOL npn 104 344 R0
SYMATTR InstName Q6
SYMATTR Value 2N3904
SYMBOL res -8 744 R0
SYMATTR InstName R7
SYMATTR Value 4.7k
SYMBOL res 152 744 R0
SYMATTR InstName R8
SYMATTR Value 4.7k