• 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 SKILL
  3. Harmonic Parametric

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 14166
  • 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

Harmonic Parametric

AMSboston
AMSboston over 15 years ago

Hi,

Below is a SKILL  to find the Harmonic Frequency distortion level.

If I run a single simulation I get the correct answer.

 However, if I run a Parametric Sweep of VAR("fin") I get the following error:

*Error* round: argument #1 should be a number (type template = "n") - drwave:213939744.

 I get the error because "FreqN" is a vector.

How do I modify the script below such that it can handle a Parametric Sweep?

BTW, if freqN was a list or a vector I could make the code work with a foreach command.

However, freqN is not a list, nor is it a vector.

What is it?

####################################################################### 

procedure( CCSharmonicDistNEW( tranwave dftFrom dftTo numSample freqN freq0)
     let( (res dftwave newFreqN)
     dftwave = dft(tranwave,dftFrom ,dftTo,numSample,"Rectangular",1,1)
newFreqN=abs(round(freqN/250e6)*250e6-freqN)
     res = db20( mag(value(dftwave newFreqN))/mag(value(dftwave freq0)))
     res
)
)

 ocnPrint(CCSharmonicDistNEW(VT("/XQDCA/RECONSTRUCTED") 42.2n 298.2n 64 3*VAR("fin") VAR("fin")))
############################################################################################

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 15 years ago
    Hi Dan,

    In pseudo code, famMap does:

    result=emptyFamily()
    foreach(familyMember tranwave
    indivResult=CCSharmonicDistNEW(familyMember dftFrom ...)
    addToFamily(result indivResult)
    )

    famMap essentially loops over the members of its second argument, calling the named function with all the specified arguments (but tranwave is replaced by the family member).

    So if you have a single dimensional family (a family of waveforms), it calls itself with each waveform in turn, and constructs either a waveform (if the result is a scalar) or a family (if the result is a wave).

    For families of families, it's going to peel one layer off at a time as it recursively calls the function with one fewer layer.

    Hope that helps to clarify it?

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 15 years ago
    Hi Dan,

    In pseudo code, famMap does:

    result=emptyFamily()
    foreach(familyMember tranwave
    indivResult=CCSharmonicDistNEW(familyMember dftFrom ...)
    addToFamily(result indivResult)
    )

    famMap essentially loops over the members of its second argument, calling the named function with all the specified arguments (but tranwave is replaced by the family member).

    So if you have a single dimensional family (a family of waveforms), it calls itself with each waveform in turn, and constructs either a waveform (if the result is a scalar) or a family (if the result is a wave).

    For families of families, it's going to peel one layer off at a time as it recursively calls the function with one fewer layer.

    Hope that helps to clarify it?

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 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