Maker Pro
Maker Pro

LTspice THD+N and other questions...

L

ldg

Jan 1, 1970
0
I have the manuals here for Pspice 7.1. In that edition, there was no
..disto command. They recommended doing a transient run with the .four
command. Is this still the case? If so, I think the post processor
fft in LTspice is as good or better.

As I recall the .four command only looks for harmonic spectrum of the
specified fundamental. It would miss, for instance, an aliased noise
generated by sampling that's not a harmonic. Is my memory accurate?
After all, I'm getting old :)

Regards,
Larry
 
J

Jim Thompson

Jan 1, 1970
0
I have the manuals here for Pspice 7.1. In that edition, there was no
.disto command. They recommended doing a transient run with the .four
command. Is this still the case? If so, I think the post processor
fft in LTspice is as good or better.

As I recall the .four command only looks for harmonic spectrum of the
specified fundamental. It would miss, for instance, an aliased noise
generated by sampling that's not a harmonic. Is my memory accurate?
After all, I'm getting old :)

Regards,
Larry

Did you see my prior post? PSpice does not have .DISTO.

To see a full spectrum, run .TRAN analysis, then, in Probe, select
Fourier in the "Trace" pull-down. Then you see everything, harmonics,
cross-products, the pain-and-agony you'd rather wasn't there ;-)

For .FOUR you must select Fourier in the .TRAN *Setups* (prior to
simulation), select fundamental frequency and number of harmonics
desired. (This is classic distortion analysis as would be seen using
an instrument which tunes out the fundamental.)

...Jim Thompson
 
J

Jim Thompson

Jan 1, 1970
0
I think we we're posting at the same time. So no. Sorry :)

I forgot about the Probe fft. It wasn't the best, but it was easy to
use and included way back in the DOS days of Pspice. I've always
liked the Pspice post processor.

We're saying the same things about the rest . . .

Regards,
Larry

Probe FFT is good *IF* you choose a max timestep no larger than about
1/32 of the period of the lowest frequency of interest and then run
the .TRAN for at least a few hundred periods.

Experiment and you'll see that a smaller timestep pushes the "noise
floor" down.

...Jim Thompson
 
L

ldg

Jan 1, 1970
0
Did you see my prior post? PSpice does not have .DISTO.

I think we we're posting at the same time. So no. Sorry :)
To see a full spectrum, run .TRAN analysis, then, in Probe, select
Fourier in the "Trace" pull-down. Then you see everything, harmonics,
cross-products, the pain-and-agony you'd rather wasn't there ;-)

I forgot about the Probe fft. It wasn't the best, but it was easy to
use and included way back in the DOS days of Pspice. I've always
liked the Pspice post processor.

We're saying the same things about the rest . . .

Regards,
Larry
 
L

ldg

Jan 1, 1970
0
ubtract the input from the output of the DUT as there may be phase &

You're right -- I overlooked that.

The little circuit I conjured up actually does just this, but doesn't
correct for the group delay of the filter. That's probably why the
cancellation isn't better. It's not bad though at -65dB (from the
fft.)

Regards,
Larry
 
M

Mike Rocket J. Squirrel Elliott

Jan 1, 1970
0
Jim said:
Probe FFT is good *IF* you choose a max timestep no larger than about
1/32 of the period of the lowest frequency of interest and then run
the .TRAN for at least a few hundred periods.

Experiment and you'll see that a smaller timestep pushes the "noise
floor" down.

Right, but none of this lets you view the distortion residue waveform.
Audio designers use a low-distortion sine wave, a thd meter, and an
oscilloscope to view the distortion. You can sum the residue with the
input signal in the 'scope to get an exaggerated picture of how the sine
wave has been distorted. To the trained eye (there are good eye training
schools throughout the country, just look under "Eye Training and
Obedience Schools" in the Yellow Pages) the shape of the distortion will
give you a feel for how the DUT will sound.
 
J

Jim Thompson

Jan 1, 1970
0
On Wed, 12 Nov 2003 20:59:29 GMT, "Mike Rocket J. Squirrel Elliott"

[snip]
Right, but none of this lets you view the distortion residue waveform.
Audio designers use a low-distortion sine wave, a thd meter, and an
oscilloscope to view the distortion. You can sum the residue with the
input signal in the 'scope to get an exaggerated picture of how the sine
wave has been distorted. To the trained eye (there are good eye training
schools throughout the country, just look under "Eye Training and
Obedience Schools" in the Yellow Pages) the shape of the distortion will
give you a feel for how the DUT will sound.

Oh me gawwwwd, you must be a toooobz aficionado ;-)

...Jim Thompson
 
M

Mike Rocket J. Squirrel Elliott

Jan 1, 1970
0
Jim said:
On Wed, 12 Nov 2003 20:59:29 GMT, "Mike Rocket J. Squirrel Elliott"

[snip]
Right, but none of this lets you view the distortion residue waveform.
Audio designers use a low-distortion sine wave, a thd meter, and an
oscilloscope to view the distortion. You can sum the residue with the
input signal in the 'scope to get an exaggerated picture of how the sine
wave has been distorted. To the trained eye (there are good eye training
schools throughout the country, just look under "Eye Training and
Obedience Schools" in the Yellow Pages) the shape of the distortion will
give you a feel for how the DUT will sound.


Oh me gawwwwd, you must be a toooobz aficionado ;-)

My mentor, waaaaaayyy back in the late '70s, taught me the secrets of
how to interpret the output of a THD analyzer. The great audio designer,
Bascom H. King.
 
L

ldg

Jan 1, 1970
0
Probe FFT is good *IF* you choose a max timestep no larger than about
1/32 of the period of the lowest frequency of interest and then run
the .TRAN for at least a few hundred periods.

Experiment and you'll see that a smaller timestep pushes the "noise
floor" down.

When I used it, it didn't have programmable filters and so forth. No
zoom as I remember. So it was pretty useless for a lot of things.
(Hope it has improved.) But it was there and it was a post processor.
Many spice programs don't provide this even now.

Regards,
Larry
 
T

Tom Loredo

Jan 1, 1970
0
Kevin said:
So Mike, have you ever consisded basing a Spice engine on evolutionary
GA, Genetic Algorithms? It might be that for really large circuits they
might be much faster.

Genetic algorithms are not known for speed. They are used for problems
with complicated search spaces and possibly many local extrema. I don't
know the needs of a spice engine, but if the "surface" you are optimizing
has any nice structure at all, a GA will likely be slower than more
conventional direction-based optimizers.

-Tom
 
T

Tom Loredo

Jan 1, 1970
0
Kevin said:
Standed Spice itself (e.g. SuperSpice:)) also has direct small signal
plots of THD and IMD against frequency. This is a ".disto" run. This can
be a lot easier for doing initial design.

Kevin, do you know if .disto is what is behind the THD calculations
done by EWB? I've used those and found them very misleading---the
results were much smaller than what one found from a Fourier analysis.
The EWB literature said the THD calculations were based on something
like a Taylor expansion. I wonder if this is simply not a good
approximation for many circuits. It's one of the reasons I abandoned
EWB....

-Tom
 
S

Steve Hamm

Jan 1, 1970
0
1. Circuits that use .DISTO (small-signal distortion) analysis. U.C.
Berkeley SPICE supports the .DISTO analysis, but contains errors.

And a total pain in the neck to update or correct. There's ways
around the pain, but it's all major work, and mostly ugly. They were
wise to chuck it.
Instead of the .DISTO analysis, we recommend running a transient
analysis and looking at the output spectrum using the Fourier
transform mode in Probe. This technique shows the distortion
(spectral) products for both small-signal and large-signal distortion.

....but doesn't do much for two- or three-tone problems, unless you're
willing to waaaaait. But a nice job for a harmonic balance analysis.

--Steve
 
K

Kevin Aylward

Jan 1, 1970
0
Tom said:
Kevin, do you know if .disto is what is behind the THD calculations
done by EWB?

Not sure. If its from an ac run, it will be .disto, if from a .tran, it
will be fft.
I've used those and found them very misleading---the
results were much smaller than what one found from a Fourier analysis.
The EWB literature said the THD calculations were based on something
like a Taylor expansion. I wonder if this is simply not a good
approximation for many circuits.

This approximation is ok in principle. It has been done up to 3rd order
terms in spice. However, they may be actual bugs in its implementation.
Its quite a complicated thing to do.
It's one of the reasons I abandoned
EWB....

To be honest, I have not done much on verifying how accurate it is. I'll
have a look and see. For referance, a single simple bipolar transister
stage will have 2nd harm= Vi(mv)% , 3rd harm = 3.3m Vi(mv)^2 (I think)
distortion, so you can do a little check.

i.e 1mv should give about 1% 2nd harmonic.

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.

http://www.anasoft.co.uk/replicators/index.html

Understanding, is itself an emotion, i.e. a feeling.
Emotions or feelings can only be "understood" by
consciousness. "Understanding" consciousness can
therefore only be understood by consciousness itself,
therefore the "hard problem" of consciousness, is
intrinsically unsolvable.

Physics is proven incomplete, that is, no
understanding of the parts of a system can
explain all aspects of the whole of such system.
 
K

Kevin Aylward

Jan 1, 1970
0
Mike said:
Right, but none of this lets you view the distortion residue waveform.
Audio designers use a low-distortion sine wave, a thd meter, and an
oscilloscope to view the distortion. You can sum the residue with the
input signal in the 'scope to get an exaggerated picture of how the
sine wave has been distorted. To the trained eye (there are good eye
training schools throughout the country, just look under "Eye
Training and Obedience Schools" in the Yellow Pages) the shape of the
distortion will give you a feel for how the DUT will sound.

Ahmmm sceptical on this one. Take a square wave and shift the phase of
its harmonics so that its shape looks totally different. It still sounds
the same.

Secondly, if its below about 0.01% (maybe even 0.1%), which has been
trivilly easy to do for at at least the last 20 years, you wont hear it,
what ever it is.

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.

http://www.anasoft.co.uk/replicators/index.html

Understanding, is itself an emotion, i.e. a feeling.
Emotions or feelings can only be "understood" by
consciousness. "Understanding" consciousness can
therefore only be understood by consciousness itself,
therefore the "hard problem" of consciousness, is
intrinsically unsolvable.

Physics is proven incomplete, that is, no
understanding of the parts of a system can
explain all aspects of the whole of such system.
 
M

Mike Rocket J. Squirrel Elliott

Jan 1, 1970
0
Kevin said:
Ahmmm sceptical on this one. Take a square wave and shift the phase of
its harmonics so that its shape looks totally different. It still sounds
the same.

Secondly, if its below about 0.01% (maybe even 0.1%), which has been
trivilly easy to do for at at least the last 20 years, you wont hear it,
what ever it is.

Guitar effects boxes and suchlike -- a big market! -- are designed to
distort the waveform, and the amount of distortion can be quite high.
The designers and manufacturers achieve their signature sound by
deciding (by ear) how they want the signal distorted. You can look at
the FFT of the DUT's output to see the harmonics, but that's indirect
when the goal is to achieve a certain waveform to get the sound you're
after. Looking at the distortion residue is direct: when displayed with
the input signal you can pretty much see how the signal has been
manipulated, and, knowing the circuit, get a good idea about which
elements and biases you need to tweak for your signature "sound."
 
K

Kevin Aylward

Jan 1, 1970
0
Mike said:
Kevin Aylward wrote:

Guitar effects boxes and suchlike -- a big market! -- are designed to
distort the waveform, and the amount of distortion can be quite high.

Well, I misread your intent a bit here. I am actually a guitarist
myself, started when I was 11 years old. I currently use a Fender twin
tube amp, http://www.anasoft.co.uk/founder.html
The designers and manufacturers achieve their signature sound by
deciding (by ear) how they want the signal distorted.

Yes. I have been a designer at two pro audio companies.
You can look at
the FFT of the DUT's output to see the harmonics, but that's indirect
when the goal is to achieve a certain waveform to get the sound you're
after.

But as I said, The picture of the wave is not unique.
Looking at the distortion residue is direct:

But not necessarily correlated with the sound.
when displayed
with the input signal you can pretty much see how the signal has been
manipulated, and, knowing the circuit, get a good idea about which
elements and biases you need to tweak for your signature "sound."

Maybe. Its a bit circular though.

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.

http://www.anasoft.co.uk/replicators/index.html

Understanding, is itself an emotion, i.e. a feeling.
Emotions or feelings can only be "understood" by
consciousness. "Understanding" consciousness can
therefore only be understood by consciousness itself,
therefore the "hard problem" of consciousness, is
intrinsically unsolvable.

Physics is proven incomplete, that is, no
understanding of the parts of a system can
explain all aspects of the whole of such system.
 
Top