Spice simulation - Page 112 - 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 3rd March 2012, 04:46 PM   #1111
tvrgeek is offline tvrgeek  United States
diyAudio Member
 
Join Date: Dec 2009
Location: Md
slow post, thanks.
  Reply With Quote
Old 3rd March 2012, 04:50 PM   #1112
KSTR is offline KSTR  Germany
diyAudio Member
 
KSTR's Avatar
 
Join Date: Jul 2007
Location: Central Berlin, Germany
Quote:
Originally Posted by tvrgeek View Post
It's the 120 I was simulating. LTSpice was showing harmonic distortion only 80dB down right at the output of the voltage source. Model is a perfect source; no internal impedance. So, less than perfect generation is what I was seeing. I bet they have their reasons.
LTspice's generator is pretty good, but one needs to take care of some parameters.


Click the image to open in full size.

Consider the cap replaced with a short, for the moment. Then this sim will have distortion levels at 1e-15 (-300dB), using the .four command, not the FFT in the graph display. This comes from the small time step (10,000 points per period, de-rationalized with the Pi/3.14-thingie which helps when you want to analyse multiple periods) and the double precision option, and most of all from the directive plotwinsize=0, which tells the program to turn OFF waveform compression (which is lossy).

Then put the cap back in. Distortion will skyrocket inspite of the perfect oscillator... because the circuit has not settled from the wideband input (down to DC) that a suddenly started sine intrinsicly shows. It gets even worse when you add a dead-time to the generator. One can use generators circuits that fade in with a raised cosine envelope which reduces settling time quite a bit.
  Reply With Quote
Old 3rd March 2012, 04:52 PM   #1113
jcx is offline jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
I just use Blackman, need 4x longer fft length to accomodate the broadened line, but gives very good spectral spreading noise suppression floor

I only use cursor diff values, any phase measures made relative to the source fundamental
  Reply With Quote
Old 3rd March 2012, 11:05 PM   #1114
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
Here is a .asc file with every performance tweak I've found so far (well, not quite all of them, but all of the functional ones). I use this param set for every amplifier I simulate. This will let you tweak simulation speed without causing problems with sample aliasing and compression.
Attached Files
File Type: zip ampsim2.asc.zip (1.5 KB, 110 views)
  Reply With Quote
Old 3rd March 2012, 11:10 PM   #1115
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
WRT the FFT window.

If you open up the preview for the window you choose, you'll see there are many different types. The sine-like ones are the most natural and intuitive. It is important that the tail ends of the window end at 0, or your noise floor will be artificially heightened. The window should average to a straight line if it is placed in a series of windows. I believe I'm correct here but I may be wrong.

Playing around with the FFT windows in Baudline (only available for Linux unfortunately) gives you a good idea of what the FFT window does to the spectrogram.

A narrower FFT window seems to decrease the Hz resolution of the FFT, so perhaps a good audio window would be Kaiser, adjusted so the spikes are exactly 1 octave wide, so they don't overlap. But I haven't studied this in detail so I'm not sure what the side-effects would be. I know MikeB seemed to prefer the Kaiser window.

EDIT: I'm pretty sure the .four parameter, which automatically calculates THD, uses the rectangular window, which is why it will read a ridiculous THD on a simulation where the FFT shows very low THD (provided you used a good window). It would be nice if there were a way to change the FFT window. Maybe someone has come up with a DIY alternate feature that uses the windowed FFT values.

Last edited by keantoken; 3rd March 2012 at 11:17 PM.
  Reply With Quote
Old 4th March 2012, 11:04 AM   #1116
tvrgeek is offline tvrgeek  United States
diyAudio Member
 
Join Date: Dec 2009
Location: Md
SUPER. Much thanks. I also found some notes and a plug in over on Audio-Perfection.com Lots to study. All this as a side track when trying to understand why my Rotels sound better than my other amps. Amp design became fascinating. I have a renewed appreciation for analog design. Everything is a catch-22 at the levels mere consumer grade equipment works at. .000-something. Not long ago measuring in that range was college physics lab domain. Add the craft and the problem of what measures well does not automatically sound good.

I remember a lecture by TI on digital measurement maybe 30 years ago, but needless to say, the details escape me. In SoundEasy, he recommends a rectangular window. My other free-ware analyzers all recommend Blackman. Sometimes the results look suspiciously too good. I am used to just being able to set the sample rate and size, where that is a bit confusing in LTSpice.

I had not thought of pre-defining several signal sources. Much easier than retyping it all every time. Rookie.
  Reply With Quote
Old 8th March 2012, 02:43 PM   #1117
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
I just posted some stuff about FFT windowing that probably pertains more to this thread. New users are often confused about FFT windowing, so I think it's important to make it clear. Most people will probably be very happy with the Hann window, but like jcx says, for a lower noise floor Blackman can be used with a larger number of samples.

LTSpice FFT simulation settings and inconsistent results.
  Reply With Quote
Old 23rd March 2012, 09:56 PM   #1118
tvrgeek is offline tvrgeek  United States
diyAudio Member
 
Join Date: Dec 2009
Location: Md
Very confused on baseline noise. If I just have a voltage source, 1K resistor back to ground. Run 1K, 1000 cycles through it. Look at the FFT. I have a noise floor at about -80dB and quite a bit of distortion. This implies the sine generator is pretty poor. So poor, I can't really tell much about my simulation as it is better than the generator. Am I doing something very wrong?
Attached Images
File Type: png baseline.png (91.3 KB, 39 views)
  Reply With Quote
Old 23rd March 2012, 11:48 PM   #1119
tvrgeek is offline tvrgeek  United States
diyAudio Member
 
Join Date: Dec 2009
Location: Md
OK, I FINALLY got the configuration keantoken recommended to behave, so I do get a "perfect" sine wave input. Not, this is my output. No window, 3 point adv default.
Attached Images
File Type: png confusing.png (80.5 KB, 50 views)
  Reply With Quote
Old 23rd March 2012, 11:48 PM   #1120
tvrgeek is offline tvrgeek  United States
diyAudio Member
 
Join Date: Dec 2009
Location: Md
BTW, this is a modified Hafler DH-120 power amp model.
  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 07:49 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