• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. how to calculate THD ??

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 127
  • Views 29629
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to calculate THD ??

Muffassir
Muffassir over 13 years ago

 Hi all;

 

 I want to calculate the total harmonic distortion (%)   of my analog circuit.. I have two inputs as Vx and Vy ..Wherein i want to plot the THD variation due to input voltage swing between 0 and 1.8V while Vx set to different DC values.

How can i do that in cadence . I am using Cadence 6.1.4.500 and ADE L . and gpdk180.

 

Thanks in advance..

 

 

  • THD.png
  • View
  • Hide
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    For a single transient run, you can use the thd function in the calculator. Then you could do a two dimensional parametric sweep of Vx and Vy to get the curve you want.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Muffassir
    Muffassir over 13 years ago

     Thanks Andrew,

    I am now able to calculate the THD for a single trans run for one input .

    I think i am able to do the parametric sweep by using the Vx and Vy variables in the Parametric Analysis Rows at the same .I think that this called as two dimensional analysis if i am not wrong .(correct me if needed)

    Can you please more elaborate on how to calculate the THD from this waveforms and plot the THD vs one of the inputs.Also i dont find the erplot button in my calculater to plot the buffer vale.?

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    You don't need the "erplot" button to do this. Just hit the evaluate button in the calculator (not sure what version you're using) after doing the parametric analysis. Alternative, having set up the single simulation, hit the Setup Outputs icon in ADE and set the expression for THD  as an output. If you run the single simulation, it will display the scalar result in the ADE output pane, but if you then do a parametric sweep, it will plot a waveform of the output versus the parameter being swept. If you then add a second variable to the sweep, it will plot a family of curves - just as you're after.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • cad123
    cad123 over 12 years ago

     

    How to measure THD and gain in cadence 5.10.41

    Hi Andrew
    Following the above post, I have a similar inquiry wherein I have a CMOS OTA and I have to plot its THD in Cadence Spectre.

    I have done parametric analysis in 5 frequency steps and then when I went to calculator and filled in all 4 parameters and clicked THD in special functions it simply gave me a scalar value.
    But I want to plot THD graph with 5 tones plus fundamental while calculator takes only one frequency at a time.

    Is there any other method of calculating THD without using calculator?

    Pl help....thanks
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    This ought to work - I've no idea what you've done wrong. It should work - I did this:

     thd(VT("/out") 0 2.0/VAR("frq") 128 VAR("frq"))

    Note that I had a design variable called frq, which is what I was sweeping. The transient was run for 2*frq (actually not that easy to do in IC5141, I think, but I was running from a netlist), and the fundamental was frq.

    Maybe you should contact customer support?

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Cdub
    Cdub over 5 years ago in reply to Andrew Beckett

    For calculating THD in ADE I found the equation as:

    THD=sqrt(sum(f^(abs(Ai)^2),i=1:infty))/abs(Af)*100%

    where `f' is the fundamental frequency and Ai are the complex coefficients.  I attached a picture below; I'm confused about the notation; typically I see THD calculated as:

    THD=sqrt(sum((abs(Ai)^2),i=1:infty))/abs(Af)*100%

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 5 years ago in reply to Cdub

    Dear Colub,

    Cdub said:

    I'm confused about the notation; typically I see THD calculated as:

    THD=sqrt(sum((abs(Ai)^2),i=1:infty))/abs(Af)*100%

    I believe the expression and your understanding are both the same. Reading the definition provided by Cadence f^Ao is indeed the amplitude of the fundamental (it calls it the DC component), and F^Ai are the amplitudes of the higher ith components. Hence the numerator represents the sum of the powers of the higher harmonics ( note f^Ao is specifically excluded from the summation). Do you agree Colub?

    Shawn

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Cdub
    Cdub over 5 years ago in reply to ShawnLogan

    Thank You for your reply, I am still a bit confused; if "F^Ai are the amplitudes of the higher ith components" then the denominator of the expression should be F^Af right? Have I misinterpreted your reply?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 5 years ago in reply to Cdub
    Cdub said:
    I am still a bit confused; if "F^Ai are the amplitudes of the higher ith components" then the denominator of the expression should be F^Af right? Have I misinterpreted your reply?

    Dear Cdub,

    Referring to the text in the manual:

    "The computation uses the dft function. Assume that the dft function returns complex coefficients A0, A1…, Af , ... .

    Please note that fundamental frequency f is the frequency contributing to the largest power in the signal. A0 is the complex coefficient for the DC component and Ai is the complex coefficient for the ith harmonic where . Then, total harmonic distortion is computed as:"

     Hence the notation in the denominator, Af, is consistent with the frequency contributing to the largest power in the signal. Typically, this will be the amplitude of your fundamental.

    Is this any more clear (sorry about my prior confusion!)?

    Shawn

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Cdub
    Cdub over 5 years ago in reply to ShawnLogan

    Hi Shawn! Thanks again for the reply. It seems like the notation of the numerator is not consistent with the notation of the denominator. Is there something I might be missing?

    Thanks Again!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
>

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information