Dear Ken,
I recently read the paper "Accurate Fourier analysis for circuit simulators". I don't have access to Spectre, therefore I wanted to try out the described Fourier analysis by writing a custom MATLAB script that processes the SPICE output.
I wanted to start on the ua741 example from the paper to have a good reference and than go forward from there. However, when trying to reproduce the 'normal' Fourier analysis results from SPICE, I could not come up with the numbers presented in the paper. These are the numbers SPICE reports (THD is smaller than reported in the paper):
Code:Fourier analysis for vout:
No. Harmonics: 10, THD: 2.93336 %, Gridsize: 200, Interpolation Degree: 1
Harmonic Frequency Magnitude Phase Norm. Mag Norm. Phase
-------- --------- --------- ----- --------- -----------
0 0 -0.0027612 0 0 0
1 1000 0.94215 0.271005 1 0
2 2000 0.00485751 -115.89 0.00515577 -116.16
3 3000 0.00667308 136.829 0.00708282 136.558
4 4000 0.00713215 -42.948 0.00757008 -43.219
5 5000 0.000858787 -51.735 0.000911518 -52.006
6 6000 0.0181092 -49.895 0.0192211 -50.166
7 7000 0.00353059 -55.709 0.00374738 -55.98
8 8000 0.0173587 129.745 0.0184246 129.474
9 9000 0.00152307 127.297 0.00161659 127.026
I see some possible causes for this and it would be nice if you could comment on them:
1. Different SPICE version: I used spice3f5 while the paper mentions spice2g6.
2. SPICE testbench: this is my SPICE deck:
Code:*
* uA741 opamp Fourier analysis
*
* Netlist
.include UA741_model.sp
X1 vin vout vdd vss vout UA741
* Bias
Vdd vdd 0 dc 12
Vss 0 vss dc 12
* Input
Vin vin 0 sin(0 1.0 1e3 0 0 0)
* Analysis
.tran 1e-9 10e-3
.four 1e3 vout
* Output
.print tran v(vin) v(vout)
.end
3. ua741 model: I used the so called Oregano model:
Code:.subckt UA741 1 2 3 4 5
* connections: | | | | |
* | | | | |
* non-inverting input | | | |
* inverting input | | |
* positive power supply | |
* negative power supply |
* output
*
*
c1 11 12 8.661E-12
c2 6 7 30.00E-12
dc 5 53 dx
de 54 5 dx
dlp 90 91 dx
dln 92 90 dx
dp 4 3 dx
*SPICE2:
* egnd 99 0 poly(2) (3,0) (4,0) 0 .5 .5
*SPICE3:
Begnd 99 0 V = .5*V(3,0) + .5*V(4,0)
*SPICE2:
* fb 7 99 poly(5) vb vc ve vlp vln 0 10.61E6 -10E6 10E6 10E6 -10E6
*SPICE3:
Bfb 7 99 I = 10.61E6*I(vb) + -10E6*I(vc) + 10E6*I(ve) + 10E6*I(vlp) + -10E6*I(vln)
ga 6 0 11 12 188.5E-6
gcm 0 6 10 99 5.961E-9
iee 10 4 dc 15.16E-6
hlim 90 0 vlim 1K
q1 11 2 13 qx
q2 12 1 14 qx
r2 6 9 100.0E3
rc1 3 11 5.305E3
rc2 3 12 5.305E3
re1 13 10 1.836E3
re2 14 10 1.836E3
ree 10 99 13.19E6
ro1 8 5 50
ro2 7 99 100
rp 3 4 18.16E3
vb 9 0 dc 0
vc 3 53 dc 1
ve 54 4 dc 1
vlim 7 8 dc 0
vlp 91 0 dc 40
vln 0 92 dc 40
.model dx D(Is=800.0E-18 Rs=1)
.model qx NPN(Is=800.0E-18 Bf=93.75)
.ends UA741
My gut feeling says the model is the culprit...
Kind Regards
Peter