|
|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| 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 |
|
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Jan 2005
|
I've seen ppl over in the class d section simulating with ltspice including THD, i have been unable to find anything about THD in ltspice so i wonder if anyone here knows how its done.
|
|
|
|
|
#2 |
|
diyAudio Member
Join Date: Oct 2003
Location: Ottawa, Canada
|
You can add a spice directive like this:
.fourier {Freq} V(output) You need to label the output as "output" so that V(output) has meaning. You can replace "{Freq}" above with a hard-coded number for whatever frequency you are running at (the frequency of your sine source). Or you can define a parameter called Freq and use it for both the .fourier and for the source voltage for the amp. Then you only have to change it in one place to re-run the sim at any frequency. e.g.: .param Freq 1k To see the result, open the spice error log. Don't forget that you can also do an FFT on any waveform. This will let you see which harmonics are present. When doing distortion and FFT measurements, you must turn off 1st and 2nd order compression (in Tools -> control panel) for more accurate results. You can also set the maximum timestep to something relatively small to get a better sim (note small timestep and no compression = BIG memory and disk requirements). When doing FFT try to get an exact integer number of cycles on screen. Otherwise you get a DC component in the result and this adds a slant to the FFT chart. Have you looked through the examples in the "educational" folder? Please do. |
|
|
|
|
#3 |
|
diyAudio Member
Join Date: Jan 2005
|
Last edited by Tekko; 24th November 2010 at 03:40 PM. |
|
|
|
|
#4 |
|
diyAudio Member
Join Date: Feb 2003
Location: ..
|
an important and obscure issue is that Ltspice automatically applies data compression - which will limt your distortion measurement resolution
always either turn off data compression in the Tools/ContolPanel/Compression dialog box or better always add the spice directive .option plotwinsize=0 I almost never use the .four - I much prefer looking at the relative levels in the fft graph with Blackman window and integer number cycles (5-10x) of the fundamental fitting the analysis time exactly 2 tone measurements can be more interesting with IMD difference products often being more audible than simple harmonics |
|
|
|
|
#5 |
|
diyAudio Member
Join Date: Oct 2008
Location: Vancouver
|
Unfortunatley the Spice thread that used to to be sticky and at the top of the solid state forum now needs searching for. It holds the answers to this and many more spice questions.
|
|
|
|
|
#6 |
|
diyAudio Member
Join Date: Oct 2008
Location: Vancouver
|
The thread is still a sticky but now its in the software.... forum.
|
|
|
|
|
#7 |
|
diyAudio Member
Join Date: Jan 2005
|
That Cdom cap on VAS do have an impact on THD, without it i ger 0.008% THSD and with it im up to 0.015% THD.
Now in reality i do doubt that my amp actually get below 1% THD since spice is ideal component models in an ideal environment. A Blackman FFT looks like a comb but the harmonics are only up to around -58dB while the fundamental is like +25dB with a noise floor around -100dB. I also noticed that in ltspice i can have a much smaller Cdom before the amp oscillates than in circuitmaker 2000. And my sim in ltspice was using IRFP240/9240 since ltspice doesent have IRF540/9540. |
|
|
|
|
#8 | |||
|
diyAudio Member
Join Date: Sep 2006
|
Quote:
Quote:
Quote:
The timestep has a paramount importance too: with a large timestep, you can get away with almost anything. Try 100ns or less f.e. The solver could also influence that aspect. |
|||
|
|
|
|
#9 |
|
diyAudio Member
Join Date: Nov 2008
Location: Brazil
|
|
|
|
|
|
#10 | |
|
diyAudio Member
Join Date: Oct 2003
Location: Ottawa, Canada
|
Quote:
|
|
|
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OT: how can I measure THD of my amplifier if my sound card is 0,02% THD ? | ygg-it | Solid State | 1 | 13th June 2010 07:54 AM |
| Using LTSpice | gaetan8888 | Solid State | 6 | 19th July 2007 12:33 AM |
| RIAA in LTspice | Herrmann | Tubes / Valves | 2 | 17th September 2004 07:28 PM |
| LTSpice Issue... | mikeks | Solid State | 17 | 3rd September 2004 07:42 AM |
| Ltspice.... | mikeks | Solid State | 10 | 13th June 2004 08:10 PM |
| New To Site? | Need Help? |
| Page generated in 0.11831 seconds (78.38% PHP - 21.62% MySQL) with 11 queries |