• 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. interpolation for xmin calculation

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 126
  • Views 14325
  • 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

interpolation for xmin calculation

RobinCommander
RobinCommander over 9 years ago

As an addition to phase margin & gain margin in some AC open loop simulations I have been also been calculating the vector margin which can be useful.

I calculate it thus:

stb_x = xmin((abs((v("/Ampout" ?result "ac") - complex(-1.0 0.0)))**2))

stb_dB = (- db20(value(v("/Ampout" ?result "ac") stb_x)))

To get more accurate results I need to add more points/decade which can slow things down in swept simulations, I assume this is because only the data points are used in the xmin calculation. I was wondering if interpolation could somehow be used in the xmin calculation so I can speed up the simulations. Or maybe there is some other way of doing this calculation.


Thanks,

Robin

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Robin,

    I don't think it's a case of getting xmin to interpolate - the minimum y value must inherently be a point that's in the original waveform unless you do some kind of spline fit of the curve. However, I think that probably you want to find the closest point on the Nyquist plot to -1,0 - and that may not be at a point. I'll have a think about that.

    It wasn't obvious to me why you have the **2 (squared) term in your expression?

    Also, assuming that an interpolated x-value could be found, I think you'd want to do value(db20(...) rather than db20(value(...)) because that way it would linearly interpolate something in db which I think would probably be more appropriate (even then it's not quite right because you really want to linearly interpolate on a log-log curve, I guess. Right now it doesn't matter because the x point you're using value() at is one of the original points, and so there's no interpolation in the value() either.

    Anyway, I'll have a think about possibiities of calculating this vector margin. Potentially it could be a good enhancement for spectre's stb analysis to output this figure of merit too.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RobinCommander
    RobinCommander over 9 years ago
    Andrew,

    I didn't think there would be an easy answer for the interpolation, but thought it worth trying here.

    I think I got the expressions for evaluating the vector margin from here:
    www.circuitdesign.info/blog/2012/02/creating-a-nyquist-plot-with-cadence

    I didn't check if the **2 was useful, so maybe it isn't needed.

    Sometimes when sweeping a parameter in ac analysis I found the phase margin would improve but gain margin reduce so I started looking for another measure of stability for a third opinion.
    Also phase & gain margins are measured at single points which might miss any peaking between these two measurement points.

    Regards,
    Robin
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RobinCommander
    RobinCommander over 9 years ago

    p.s.

    I think the formula I gave above isn't really the Vector Margin as it measures the distance
    to the origin not to (-1,0).
    I think it should be:
    VectorMargin = abs(value((v("/Ampout" ?result "ac") - complex(-1.0 0.0)) stb_x))
    I've also seen this called stability margin. Recommended values I've seen are >= 0.33 to 0.5.

    A related measure is Vector Gain Margin which is somewhat similar to gain margin.

    VectorGainMargin_dB = db20(1 - abs(value((v("/Ampout" ?result "ac") - complex(-1.0 0.0)) stb_x)))

    You can also calculate Vector Phase Margin, although I'm not sure how useful that is:
    VectorPhaseMargin = value(phaseDeg(v("/Ampout" ?result "ac")) stb_x)

    Regards,

    Robin

    • 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