This sounds like your bias point circuit is moving or is being excited by the input waveform. An AC analysis does an operating point analysis then uses those biases to do a small signal sweep (that's why it is so fast). A transient analysis of course recomputes the bias as the signal changes. The fact that running different transient analysis with different stimulations gives differing results is a big clue that your operating point is shifting as well.
If you have a fixed frequency then you can use definite integration over one cycle to eliminate the DC. It will take one cycle for the circuit to respond, true, but you can skip that (unless you;re interested in transients, too). To avoid repeating, here's my answer giving the solution to this. I'd advise using the G+C
variant, rather than the behavioural source, as the delay given from the tline
is much more reliable, but the choice is yours.
If your frequency varies, then you can simply use a lowpass filter of your choice (in LTspice, avoid Laplace
in .TRAN
analysis). For a simple example, a 4th order Butterworth:
...or a 4th order Bessel, for almost linear phase, normalized to -3dB (see the 2.114
in .param f=1/2.114
is the frequency scaling factor):
If you DC point also varies with frequency, you're better off using the non-normalized Bessel, to have a better group delay in the passband, and to use a tline
to delay your reference signal to match the Bessel delay, something like this:
Note that the way the input is delayed is just an exemplification, the way I did it, since I don't know what you have in your schematic. At the very worse, you could add a G
source followed by the tline
and the terminating resistor as seen in the example above.
Best Answer
The reason for this is explained in the LTspice Help under
B. Arbitrary Behavioral Voltage or Current Sources
. The relevant section is pasted below, but here's a web-link to a cached version of that help section.Since your circuit is linear, you should be using an F-source instead. This requires an additional 0V voltage source in the circuit branch you want to reference, as shown below. See the help page for
F. Current Dependent Current Source
for more information.