Distortion simulation with LTspice - diyAudio
Go Back   Home > Forums > Amplifiers > Solid State

Solid State Talk all about solid state amplification.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 27th February 2004, 05:46 PM   #1
tiagor is offline tiagor  Portugal
diyAudio Member
 
Join Date: Jan 2004
Location: Malveira
Question Distortion simulation with LTspice

Hi,

has anyone successfuly simulated distortion measurements with ltspice? I've read somewhere an approximation could be obtained with fourier, though i do not know the procedure to accoplish this.
The goal is to simulate THD and, if possible, the distribution across the harmonics.

Thanks and regards,

Tiago
  Reply With Quote
Old 27th February 2004, 06:32 PM   #2
The one and only
 
Nelson Pass's Avatar
 
Join Date: Mar 2001
I haven't used LTSpice, but I am assuming that nothing radically
new has been developed in Spice algorithms for it.

I don't recommend trying to perform other than crude distortion
analysis with simulation. From my experience, you can't depend
on such numbers, and there are a few texts written that
address these issues, two being Kielkowski's "Spice: Practical
Device Modeling" or Tuinenga's "Spice: A Guide to Circuit
Simulation and Analysis using PSpice".

Both these books are fairly explicit about the limitations of
distortion analysis with Spice. If you really want to know, I
recommend that you build the circuit.
  Reply With Quote
Old 27th February 2004, 07:54 PM   #3
pjacobi is offline pjacobi  Germany
diyAudio Member
 
Join Date: Jan 2004
Location: Hamburg
Send a message via AIM to pjacobi Send a message via MSN to pjacobi Send a message via Yahoo to pjacobi
Hi tiagor,

There are two rather different points to consider:

1. How to get the THD etc. numbers in LTSpice simulation

2. How these numbers relate to the performance of the real circuit

The caveats of 2. were already addressed by Nelson.

OTOH, you can get some insigts about some sources of THD using SPICE simulation.

Ad 1.

Prerequisite:
- Always turn Compression of in LTSpice's control panel.
- Setup a transient analysis with the analysis time a multiple of your signal generator's period
- If your circuit needs some time to achieve steady state, you must also specify a non-zero start time

Method 1: Add a .fourier command using the "SPICE directive" button. Syntax is described in the online help. E.g. if your signal generator is set to 5k and you want to watch the node named "out" the command would be:
.fourier 5k V(out)
After running the sim, you can see the results using "View SPICE error log"

Method 2: Do a graphical FFT of the transient analysis' output and measure the peaks of the harmonics with the mouse

Method 3: Use Helmut Sennewalds utilities to convert the .raw files written in the transient analysis to ASCII and do further computations with the tool of your choice.

General advice:
-Read the fine online help.
-Join the mailing list http://groups.yahoo.com/group/LTspice/

Regards,
Peter Jacobi
__________________
--
YMMV
  Reply With Quote
Old 27th February 2004, 09:08 PM   #4
diyAudio Member
 
Join Date: May 2002
Location: Switzerland
I think LTSPICE's accuracy will be somewhat similar to that of PSPICE. Regarding the accuracy of the FFT (needed for THD analysis) within PSPICE I found the following:

http://www.orcadpcb.com/kb_articles/020019.asp?bc=F

an excerpt:

"Simulation Accuracy
Simulation accuracy is limited to about 3-3.5 digits (60-70dBc). The accuracy can be improved by tightening tolerances and taking the above considerations to extremes, but not by very much. This may not be considered sufficient for some applications, but keep in mind that even the best simulation models are probably not accurate enough to provide better results. "

So it is really the best to follow N.P.'s suggestion.

Regards

Charles
  Reply With Quote
Old 27th February 2004, 09:22 PM   #5
diyAudio Member
 
Morello's Avatar
 
Join Date: Jan 2002
Location: Sweden
Send a message via ICQ to Morello
I have done a lot of distorition-analysis using Orcad Pspice. I would say that it works well in some situtations. However, if the transistors/FET:s in the circuit are operating at very low voltages one have to be carefull.
__________________
"It was never supposed to be a hit, it was supposed to be a Joe Morello drum solo"- Paul Desmond
  Reply With Quote
Old 27th February 2004, 09:55 PM   #6
pjacobi is offline pjacobi  Germany
diyAudio Member
 
Join Date: Jan 2004
Location: Hamburg
Send a message via AIM to pjacobi Send a message via MSN to pjacobi Send a message via Yahoo to pjacobi
Hi phase_accurate, All,

Quote:
Originally posted by phase_accurate
I think LTSPICE's accuracy will be somewhat similar to that of PSPICE. Regarding the accuracy of the FFT (needed for THD analysis) within PSPICE I found the following: [...]
After following some tips from the LTSpice mailing list, I see no practical limitation from the FFT accuracy (in LTSpice).

With compression off, alternative solver on, running
.tran 0 12m 0 .1u gives .fourier results down to 3E-6 (110dB dynamic range). The graphical FFT, selecting 65536 points and Hann window, gives a "noise floor" of -200dB. And if you join Bernhard's Church of the Merciless Noise Killing, he will most likely give you the setup for getting down to -300dB.

But these are only numbers in a theoretical game, as the active devices' models are not anywhere near this accuracy.

Regards,
Peter Jacobi
__________________
--
YMMV
  Reply With Quote
Old 28th February 2004, 12:03 AM   #7
sam9 is offline sam9  United States
diyAudio Member
 
sam9's Avatar
 
Join Date: Jun 2002
Location: Left Coast
With regard to LT-Spice, more than squeezing out the last drop of THD+N, I would ne interested on whether and how .ac or some other analysis to create a Bode plot to be used to predict fairly accurately whether an amp circuit will be stable. I can generate curves that LOOK like a Bode graph and seem to behave to changes in component values in the right direction, but I'm not at all sure I'm using the software appropriately.
  Reply With Quote
Old 28th February 2004, 09:45 AM   #8
pjacobi is offline pjacobi  Germany
diyAudio Member
 
Join Date: Jan 2004
Location: Hamburg
Send a message via AIM to pjacobi Send a message via MSN to pjacobi Send a message via Yahoo to pjacobi
Quote:
Originally posted by sam9
With regard to LT-Spice, more than squeezing out the last drop of THD+N, I would ne interested on whether and how .ac or some other analysis to create a Bode plot to be used to predict fairly accurately whether an amp circuit will be stable.[...]
I'm not aware, how to do this (apart from exporting the metlist and re-running in AIMSpice).

You should ask at: http://groups.yahoo.com/group/LTspice/
__________________
--
YMMV
  Reply With Quote
Old 28th February 2004, 11:13 AM   #9
diyAudio Member
 
Pjotr's Avatar
 
Join Date: Nov 2002
Location: Netherlands
Hi,

Apart from the accuracy of the models you need to know what the basics are behind performing FFT’s.

So start reading a good textbook what it is all behind a FFT. I.e. Spice programs don’t use windowing, which means the number of periods of your signal needs to fit exactly in the measurement time. Also you need to set up your measurement time to an exact multiple of the FFT length and so on. A work-around is to model windowing (i.e. Hamming, Blackman and so on) yourself in the circuit.

Also DC-blocking capacitors and inductors cause DC drift over time, limiting dynamic range. So it is best to avoid capacitors and inductors in the circuit.

With the proper set-up I managed to simulate harmonics below –160 dB. But anyway the results of simulated distortion have limited use. With some luck it will give only a crude indication what to expect in the real thing.

Cheers
  Reply With Quote
Old 28th February 2004, 11:30 AM   #10
diyAudio Retiree
 
Join Date: Oct 2002
Location: Spain or the pueblo of Los Angeles
Thumbs up A beautifully asked question..... it brings tears to my eyes

Quote:
Originally posted by sam9
With regard to LT-Spice, more than squeezing out the last drop of THD+N, I would ne interested on whether and how .ac or some other analysis to create a Bode plot to be used to predict fairly accurately whether an amp circuit will be stable. I can generate curves that LOOK like a Bode graph and seem to behave to changes in component values in the right direction, but I'm not at all sure I'm using the software appropriately.
You are on the right track for stability analysis. What you what to simulate and then measure is the phase margin when the amp reaches
unity gain. This needs to be done with reactive loads the amp will see
rather than just a purely resistive load. Give this poster a gold star for
brevity along with stating exactly what he wants to know in clear terms that give an indication of his level of understanding so that replies can be right to the point.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LTSpice Simulation template?! ipop07 Tubes / Valves 5 13th May 2009 06:17 PM
Using LTSpice gaetan8888 Solid State 6 19th July 2007 12:33 AM
UcD / LTSpice help fokker Class D 94 1st October 2006 01:12 PM
LTSpice PSU simulation help - SoftStart modeling ninjanki Power Supplies 10 21st March 2005 04:04 PM
Ltspice.... mikeks Solid State 10 13th June 2004 08:10 PM


New To Site? Need Help?

All times are GMT. The time now is 08:11 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright ©1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2