THD from Spice simluation
 User Name Stay logged in? Password
 Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read Search

 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
 4th June 2004, 12:44 PM #1 Prune   Account Disabled   Join Date: Mar 2003 Location: Vancouver THD from Spice simluation LTSpice has no THD analyzer. How can I estimate the THD using the FT plot below?
 4th June 2004, 12:49 PM #2 peranders   Electrons are yellow and more is better! diyAudio Member     Join Date: Apr 2002 Location: Göteborg, Sweden You can do it manualy. SQR((2nd)^2 + (3rd)^2 + (4th)^2 + etc), geometric addition Take the result and compare it with 1 kHz, the fundamental 2nd = first harmonics, 2 kHz 3rd = second harmonics, 3 kHz __________________ /Per-Anders (my first name) or P-A as my friends call me Group buy: SSR03 Super Regulator Power Supply. Sign up HERE 8 pcb's in interest so far.
moamps
diyAudio Member

Join Date: Oct 2002
Location: Croatia
Quote:
 Originally posted by peranders 2nd = first harmonics, 2 kHz 3rd = second harmonics, 3 kHz [/B]
Hi,
".......The fundamental frequency is alternatively called the first harmonic......"
2nd=second, etc.
Regards

 4th June 2004, 02:20 PM #4 Pedja   diyAudio Member   Join Date: Jun 2002 Location: Belgrade Prune, Enter dot four command using “SPICE directive” button (keyboard shortcut is 'S'). Should look like: .four 1kHz V(out) (for the harmonics of 1kHz at the point marked as out). Then you can see the THD and the levels of individual harmonics if you run the transient analysis and check log file under View > Spice Error Log. LT SwCAD by default computes for the first 9 harmonics. You can define the number of harmonics you are interested for as well. Then the line should look like: .four 1kHz 4 V(out) (assuming you are interested for the first 4 harmonics only) Pedja
 4th June 2004, 05:09 PM #5 sam9   diyAudio Member     Join Date: Jun 2002 Location: Left Coast You also need to click on "Tools", then on "Control Pannel", then on "Compression". Then uncheck the boxes, the calculation doesn't give reasonable values when applied to compressed data. Next run the tansient analysis, then click on "View" while the schematic window is selected, then click on "Spice Error Log" and scroll down until you find what you are looking for. Note that the frequency specified in the ".four" directive must be the same as specified in your signal source when you run the transiient. If you forget and change only one you will get spurious (usually dramaticly so) results. I've read on the LT spice forum that you get more accurate results if you select "time stop" and "maximum time step" such that the transient spans a whole number of cycles, i.e., no fractional cycles. I've found 5 cycles are enough to get what I want to know but a few more might help. Some transient waveforms take a while to reach a steady state, such as when a cap has to charge before the pattern settles down. In this case you will need to specify a start time after the steady state is obtained. Finally, be aware that the THD figures you will get from circuit you actually construct will not be as good as what you see in LT Spice. Thus "fine tunning" your circuit to get the last .0005% THD out may be educational and entertaining but unlikely to be of any significance when you actually construct the circuit.
 4th June 2004, 06:26 PM #6 officeboy   diyAudio Member   Join Date: Nov 2003 Location: NW Washington So I’m a bit worried here, since I got Total Harmonic Distortion: -1.#IND00% with the universal opamp, and then Total Harmonic Distortion: 579.678388% with one of the LT opamps. is there a way to import someone else's opamps since I’m not familiar with LT's products.
peranders
Electrons are yellow and more is better!
diyAudio Member

Join Date: Apr 2002
Location: Göteborg, Sweden
Quote:
 Originally posted by moamps Hi, ".......The fundamental frequency is alternatively called the first harmonic......" 2nd=second, etc. Regards
Thanks for the correction. This was a case of swedish in english..
__________________
/Per-Anders (my first name) or P-A as my friends call me

 4th June 2004, 11:47 PM #8 sam9   diyAudio Member     Join Date: Jun 2002 Location: Left Coast "So I’m a bit worried here, since I got Total Harmonic Distortion: -1.#IND00% with the universal opamp, and then Total Harmonic Distortion: 579.678388% with one of the LT opamps. is there a way to import someone else's opamps since I’m not familiar with LT's products." I think you need to add code to the universal op amp. Regarding the other - that sound like what you get when the freq specified in the .four statement is different from the freq specified in the transient analysis.
sam244
diyAudio Member

Join Date: Mar 2009
Current harmonics

Hi all,

I am trying to calculate the THD of the output current in Ltspice......(Id(M12)-Id(M13)).....but everytime getting a message that....the current is not present in data....I am attaching the netlist....PLz help..
Attached Files
 netlist.txt (5.6 KB, 31 views)

 6th March 2009, 07:31 AM #10 Elvee   diyAudio Member     Join Date: Sep 2006 Why do you want to do it manually? It is much simpler to use the command: .four 1K I(out) (view results in Spice Error Log)

 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 Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Site     Site Announcements     Forum Problems Amplifiers     Solid State     Pass Labs     Tubes / Valves     Chip Amps     Class D     Power Supplies     Headphone Systems Source & Line     Analogue Source     Analog Line Level     Digital Source     Digital Line Level     PC Based Loudspeakers     Multi-Way     Full Range     Subwoofers     Planars & Exotics Live Sound     PA Systems     Instruments and Amps Design & Build     Parts     Equipment & Tools     Construction Tips     Software Tools General Interest     Car Audio     diyAudio.com Articles     Music     Everything Else Member Areas     Introductions     The Lounge     Clubs & Events     In Memoriam The Moving Image Commercial Sector     Swap Meet     Group Buys     The diyAudio Store     Vendor Forums         Vendor's Bazaar         Sonic Craft         Apex Jr         Audio Sector         Acoustic Fun         Chipamp         DIY HiFi Supply         Elekit         Elektor         Mains Cables R Us         Parts Connexion         Planet 10 hifi         Quanghao Audio Design         Siliconray Online Electronics Store         Tubelab     Manufacturers         AKSA         Audio Poutine         Musicaltech         Aussie Amplifiers         CSS         exaDevices         Feastrex         GedLee         Head 'n' HiFi - Walter         Heatsink USA         miniDSP         SITO Audio         Twin Audio         Twisted Pear         Wild Burro Audio

 Similar Threads Thread Thread Starter Forum Replies Last Post Bonsai Solid State 9 5th September 2008 12:32 AM WithTarragon Pass Labs 2 6th June 2008 06:32 PM kelticwizard Everything Else 29 15th February 2007 01:38 AM EternaLightWith Software Tools 9 21st May 2003 03:51 AM JensRasmussen Solid State 10 18th October 2002 05:18 AM

 New To Site? Need Help?

All times are GMT. The time now is 12:47 PM.

Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.