Author Topic: THD vs frequency  (Read 801 times)

0 Members and 1 Guest are viewing this topic.

Offline Lucky-LukaTopic starter

  • Supporter
  • ****
  • Posts: 240
  • Country: it
THD vs frequency
« on: December 28, 2019, 08:21:40 pm »
Hi all

I've found this link: http://www.audio-perfection.com/audio/audio-total-harmonic-distortion-analyzer-for-ltspice-making-thd-vs-amplitude-and-frequency-sweeps-in-ltspice.html

I'm trying to understand how to use this script properly.
Can someone tell me how I can plot the THD vs freq graph?
After I've simulated the given example , I went to the error log (CTRL-L) and than I right clicked the log window.
THD vs output amplide graph appear after I select "plot selected meas data"
I have even changed the analyzer_controls.txt commenting the amplitude sweep and uncommenting the freq sweep but the result doesn't change: I cannot display the THD vs freq graph I'm looking for.

If there is another method to achieve a thd vs freq graph using LTSpice it's ok for me.

Cheers
Memento audere semper.
 

Offline Calvin

  • Regular Contributor
  • *
  • Posts: 179
  • Country: de
    • Calvin´s audio page
Re: THD vs frequency
« Reply #1 on: December 29, 2019, 05:03:41 pm »
Hi,

here´s one I found quite simple and useful.
Open the .txt File with a editor and configure the analyzer parameters after your fashion (basically its just commenting/uncommenting lines and setting a fixed parameter)
You can choose either THD over Frequency at a fixed Amplitude, or THD over Amplitude at a fixed Frequency.
The analyzer runs multiple transient runs, which means that calculation time becomes long and raw-File size can become very large.
Plotting results: View --> Spice error Log and then Plot .step'ed .meas data

regards
Calvin


..... it builds character!
 

Offline Lucky-LukaTopic starter

  • Supporter
  • ****
  • Posts: 240
  • Country: it
Re: THD vs frequency
« Reply #2 on: December 29, 2019, 10:04:42 pm »
Hi
I attach 2 pics.
The first one shows the configuration text file.
Is it ok to comment it like that to obtain THD vs freq?
The second pic is the error log after the simulation has finished.
An error and several warnings...
What do you think about it?
Cheers
Memento audere semper.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf