THD in LTSpice ?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
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.
 
0.01% THD at 100-140W output when using command: .four 1kHz V(output) in spice directive.

XyAzn.jpg
 
Last edited:
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
 
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.
 
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.
Normal: without it, you increase the available loop gain at the harmonics frequency.


Now in reality i do doubt that my amp actually get below 1% THD since spice is ideal component models in an ideal environment.
Results have to be taken with a pinch of salt, but it certainly doesnt mean they are completely worthless.

I also noticed that in ltspice i can have a much smaller Cdom before the amp oscillates than in circuitmaker 2000.
Do you use identical models?
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.
 
also noticed that in ltspice i can have a much smaller Cdom before the amp oscillates than in circuitmaker 2000.

I woudnt trust using the the .tran function to test for stability. Better to use the traditional loop gain/phase calculations (gain/phase margins) within LTSpice. Check the Spice thread and the spice examples for Middlebrook probe.
 
LT Spice modeling audio

Keep in mind LT Spice was developed by them to mainly model their components, mainly in power products. Most good engineers use spice as a general tool to prove a concept. To go further, complicated math models have to be formulated taking into account every concievable parasitic. Best alternative is good old bench testing with some half decent equipment!
 
The amp you used Blameless as the basis for your project, keep darligton in VAS this should reduce the THD

Not just that ,but the sine gen. in spice generates .005% just by itself. you can get a blameless to do "parts per million" with proper models and without "tricks".
Get that "Andy C. sine gen." linked to a few posts back.
PS. The IRF models "suck". Still... one can get .0001% or below with them.

OS
 

Attachments

  • ppm.gif
    ppm.gif
    29.5 KB · Views: 409
Last edited:
Ohh:eek::eek:

Despite 100% outta my head it turns out i did a outright copy of an already existing amp design and then calling it my own.

I will remove all schematics of "my" amp.

The basic design is linn/RCA , long in the public domain. Mr. Self does not have patent on topology. So it can be "your" amp , "My" amp ... the monkey's uncle amp.... Nobody owns it. keep your schematics up.. NO issue. :)
OS
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.