Spice simulation - Page 40 - diyAudio
Go Back   Home > Forums > Design & Build > Software Tools

Software Tools SPICE, PCB CAD, speaker design and measurement software, calculators

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 11th November 2007, 09:21 PM   #391
diyAudio Member
 
Join Date: Oct 2007
Location: Aarhus, Denmark
Default spice software

Hi,

I am actually not posting a reply as I am interested in finding easy, intuitive, low-priced, yet good quality simulation software for analog electronics (simple resistor, capacitor, bipolar transistors, FET transistor circuitry).

I like to try it out before buying so I would prefer a try-out download as a starter. Or maybe good quality freeware is available...?

Anybody who has suggestions as to which software is commendable? I use windows XP.

Thanks!

Jesper Mønsted
  Reply With Quote
Old 12th November 2007, 02:41 AM   #392
andy_c is offline andy_c  United States
Banned
 
Join Date: Apr 2003
Hi Jesper,

I'm surprised you haven't heard of LTspice (AKA SwitcherCAD) from Linear Technology. It's popular here, mainly because it's the only free SPICE simulator that doesn't have limitations regarding the number of nodes, number of components, etc. Its user interface leaves a lot to be desired, but it gets the job done.

It can be downloaded here.
  Reply With Quote
Old 12th November 2007, 05:32 AM   #393
diyAudio Member
 
Join Date: Apr 2007
Default Re: More LTspice for dummies

Quote:
Originally posted by G.Kleinschmidt
Okayyyyy............ I've got the FFT working on a little class A output stage.
So how do I make the program give me a numerical readout of the THD then?

Cheers,
Glen
I have not examined all the capabilities of LT SPICE, but most flavors of SPICE support both FFT and IFFT functions.

A method I have successfully used in the past is to apply a brickwall filter in the frequency domain that totally suppresses the fundamental tone, and then run an IFFT to get back into the time domain. A brickwall filter will cause sampling artifacts at the start and end of a time domain record, so these sections of the TD record will need to be truncated. What remains is the sum of all the distortion products plus noise. The next step is to convert this signal into an RMS value by integrating over a suitable interval. I have used this approach and found it works well. It is also similar to the techniques used by digital distortion analysis tools.

One other note: the RMS distortion value you will get is almost always smaller than what would be obtained by simply adding the peak distortion values of each harmonic. This is caused by the fact that the peaks of the distortion products usually do not align, so when the RMS value is calculated, it captures this effect.
__________________
JCM
  Reply With Quote
Old 12th November 2007, 06:29 AM   #394
jcx is online now jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
you could just look at the previous page "fundadmental null" circuit
http://www.diyaudio.com/forums/showt...37#post1333137

dig in to my Fundamental_Null subcircuit and you can add THD calcualtion too

by adding one more BV source:

V=sqrt(idt(V(null_out)**2)/idt(v(fundamental)**2))

the final value of this last calc's trace is the RMS THD ( some small variation visible due to settling time tail, null_out not perfectly DC, linear base line cancelled)
  Reply With Quote
Old 12th November 2007, 06:35 AM   #395
GK is offline GK  Australia
Account disabled at member's request
 
Join Date: Jan 2006
So how does this compare in accuracy to the .four command?

Cheers,
Glen
  Reply With Quote
Old 12th November 2007, 06:54 AM   #396
jcx is online now jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
why would a audio circuit designer care about the 2nd digit of THD? - in a Sim? - circuit changes that don't affect magnitude or 1st digit are likely illusory given spice model limitations
  Reply With Quote
Old 12th November 2007, 07:40 AM   #397
diyAudio Member
 
Edmond Stuart's Avatar
 
Join Date: Nov 2003
Location: Amsterdam
Default Re: spice software

Quote:
Originally posted by gentlevoice
Hi,

I am actually not posting a reply as I am interested in finding easy, intuitive, low-priced, yet good quality simulation software for analog electronics (simple resistor, capacitor, bipolar transistors, FET transistor circuitry).

I like to try it out before buying so I would prefer a try-out download as a starter. Or maybe good quality freeware is available...?

Anybody who has suggestions as to which software is commendable? I use windows XP.

Thanks!

Jesper Mønsted
Hi Jesper,

You also might have a look at Micro-Cap ( www.spectrum-soft.com )
The student version free, but the circuit size is limited to 50 components. The user interface is perfect, schematic capture is very easy and fast and last but not least, the support is excellent, even for users of the student version.

BTW, this package has a lot of FFT functions, like THD and RES (i.e. distortion residual), so no need for a "fundamental null subcircuit".

Cheers, Edmond.
  Reply With Quote
Old 12th November 2007, 09:25 AM   #398
GK is offline GK  Australia
Account disabled at member's request
 
Join Date: Jan 2006
Quote:
Originally posted by jcx
why would a audio circuit designer care about the 2nd digit of THD? - in a Sim? - circuit changes that don't affect magnitude or 1st digit are likely illusory given spice model limitations

Sorry, I’m lost here. Is there a practical limitation of the .four directive which makes these more elaborate methods for computing THD necessary?

Cheers,
Glen
  Reply With Quote
Old 12th November 2007, 04:21 PM   #399
KSTR is offline KSTR  Germany
diyAudio Member
 
KSTR's Avatar
 
Join Date: Jul 2007
Location: Central Berlin, Germany
.four is just fine as it is... only one needs to select a small max. timestep (1/1000 of period-time or so) and it should be a little odd, not exactly 1/1000 -- I usually multiply whatever factor I use with pi/3.14. Also one should take care that the response has settled, .four measures only the last period by default (if one is to measure the true steady state distortion -- which could be considered useless, OTOH).

LTSpice' own sine generator has it's harmonics down at least 160dB (1e-9 ref. fundamental). Use the alternate solver, for more precision, and of course no output data compression, which is lossy.

While jcx (again, thanks for your nulling circuit, a great thing to have) is surely right that the absolute accuracy is most likely not to be interpreted literally with any "real world" relevance, I think the "precision" is still useful to see some relative changes in performance, especially if one adds stray inductances and capacitances and the like. The big unknown is model precision... but there is a costant improvement, not least due to members of this forum, and many of the more elaborated models do indeed match the measured performance of actual devices quite well, as far as I can read it from the model extraction crew aboard here.

I have a class-A output stage (very unusual topology, btw) which sims 3ppm THD20 under "perfect conditions". One surely would consider oneself happy if the circuit reaches a x100...x20 value in reality...

- Klaus
  Reply With Quote
Old 12th November 2007, 05:10 PM   #400
jcx is online now jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
Glen,
I claim there is little point in better than 1 digit accuracy THD numbers from a Sim

THD is a poor guide to quality of an audio circuit, and a very indirect guide to what’s going on - you should be looking at the fft to see the relative order of all the harmonics magnitudes at once, along with the distortion residual you actually can make informed guesses on what needs changing in a circuit

in my example distortion null circuit inspecting the distortion residual trace quickly shows that there is asymmetric clipping at the negative peak V swing, and the sharp zero crossing discontinuities show the output devices are under biased - try learning much that from a single THD number

also Parseval's theorem says the rms values/THD calculation are not affected by the relative phase of the components
  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
Need help with Spice simulation overmind Everything Else 4 23rd December 2002 04:58 PM


New To Site? Need Help?

All times are GMT. The time now is 03:10 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