Maker Pro
Maker Pro

The limits of .ac analysis in LTSpice

P

Paul Burridge

Jan 1, 1970
0
Would I be right in thinking that it's a waste of time trying to do a
frequency response sweep of something like a power amplifier with the
AC analysis? If any of the circuit elements need to be explored under
non-linear conditions when 'tuning for maximum smoke' as they say,
then is this beyond any current flavour of Spice?

thanks,

p
 
M

mikem

Jan 1, 1970
0
Paul said:
Would I be right in thinking that it's a waste of time trying to do a
frequency response sweep of something like a power amplifier with the
AC analysis? If any of the circuit elements need to be explored under
non-linear conditions when 'tuning for maximum smoke' as they say,
then is this beyond any current flavour of Spice?

thanks,

p

I would just use Transient Analysis with sinosoidal inputs turned up to
levels where distortion might become an issue. You can use an FFT to
post-process the output waveforms to evaluate them for
harmonics/distortion.


See the attached example:

paste the following to a file called LargeSignal.asc, and open it
with LTSpice


MikeM

-----------------------------

Version 4
SHEET 1 880 680
WIRE 80 224 -32 224
WIRE -32 224 -32 240
WIRE -32 320 -32 352
WIRE -32 352 128 352
WIRE 128 352 128 240
WIRE 128 144 128 128
WIRE 128 32 128 0
WIRE 128 0 272 0
WIRE 272 0 272 176
WIRE 272 352 272 256
WIRE 272 352 128 352
WIRE 128 384 128 352
WIRE 128 128 336 128
WIRE 128 128 128 112
FLAG 128 384 0
FLAG 336 128 out
SYMBOL nmos 80 144 R0
SYMATTR InstName M1
SYMATTR Value IRF7201
SYMBOL res 112 16 R0
SYMATTR InstName R1
SYMATTR Value 10
SYMBOL voltage -32 224 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value SINE(2.9 0.1 1000)
SYMBOL Misc\\battery 272 160 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value 12
TEXT -16 384 Left 0 !.tran 5m
 
A

analog

Jan 1, 1970
0
Paul said:
Would I be right in thinking that it's a waste of time trying to do
a frequency response sweep of something like a power amplifier with
the AC analysis?

No, it's may only be a waste of time if you don't know what you are
doing and are unaware of the effect of operating point on small signal
response.
If any of the circuit elements need to be explored under non-linear
conditions when 'tuning for maximum smoke' as they say, then is this
beyond any current flavour of Spice?

As with any linear circuit, for a power amplifier an ac analysis
would most likely be used to check loop gain and closed loop frequency
response. The only difference with a power amp being that one would
probably want to check response at several dynamic operating points,
not just at quiescence. A poorly designed amplifier may break into
"small-signal" oscillations only with certain loads when driven hard.

What an ac analysis won't do is tell you anything about non-linear
large signal behavior such as recovery from being driven into
saturation. Both ac and transient analyses are indispensable design
tools. -- analog

Download the full featured *free* LTspice circuit simulator at:
http://ltspice.linear.com/software/swcadiii.exe
__________

"The small-signal(linear) AC portion of LTspice computes the AC com-
plex node voltages as a function of frequency. First, the DC operating
point of the circuit is found. Next, linearized small-signal models
for all of the nonlinear devices in the circuit are found for this op-
erating point. Finally, using independent voltage and current sources
as the driving signal, the resultant linearized circuit is solved in
the frequency domain over the specified range of frequencies."

-- the LTspice help file on Dot Commands (.ac)
 
R

Russell Shaw

Jan 1, 1970
0
Paul said:
Would I be right in thinking that it's a waste of time trying to do a
frequency response sweep of something like a power amplifier with the
AC analysis? If any of the circuit elements need to be explored under
non-linear conditions when 'tuning for maximum smoke' as they say,
then is this beyond any current flavour of Spice?

For something like a class-C RF amp, it would be useless. However, it
would give an idea of the input-output isolation capability of small
signals when the amp is not being driven.
 
K

Kevin Aylward

Jan 1, 1970
0
Paul said:
Would I be right in thinking that it's a waste of time trying to do a
frequency response sweep of something like a power amplifier with the
AC analysis?

No.

Its very useful, but does not contain the full story. In addition the
small signal ac distortion capability of spice gives can give a
reasonable quick guide of distortion over a range of frequencies.
If any of the circuit elements need to be explored under
non-linear conditions when 'tuning for maximum smoke' as they say,
then is this beyond any current flavour of Spice?

Dont understand what you are saying here. Non-linear/large signal
conditions are handled in spice by a transient run. One can then use
this data to do an FFT to obtain a spot frequency measuring of
distortion.

Kevin Aylward
[email protected]
http://www.anasoft.co.uk
SuperSpice, a very affordable Mixed-Mode
Windows Simulator with Schematic Capture,
Waveform Display, FFT's and Filter Design.

That which is mostly observed, is that which replicates the most.
http://www.anasoft.co.uk/replicators/index.html
 
R

Rick

Jan 1, 1970
0
In sci.electronics.design Kevin Aylward said:
Dont understand what you are saying here. Non-linear/large signal
conditions are handled in spice by a transient run. One can then use
this data to do an FFT to obtain a spot frequency measuring of
distortion.

Makes you wonder why Berkeley never implemented Harmonic Balance in SPICE ;-)
 
K

Kevin Aylward

Jan 1, 1970
0
Rick said:
In sci.electronics.design Kevin Aylward


Makes you wonder why Berkeley never implemented Harmonic Balance in
SPICE ;-)

Not really. They were mostly students, so no doubt they were down the
pub, attempting to pick up women.

Kevin Aylward
[email protected]
http://www.anasoft.co.uk
SuperSpice, a very affordable Mixed-Mode
Windows Simulator with Schematic Capture,
Waveform Display, FFT's and Filter Design.

"That which is mostly observed, is that which replicates the most".
http://www.anasoft.co.uk/replicators/index.html

"quotes with no meaning, are meaningless" - Kevin Aylward.
 
B

broken

Jan 1, 1970
0
In sci.electronics.design Kevin Aylward said:
Not really. They were mostly students, so no doubt they were down the
pub, attempting to pick up women.


Spice Girls, obviously.
 
P

Paul Burridge

Jan 1, 1970
0
Makes you wonder why Berkeley never implemented Harmonic Balance in SPICE ;-)

How (in simple terms) do harmonic-based simulators function which
makes them better than spice for RF stuff?
 
P

Paul Burridge

Jan 1, 1970
0
I would just use Transient Analysis with sinosoidal inputs turned up to
levels where distortion might become an issue. You can use an FFT to
post-process the output waveforms to evaluate them for
harmonics/distortion.


See the attached example:

Thanks, Mike, I ran your example and it nicely illustrates clipping
and gate threshold biasing, but I'm quite happy with TA; have no
insurmountable problem with it and it's info on the correct use of
*.AC* that I need to acquire.. Perhaps I haven't expressed myself
adequately. it has been known. :) I
I've read the technical explanation of what it does as provided in the
LT spice help file but... I try to rephrase it.
 
S

Steve Hamm

Jan 1, 1970
0
That was a matter of timing, I think. Berkeley had Tom Quarles
working on doing SPICE3 about the same time Ken Kundert was working on
the original (Berkeley) Spectre. I think Ken didn't want SPICE's
baggage, and there was a bit of rivalry there. But that was before
the Krylov methods had been turned into a tool for beating down the
harmonic balance problem. But there are a few industrial circuit
simulators that have, basically, SPICE + harmonic balance.
How (in simple terms) do harmonic-based simulators function which
makes them better than spice for RF stuff?

Harmonic balance solves Kirchoff's equations in the frequency domain,
for as many harmonics as you can afford. The models used are the
standard nonlinear models like those used for transient analysis; AC
analysis linearizes about a single operating point. The result is a
spectrum of the circuit at steady-state, taking into account all the
effects one expects to see from the nonlinearities, similar to what
one would get from FFT'ing the 'final' period of a transient analysis.
Except: multiple nonrelated tones can be used, and for this type of
simulation the appropriate transient analysis could be measured in
geological time. The steady-state spectrum can be considered as a
time-varying operating point for further analysis, such as periodic
noise analysis.

Anyway, most of the standard measures of RF circuit 'goodness' are in
the frequency domain and are best done in harmonic balance: IP3, IM
calculations, etc. are done most easily as sweeps or sequences of
harmonic balance simulations.
 
P

Paul Burridge

Jan 1, 1970
0
Harmonic balance solves Kirchoff's equations in the frequency domain,
for as many harmonics as you can afford. The models used are the
standard nonlinear models like those used for transient analysis; AC
analysis linearizes about a single operating point. The result is a
spectrum of the circuit at steady-state, taking into account all the
effects one expects to see from the nonlinearities, similar to what
one would get from FFT'ing the 'final' period of a transient analysis.
Except: multiple nonrelated tones can be used, and for this type of
simulation the appropriate transient analysis could be measured in
geological time. The steady-state spectrum can be considered as a
time-varying operating point for further analysis, such as periodic
noise analysis.

Anyway, most of the standard measures of RF circuit 'goodness' are in
the frequency domain and are best done in harmonic balance: IP3, IM
calculations, etc. are done most easily as sweeps or sequences of
harmonic balance simulations.

So the upshot being that whereas a real world RF circuit might throw
out all sorts of spurii, a Spice simulation of it would only show one,
principal signal; the HB method shows all the crap as well; like you'd
see of the real circuit had you used an oscilloscope of suitably high
bandwidth to view it? Is that a consequence of what you're saying?
 
R

Russell Shaw

Jan 1, 1970
0
Paul said:
So the upshot being that whereas a real world RF circuit might throw
out all sorts of spurii, a Spice simulation of it would only show one,
principal signal;

No. Spice will generate the same IMD from multi-tones, but the lower
level products are easily lost in numerical noise, and are a pain to
extract with FFT.
the HB method shows all the crap as well; like you'd
see of the real circuit had you used an oscilloscope of suitably high
bandwidth to view it? Is that a consequence of what you're saying?

HB is best for time-varying circuits with one principle
large signal and any number of smaller signals.
 
P

Paul Burridge

Jan 1, 1970
0
HB is best for time-varying circuits with one principle
large signal and any number of smaller signals.

Best why? Is it simply _faster_ or is it more revealing in some way?
 
R

Russell Shaw

Jan 1, 1970
0
Paul said:
Best why? Is it simply _faster_ or is it more revealing in some way?

More dynamic range. Small signals aren't lost in noise.
 
S

Steve Hamm

Jan 1, 1970
0
No. Spice will generate the same IMD from multi-tones, but the lower
level products are easily lost in numerical noise, and are a pain to
extract with FFT.

Actually, the numerical noise point is good. The error mechanism in
harmonic balance is mostly through having too few harmonics. The
differential equations are solved in the frequency domain, where d/dt
becomes multiplication by Laplace 's' -- no difference approximation
error as in transient analysis. And harmonic balance is a uniform
approximation method, unlike transient analysis which can accumulate
error with each timepoint. For circuits where the waveforms are
represented well by a reasonable number of harmonics, accuracy is good
and the noise floor is orders of magnitude lower than transient
analysis. So, as you say, small mixing products are less likely to
get lost in the numerical noise.
HB is best for time-varying circuits with one principle
large signal and any number of smaller signals.

Hmmm. This is true for the periodic steady-state methods, which can't
easily handle multiple large signals -- to be efficient, they really
want one large signal, then they approximate the small signals as
perturbations on a time-varying operating point. But multi-tone
harmonic balance can handle multiple large signals -- wouldn't be very
useful in RF if it couldn't. And the frequencies of these signals
need not be related. This is a killer for time-domain methods, since
the period required must be one for which all signals are periodic,
which could be _very_ long. In this case, harmonic balance can be
_much_ faster than transient analysis.

Transient analysis and periodic steady-state methods have an advantage
in that they don't care (much) about how horribly nonlinear the
circuit is. Harmonic balance does care, in that more harmonics are
required to (a) get convergence, and (b) represent the waveforms well.
And more harmonics will slow the HB simulation. So there are
certainly appropriate places to apply both...
 
R

Russell Shaw

Jan 1, 1970
0
Steve said:
.


Hmmm. This is true for the periodic steady-state methods, which can't
easily handle multiple large signals -- to be efficient, they really
want one large signal, then they approximate the small signals as
perturbations on a time-varying operating point. But multi-tone
harmonic balance can handle multiple large signals -- wouldn't be very
useful in RF if it couldn't. And the frequencies of these signals
need not be related.

That's what i meant, but worded it wrong. Multiple large signals
can be handled, but if that's all you need, then spice can do it.
 
Top