• 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. Mixed-Signal Design
  3. spectrumMeasurement for a DC signal

Stats

  • Locked Locked
  • Replies 18
  • Subscribers 67
  • Views 12536
  • 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

spectrumMeasurement for a DC signal

NewScreenName
NewScreenName over 2 years ago

Hi,

I have a signal which is DC and some switching activity which disturbs it, therefore I would like to get its THD. The numbers I get using the thd function from the calculator are not right, and according to my understanding this is due to the fact that it will assume the signal is the highest amplitude of the spectrum, and also ignore the DC.

This means that because my signal is the DC, it will actually consider the highest harmonic to be the signal, and the power at its multiples the harmonics.

I tried to solve by calculating with spectrumMeasurement measure types totalharmpower/dcpower, but again I think totalharmpower is still only considering the power of the harmonics of what it assumes to be the signal.

Could not find a function which calculates the power in all frequencies, is there a quick way to automate this measurement? Maybe I am missing the correct calculator function?

Thank you

Best regards

  • Cancel
Parents
  • ShawnLogan
    ShawnLogan over 2 years ago

    Dear NewScreenName,

    NewScreenName said:
    Could not find a function which calculates the power in all frequencies, is there a quick way to automate this measurement? Maybe I am missing the correct calculator function?

    I may not fully appreciate exactly what you are attempting to compute and hence my suggestion may not be appropriate. 

    If I understand, as shown in Figure 1, you have a simulation that produces a DC term of interest and ideally the only component in the spectrum. However, additional frequency components (f1, f2,...fn) are introduced by switching activity. You would like to determine the total power of all these additional frequency components.

    If my understanding is correct, there are two possible means to determine the total power exclusive of the DC term. 

    1. Assuming your simulation results are clipped so there are no significant transient settling effects and the analysis region encompasses all the significant tonal frequencies associated with your "switching activity", I think the easiest method is in the time domain:

    a. Compute the average of your output waveform, say signal "vout":

    vout_dc = average("/vout")

    b. Subtract the average value of vout from the signal vout and determine its rms value:

    v_spurious_rms = rms(("/vout" - vout_dc)

    c. The resulting signal power, exclusive of the DC term, is then given by:

    v_spurious_rms^2

    2. If this is not to your liking, the alternative is to compute the power spectral density (calculator function psd()), and integrate it over the frequency range containing all the frequency spurs. However, this method does require some care when choosing the appropriate simulation parameters (simulation interval for analysis, number of time points, and strobe time) to assure your computed power spectral density is accurate. When done properly, it will provide the same answer as method [1].

    Shawn

    Figure 1

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to ShawnLogan

    It would really help to see the DFT of the signal you're trying to compute the THD for, and what arguments you are giving to the thd function - to clarify what you're expecting to get. I have an alternative THD function that I wrote many years ago and I'm trying to understand whether that might be more suitable (it allows you to specify which harmonic is the fundamental and uses the result of a DFT as its input).

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • NewScreenName
    NewScreenName over 2 years ago in reply to Andrew Beckett
    Andrew Beckett said:

    It would really help to see the DFT of the signal you're trying to compute the THD for, and what arguments you are giving to the thd function - to clarify what you're expecting to get. I have an alternative THD function that I wrote many years ago and I'm trying to understand whether that might be more suitable (it allows you to specify which harmonic is the fundamental and uses the result of a DFT as its input).

    Andrew

    Here you have the DFT and the parameters given, THD computed here is given by considering the 5MHz tone as signal. So what I tried to do was to compute totalharmpower/dcpower, which would be correct only if totalharmpower included all spectrum components a part from dc (which is what I hoped, but I verified isn't).

    All the other parameters remain the same, 14 hamonics is chosen to tell the calculator to consider all the spectrum as distorsion components.

    Let me know if more information is required.

    Thank you.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • NewScreenName
    NewScreenName over 2 years ago in reply to Andrew Beckett
    Andrew Beckett said:

    It would really help to see the DFT of the signal you're trying to compute the THD for, and what arguments you are giving to the thd function - to clarify what you're expecting to get. I have an alternative THD function that I wrote many years ago and I'm trying to understand whether that might be more suitable (it allows you to specify which harmonic is the fundamental and uses the result of a DFT as its input).

    Andrew

    Here you have the DFT and the parameters given, THD computed here is given by considering the 5MHz tone as signal. So what I tried to do was to compute totalharmpower/dcpower, which would be correct only if totalharmpower included all spectrum components a part from dc (which is what I hoped, but I verified isn't).

    All the other parameters remain the same, 14 hamonics is chosen to tell the calculator to consider all the spectrum as distorsion components.

    Let me know if more information is required.

    Thank you.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
No Data

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