• 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 128
  • Views 29648
  • 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
Parents
  • 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
  • ShawnLogan
    ShawnLogan over 5 years ago in reply to Cdub
    Cdub said:
    It seems like the notation of the numerator is not consistent with the notation of the denominator. Is there something I might be missing?

    Dear Cdub,

    I agree - the description appears inconsistent to me too. The ocean syntax, however, makes it reasonably clear to me anyway...

    Good luck!

    Shawn

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • ShawnLogan
    ShawnLogan over 5 years ago in reply to Cdub
    Cdub said:
    It seems like the notation of the numerator is not consistent with the notation of the denominator. Is there something I might be missing?

    Dear Cdub,

    I agree - the description appears inconsistent to me too. The ocean syntax, however, makes it reasonably clear to me anyway...

    Good luck!

    Shawn

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

    Ah The Ocean reference is better, I guess there is an error in the "Virtuoso Visualization and Analysis XL User Guide". I attached the ocean reference image below, the f is part of the index, makes much more sense:

    • 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