• 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. Inconsistent "PSD" results between MATLAB & Cadence Cal...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 125
  • Views 5888
  • 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

Inconsistent "PSD" results between MATLAB & Cadence Calculator

Cod Liang
Cod Liang over 7 years ago

Hi all,

I have been trying to verify the variance (total power) of a random normal distributed noise source.

The noise source model has been modified from the noise_src in ahdlLib but with $rdist_normal() rather than $random()/`MAXINT

V(vout) <+ amp*$rdist_normal(seed,0,1);

where amp is exactly one sigma in normal distribution case. 

In this example I give amp = 100u and the resulting output random signal is shown below:

I used to dump this signal to MATLAB and do the FFT & PSD calculations based on the script described in this website:

"Power Spectral Density Estimates Using FFT"

www.mathworks.com/.../power-spectral-density-estimates-using-fft.html

Take nfft = 65536, sampling time = 1/1GHz.

The resulting integral of the overall spectrum is EXACTLY equal to sigma^2 = (100u)^2.

The PSD setup in VIVA Calculator and the result are shown as follows: 

Then I apply iinteg to the PSD and take square root, and the integrated value at the final data point (0.5*sampling frequency)  is expected to be sigma=100u.

However, the outcome seems to be smaller than what is expected. ( (82u-100u)/100u ~ -18% error)

There is still a constant -18% error no matter what sigma value I give.

I also ran transient noise simulation with the resistor model given in analogLib to verify that 4kTR*NoiseFmax = sigma^2.

Again, there is a -18% gap between VIVA calculator PSD function and MATLAB PSD.

If I extract the PSD data from VIVA calculator and do integration in MATLAB, the result is identical to that done in VIVA calculator. (-18% sigma)

Based on the trials given above, I suspect the algorithm of PSD function in VIVA calculator is not what I expect to be.

Can someone help me clarify this problem? 

Thanks a lot :)

Version Information

virtuoso 6.1.7-64b

spectre 16.1.0 32b

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    I think this is because your limits are incorrect for the PSD. You need to set them to be between 0 and 65536*1n, not from 1n to 65536*1n. I ran my transient analysis and set strobeperiod to be 1/FSAMP (i.e. 1n). The ViVA PSD (and FFT) expects the interval to be the number of samples*sampleTime - it will however omit the very last point to ensure there are exactly 65536 samples in this case. What you're doing is messing up the sampling - you're probably getting lots of interpolation error by doing what you're doing (I didn't think too carefully what the root cause was). Seeing the graphs below - the bottom left is with the correct PSD interval, and the bottom right is with the interval you used:

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Cod Liang
    Cod Liang over 7 years ago in reply to Andrew Beckett

    Hi Andrew,

    Sorry for late reply.

    Indeed you've pointed out the problem I never thought before.

    The result is finally correlate with what I did in MATLAB after modifying the time interval you suggested.

    It's my bad to regard the VIVA calculator as taking the "FIRST/Start Time Point" and "LAST/End Time Point" for PSD or FFT calculation. (And that's why I took Ts ~ N*Ts.)

    I'm truly grateful for your kind help. And really sorry for taking your time to clarify the problem.

    Thanks a lot Slight smile

    Regards,

    Liang

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Cod Liang
    Cod Liang over 7 years ago in reply to Andrew Beckett

    Hi Andrew,

    Sorry for late reply.

    Indeed you've pointed out the problem I never thought before.

    The result is finally correlate with what I did in MATLAB after modifying the time interval you suggested.

    It's my bad to regard the VIVA calculator as taking the "FIRST/Start Time Point" and "LAST/End Time Point" for PSD or FFT calculation. (And that's why I took Ts ~ N*Ts.)

    I'm truly grateful for your kind help. And really sorry for taking your time to clarify the problem.

    Thanks a lot Slight smile

    Regards,

    Liang

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to Cod Liang

    Liang,

    Please don't feel the need to apologise! You provided a very clear question, with all the necessary details as to how to reproduce the problem. So it was quite straightforward for me to try it out and understand what had gone wrong. If only all the other questions on the forums could be as clear as yours!

    Kind Regards,

    Andrew.

    • 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