• 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. Parsevals theorem

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 124
  • Views 13487
  • 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

Parsevals theorem

itos
itos over 7 years ago

Hi,

I want to verify parsevals theorem in Cadence:

2.387E-3        stddev(v("/gnd" ?result "pss_td"))
2.387E-3        sqrt(integ(mag(v("/gnd" ?result "pss_td"))**2)/200e-9)
3.760E-3        sqrt(integ(mag(dft(v("/gnd" ?result "pss_td") 0 200n 2048 "Rectangular" 1 "default" 1.0 )/2048)**2))

The factor 3.76/2.387 is roughly pi/2 in which case I would accept it as some weird normalization. But not exactly. According to https://en.wikipedia.org/wiki/Parseval%27s_theorem my definition is valid.

What am I missing?

Thank you!

  • Cancel
Parents
  • itos
    itos over 7 years ago

    I try it again with this simple testbench:

    and running pss with 5MHz fundamental (containing 21 cycles), conservative, 51 harmonics.

    stddev(v("/out" ?result "pss_td"))

    is 707.1m, as expected.

    sqrt((integ((mag(v("/out" ?result "pss_td"))**2)) / 2e-07))

    is 707.1m, as expected.

    sqrt((integ((mag(dft(v("/out" ?result "pss_td") 0 2e-07 4096 "Rectangular" 1 "default" 1.0))**2)) / 5000000.0 / 2))

    is 706.1m - 0.15% off!

    WHY?

    (I divide the result by 10M because this is fs)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • itos
    itos over 7 years ago

    I try it again with this simple testbench:

    and running pss with 5MHz fundamental (containing 21 cycles), conservative, 51 harmonics.

    stddev(v("/out" ?result "pss_td"))

    is 707.1m, as expected.

    sqrt((integ((mag(v("/out" ?result "pss_td"))**2)) / 2e-07))

    is 707.1m, as expected.

    sqrt((integ((mag(dft(v("/out" ?result "pss_td") 0 2e-07 4096 "Rectangular" 1 "default" 1.0))**2)) / 5000000.0 / 2))

    is 706.1m - 0.15% off!

    WHY?

    (I divide the result by 10M because this is fs)

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

    It's because you don't have enough points in the shooting interval to do the DFT accurately - so you're suffering from interpolation error. If you plot the DFT you've done, you'll see the fundamental is a bit low - and this is the root cause.

    If instead you integrated the pss_fd results, you'd get the right answer because the Fourier integral used is more accurate. Alternatively, if you set (say) maxacfreq=16G on the pss analysis and then do the DFT, it would be fine.

    Or simpler still, do a transient and set strobeperiod so that the strobe points match the sample points of the DFT - that way you eliminate the interpolation error:

    tran tran stop=2e-7 strobeperiod=2e-7/2048

    Then if I do:

    printf("Tran power=%g\n" sqrt(integ(v("out" ?result "tran")**2)/2e-7))
    DFT=mag(dft(v("out" ?result "tran") 0 2e-7 2048 "Rectangular" 1 "default" 1.0 ))**2
    printf("Tran DFT integ=%g\n" sqrt(integ(DFT)/5M/2))

    I get:

    Tran power=0.707107
    Tran DFT integ=0.707107

    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