The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 2nd, 2024, 8:28am
Pages: 1
Send Topic Print
Using Fourier results in Cadence calculator expressions (Read 3470 times)
JSL
New Member
*
Offline



Posts: 2
Sunnyvale, CA
Using Fourier results in Cadence calculator expressions
Jan 30th, 2009, 9:56am
 
Hello, I have a syntax question about displaying/manipulating the results from Spectre's fourier analysis.  By default, the results are printed out in the spectre.out file.  I would like to set up my outputs in the Cadence framework to, for example, plot the 3rd harmonic while I sweep amplitude or some other variable.  Previously I have been doing this using a dft analysis on the transient, controlling the simulator options to get the desired accuracy, but the fourier method seems more efficient in terms of simulator time for a given accuracy.
Is there a standard way of calling the fourier results using a calculator expression?  I can manually build up somewhat complex expressions, for example this spits out the 3rd harmonic in terms of dBc from the fundamental:

value(dB20((v("/OUT" ?result "FOUR0-tran.refer_fourier") / abs(value(v("/OUT" ?result "FOUR0-tran.refer_fourier") VAR("frequency"))))) (3 * VAR("frequency")))

(Note that in this case the signal being measured is node "OUT" and I have defined a variable named "frequency" which sets the frequency of an independent source's sine wave)

THD is messier.  Is there a shortcut?

Thanks in advance.
Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Using Fourier results in Cadence calculator expressions
Reply #1 - Feb 3rd, 2009, 10:03pm
 
The easiest way would be to write a function (since it's SKILL) and then use that:

Code:
procedure(MYharm(netName harm)
let((signal harm1 harmN)
  selectResult("FOUR0-tran.refer_fourier")
  harm1=VAR("frequency")
  harmN=harm1*harm
  signal=v(netName)
  value(dB20(signal / abs(value(signal harm1))) harmN)
)) 



Define this in your .cdsinit (or put it in a file that you load from the .cdsinit) and then all you need to use in the calculator is:

MYharm("/OUT" 3)

You could even create a custom calculator function out of this. There are lots of examples of that on sourcelink - for example, solution 11018920.

(Note, I didn't test the code above - it was just a transformation of your example).

Regards,

Andrew.
Back to top
 
 
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.