Product Documentation
OCEAN Reference
Product Version IC23.1, September 2023

10


Predefined and Waveform (Calculator) Functions

This chapter contains information about the following functions.

Predefined Arithmetic Functions

Several functions are predefined in the Virtuoso® SKILL language. The full syntax and brief definitions for these functions follows the table.

Predefined Arithmetic Functions

Synopsis Result

General Functions

add1(n)

n + 1

abs

| n |

sub1(n)

n – 1

exp(n)

e raised to the power n

linRg(n_from, n_to, n_by)

Returns list of numbers in linear range from n_from to n_to in n_by steps

log(n)

Natural logarithm of n

logRg(n_from, n_to, n_by)

Returns list of numbers in log10 range from n_from to n_to in n_by steps

max(n1 n2 …)

Maximum of the given arguments

min(n1 n2 …)

Minimum of the given arguments

mod(x1 x2)

x1 modulo x2, that is, the integer remainder of dividing x1 by x2

round(n)

Integer whose value is closest to n

sqrt(n)

Square root of n

Trigonometric Functions

sin(n)

sine, argument n is in radians

cos(n)

cosine

tan(n)

tangent

asin(n)

arc sine, result is in radians

acos(n)

arc cosine

atan(n)

arc tangent

Random Number Generator

random(x)

Returns a random integer between 0 and x-1. If random is called with no arguments, it returns an integer that has all of its bits randomly set.

srandom(x)

Sets the initial state of the random number generator to x.

abs

abs( 
n_number
) 
=> n_result

Description

Returns the absolute value of a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

n_result

The absolute value of n_number.

Example

abs( -209.625) 
=> 209.625
abs( -23) 
=> 23

acos

acos( n_number
) 
=> f_result

Description

Returns the arc cosine of a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

f_result

Returns the arc cosine of n_number.

Example

acos(0.3) 
=> 1.266104

add1

add1( 
n_number 
) 
=> n_result

Description

Adds 1 to a floating-point number or integer.

Arguments

n_number

Floating-point number or integer to increase by 1.

Value Returned

n_result

n_number plus 1.

Example

add1( 59 ) 
=> 60

Adds 1 to 59.

asin

asin( 
n_number 
) 
=> f_result

Description

Returns the arc sine of a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

f_result

The arc sine of n_number.

Example

asin(0.3) 
=> 0.3046927

atan

atan( 
n_number
) 
=> f_result

Description

Returns the arc tangent of a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

f_result

The arc tangent of n_number.

Example

atan(0.3) 
=> 0.2914568

cos

cos( 
n_number
) 
=> f_result

Description

Returns the cosine of a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

f_result

The cosine of n_number.

Example

cos(0.3) 
=> 0.9553365
cos(3.14/2) 
=> 0.0007963

exp

exp( 
n_number 
) 
=> f_result

Description

Raises e to a given power.

Arguments

n_number

Power to raise e to.

Value Returned

f_result

The value of e raised to the power n_number.

Example

exp( 1 ) 
=> 2.718282
exp( 3.0 ) 
=> 20.08554

int

int( 
n_arg
) 
=> x_result

Description

Returns the largest integer not larger than the given argument.

This function works on vector as well as waveform data. The function is applied to individual elements of the vector and waveform data.

Arguments

n_arg

A numeric value (which can be integer or floating point number).

Value Returned

x_result

The value of the largest integer not larger than the value specified by n_arg.

Example

int( 3.01 ) 
=> 3
int( 3.99 ) 
=> 3

linRg

linRg(
n_from n_to n_by 
) 
=> l_range / nil

Description

Returns a list of numbers in the linear range from n_from to n_to incremented by n_by.

Arguments

n_from

Smaller number in the linear range.

n_to

Larger number in the linear range.

n_by

Increment value when stepping through the range.

Value Returned

l_range

List of numbers in the linear range.

nil

Returned if error.

Example

range = linRg(-30 30 5)
(-30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30)

log

log( 
n_number
) 
=> f_result

Description

Returns the natural logarithm of a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

f_result

The natural logarithm of n_number.

Example

log( 3.0 ) 
=> 1.098612

logRg

logRg(
n_from n_to n_by 
) 
=> l_range / nil 

Description

Returns a list of numbers in the log10 range from n_from to n_to advanced by n_by.

The list is a geometric progression where the multiplier is 10 raised to the 1/n_by power. For example if n_by is 0.5, the multiplier is 10 raised to the 2nd power or 100.

Arguments

n_from

Smaller number in the linear range.

n_to

Larger number in the linear range.

n_by

Increment value when stepping through the range.

Value Returned

l_range

List of numbers in the linear range.

nil

Returned if error.

Example

logRg(1 1M 0.5)
(1.0 100.0 10000.0 1000000.0)

max

max( 
n_num1 n_num2 [ n_num3 … ] 
) 
=> n_result

Description

Returns the maximum of the values passed in. Requires a minimum of two arguments.

Arguments

n_num1

First value to check.

n_num2

Next value to check.

[n_num3…]

Additional values to check.

Value Returned

n_result

The maximum of the values passed in.

Example

max(3 2 1) 
=> 3
max(-3 -2 -1) 
=> -1

min

min(
n_num1 n_num2 [ n_num3 … ] 
) 
=> n_result

Description

Returns the minimum of the values passed in. Requires a minimum of two arguments.

Arguments

n_num1

First value to check.

n_num2

Next value to check.

[n_num3…]

Additional values to check.

Value Returned

n_result

The minimum of the values passed in.

Example

min(1 2 3) 
=> 1
min(-1 -2.0 -3) 
=> -3.0

mod

mod( 
x_integer1 
x_integer2
) 
=> x_result

Description

Returns the integer remainder of dividing two integers. The remainder is either zero or has the sign of the dividend.

Arguments

x_integer1

Dividend.

x_integer2

Divisor.

Value Returned

x_result

The integer remainder of the division. The sign is determined by the dividend.

Example

mod(4 3) 
=> 1

random

random( 
[ x_number ] 
) 
=> x_result

Description

Returns a random integer between 0 and x_number minus 1.

If you call random with no arguments, it returns an integer that has all of its bits randomly set.

Arguments

x_number

An integer.

Value Returned

x_result

Returns a random integer between 0 and x_number minus 1.

Example

random( 93 ) 
=> 26

round

round(
n_arg 
) 
=> x_result

Description

Rounds a floating-point number to its closest integer value.

Arguments

n_arg

Floating-point number.

Value Returned

x_result

The integer whose value is closest to n_arg.

Example

round(1.5) 
=> 2
round(-1.49) 
=> -1
round(1.49) 
=> 1

sin

sin( 
n_number
) 
=> f_result

Description

Returns the sine of a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

f_result

The sine of n_number.

Example

sin(3.14/2) 
=> 0.9999997
sin(3.14159/2) 
=> 1.0

Floating-point results from evaluating the same expressions might be machine-dependent.

sqrt

sqrt(
n_number 
) 
=> f_result

Description

Returns the square root of a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

f_result

The square root of n_number.

Example

sqrt( 49 ) 
=> 7.0
sqrt( 43942 ) 
=> 209.6235

srandom

srandom(
x_number 
) 
=> t

Description

Sets the seed of the random number generator to a given number.

Arguments

x_number

An integer.

Value Returned

t

This function always returns t.

Example

srandom( 89 ) 
=> t

sub1

sub1( 
n_number
) 
=> n_result

Description

Subtracts 1 from a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

n_result

Returns n_number minus 1.

Example

sub1( 59 ) 
=> 58

Subtracts 1 from 59.

tan

tan(
n_number
) 
=> f_result

Description

Returns the tangent of a floating-point number or integer.

Arguments

n_number

Floating-point number or integer.

Value Returned

f_result

The tangent of n_number.

Example

tan( 3.0 ) 
=> -0.1425465

xor

xor( 
g_in1 
g_in2 
) 
=> g_res

Description

Returns the XOR value of the boolean inputs.

Arguments

g_in1

The first boolean input.

g_in2

The second boolean input.

Value Returned

g_res

The resultant XOR value.

Example

xor(nil nil) 
=> nil
xor(t nil) 
=> t
xor(nil t) 
=> t
xor(t t) 
=> nil

Waveform (Calculator) Functions

The calculator commands are described in this section.

average

average( 
o_waveform 
[ ?overall g_overall ]
[ ?continuous g_continuous ]
) 
=> n_average / o_waveformAverage / nil

Description

Computes the average of a waveform over its entire range.

If y=f(x):

For a continuous signal, the average is calculated as the integral of the expression f(x) over the range of x, divided by the range of x.

For a discrete signal, the average is calculated by dividing the sum of all y values by the total number of data points.

where, from is the initial value for x and to is the final value of x, and N is the total number of data points.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

?overall g_overall

Specifies whether to calculate the overall average across corners and sweeps. Possible values are t and nil.

  • When the overall argument is set to t, the average is calculated across all corners and sweeps.
  • When the overall argument is set to nil, the average is calculated per leaf.

The default value is t.

?continuous g_continuous

Specifies whether to calculate the average amplitude of the input waveform by considering it as a continuous signal or as a discrete signal. Possible values are:

  • t: The waveform is considered as a continuous signal.
  • nil: The waveform is considered as a discrete signal.

The default value is t.

Value Returned

n_average

Returns a number representing the average value of the input waveform.

o_waveformAverage

Returns a waveform (or family of waveforms) representing the average value if the input is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

average( v( "/net9" ) )

Gets the average voltage (Y-axis value) of /net9 over the entire time range specified in the simulation analysis.

abs_jitter

abs_jitter(
o_waveform 
t_crossType 
n_threshold 
[ ?xUnit t_xUnit ]
[ ?yUnit t_yUnit ]
[ ?Tnom n_Tnom ])
=> o_waveform / nil

Description

Calculates the absolute jitter values in the intput waveform for the given threshold. The output waveform can be expressed in degrees, radians, or unit intervals (UI). The absolute jitter can be plotted as a function of cycle number, crossing time, or reference clock time.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

t_crossType

The points at which the curves of the waveform intersect with the threshold. While intersecting, the curve may be either rising or falling.

Valid values: rising and falling, respectively.

Default crossType is rising.

n_threshold

The threshold value against which the at which the input waveform intersects to calculate the absolute jitter.

?xUnit t_xUnit

The unit defined for X-axis of the output waveform.

Valid values: s (time) and cycle.

Default: s

Cycle numbers refer to the n’th occurrence where the waveform crosses the given threshold.

?yUnit t_yUnit

The unit defined for Y-axis of the output waveform.

Valid values: rad (radians), UI (unit intervals), and s (degrees)

Default value: rad.

?Tnom n_Tnom

The nominal time period of the input waveform. The waveform is expected to be a periodic waveform that contains noise. If Tnom is nil, the abs_jitter function finds the approximate average time period of the input waveform.

Default value: nil.

Value Returned

o_waveform

Returns a waveform representing the absolute jitter value for the given threshold.

nil

Returns nil and an error message otherwise.

Example

abs_jitter(v("net9" "rising" 1.0 ?xUnit "cycle" ?yUnit "UI" )

Gets the absolute jitter /net9 for the threshold value 1.0. Tnom value is selected as nil.

analog2Digital

analog2Digital( 
o_wave
t_thresholdType
[ ?vhi n_vhi ]
[ ?vlo n_vlo ]
[ ?vc n_vc ]
[ ?timeX n_timex ]
) 
=> o_digWave / n_digval / nil

Description

Returns the digital form of the analog input, which can be a waveform, list or family of waveforms, or a string representation of expression(s).

Arguments

o_wave

Input waveform.

t_thresholdType

Can take the values hilo or centre. If t_thresholdType is centre, it is a high state (1) unless its value is less than n_vc, in which case it is a low state (0). If t_thresholdType is hilo, any value less than n_vlo is a low state (0), any value greater than n_vhi is a high state (1) and the rest is treated as unknown based on the value of n_timex.

?vhi o_vhi

High threshold value (used only when t_thresholdType is hilo). If you do not specify this value, it is calculated internally as:

vHigh = (topLine - bottomLine)*0.6 + bottomline

?vlo o_vlo

Low threshold value (used only when t_thresholdType is hilo). If you do not specify this value, it is calculated internally as:

vLow = (topLine - bottomLine)*0.4 + bottomline

?vc o_vc

Central threshold value (used only when t_thresholdType is centre). If you do not specify this value, it is calculated internally using vCenter = average(wave).

?timeX n_timeX

The value that determines logic X. The timeX value is used to decide the state X. When threshold is hilo, the analog signal will be converted to logic X if:

  • analog signal value lies between vHigh and vLow
  • lapse time between vHigh and vLow is larger than timeX

Value Returned

o_digWave

A waveform (or a list of waveforms) is returned if the analog input specified was o_wave.

o_digVal

A scalar value is returned if the analog input specified was o_val.

nil

Returns nil if the specified Waveform window does not exist.

Example

analog2Digital(v

analog2Digital(v("clk" ?result "tran" ?resultsDir "./mixed/test/adc_8bit.raw")  "hilo" ?vHigh 1.78 ?vLow 0.2 ?timeX 1n)

awvCreateBus

awvCreateBus(
w_bus
l_wavelist
r_radix
)

Definition

Creates a bus with the given digital signals and radix.

Arguments

w_bus

Name of the digital waveform representing a bus.

l_wavelist

List of the digital waveforms in the bus.

r_radix

Radix of the bus.

Value Returned

None.

Example

Following are the examples to create a digital binary bus with name bus.

awvCreateBus("bus" list( awvAnalog2Digital( v("/data<0> " ?result "tran-tran") nil nil 0.5 nil "centre")

awvAnalog2Digital( v("/datab<1> " ?result "tran-tran")  nil nil 0.5 nil "centre")

awvAnalog2Digital( v("/data<1> " ?result "tran-tran") nil nil 0.5 nil "centre")

awvAnalog2Digital( v("/datab<0> " ?result "tran-tran")  nil nil 0.5 nil "centre") ) "Binary")

awvPlaceXMarker

awvPlaceXMarker( 
w_windowId 
n_xLoc 
[ ?subwindow x_subwindowId ]
[ ?label t_label ] 
) 
=> t_xLoc / t / nil

Description

Places a vertical marker at a specific x-coordinate in the optionally specified subwindow of the specified window.

Arguments

w_windowId

Waveform window ID.

n_xLoc

The x-coordinate at which to place the marker.

?subwindow x_subwindowId

Waveform subwindow ID.

?label t_label

Value Returned

t_xLoc

Returns a string of x-coordinates if the command is successful and the vertical marker info form is opened.

t

Returns this when the command is successful but the vertical marker info form is not opened.

nil

Returns nil or an error message.

Example

awvPlaceXMarker( window 5) => "5" 

Vertical marker info form is opened when the command is executed.

awvPlaceXMarker( window 6 ?subwindow 2) => t 

Vertical marker info form is not opened.

awvPlaceYMarker

awvPlaceYMarker(
w_windowId 
n_yLoc 
[ ?subwindow x_subwindowId ]
[ ?label t_label ]
) 
=> t_yLoc / t / nil

Description

Places a horizontal marker at a specific y-coordinate in the optionally specified subwindow of the specified window.

Arguments

w_windowId

Waveform window ID.

n_yLoc

The y-coordinate at which to place the marker.

?subwindow x_subwindowId

Waveform subwindow ID.

?label t_label

Value Returned

t_yLoc

Returns a string of y-coordinates if the command is successful and the horizontal marker info form is opened.

t

Returns this when the command is successful but the horizontal marker info form is not opened.

nil

Returns nil or an error message.

Example

awvRefreshOutputPlotWindows

awvRefreshOutputPlotWindows(
s_session
)

Description

Refreshes all existing plot windows (with new simulation data, if any) attached with the session s_session.

Arguments

s_session

Currently active environment variable.

Value Returned

None.

b1f

b1f( 
o_s11
o_s12 
o_s21 
o_s22
) 
=> o_waveform / nil

Description

Returns the alternative stability factor in terms of the supplied parameters.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

Value Returned

o_waveform

Waveform object representing the alternative stability factor.

nil

Returns nil and an error message otherwise.

Example

s11 = sp(1 1)
s12 = sp(1 2)
s21 = sp(2 1)
s22 = sp(2 2)
plot(b1f(s11 s12 s21 s22))

bandwidth

bandwidth( 
o_waveform 
n_db 
t_type
) 
=> n_value / o_waveform / nil

Description

Calculates the bandwidth of a waveform.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_db

Positive number that defines the bandwidth.

t_type

Type of input filter.

Valid values: "low", "high" or "band".

Value Returned

n_value

Returns a number representing the value of the bandwidth if the input argument is a single waveform.

o_waveform

Returns a waveform (or family of waveforms) representing the bandwidth if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

bandwidth( v( "/OUT" ) 3 "low")

Gets the 3 dB bandwidth of a low-pass filter.

bandwidth( v( "/OUT" ) 4 "band" )

Gets the 4 dB bandwidth of a band-pass filter.

clip

clip(
o_waveform
n_from
n_to
[?interpolate g_interpolate ]
) 
=> o_waveform / nil

Description

Restricts the waveform to the range defined by n_from and n_to.

You can use the clip function to restrict the range of action of other commands. If n_from is nil, n_from is taken to be the first X value of the waveform, and if n_to is nil, n_to is taken to be the last x value of the waveform. If both n_to and n_from are nil, the original waveform is returned.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_from

Starting value for the range on the X axis.

n_to

Ending value for the range on the X axis.

?interpolate g_interpolate

Specifies whether to use the interpolated values for the n_from and n_to arguments in the clipped result when their specified values do not correspond to any actual data points. The default is t.

If you set it to nil, the result will include only the actual data points between n_from and n_to values.

Value Returned

o_waveform

Returns a waveform object if the input argument is a waveform object or returns a family of waveforms if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

x = clip( v( "/net9" ) 2m 4m )
plot( x )

Plots the portion of a waveform that ranges from 2 ms to 4 ms.

plot( clip( v( "/net9" ) nil nil ) )

Plots the original waveform.

plot( clip( v( "/net9" ) nil 3m ) )

Plots the portion of a waveform that ranges from 0 to 3 ms.

clipX

clipX( 
o_waveform 
n_from 
n_to 
)
=> o_waveform / nil

Description

Restricts the waveform to the range defined by n_from and n_to.

The clipX function works in the same manner as the clip function, with an exception that clipX restricts the waveform within the range [from, to] without interpolating or extrapolating any values. In other words, clipX returns a waveform that consists only data points from the input waveform.

The clipX function snaps the from and/or to values to a data point in the input waveform if these values are less than 1e-6 * stepSize, where stepSize is the average step of the input waveform in range [from,to].

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_from

Starting value for the range on the X axis.

n_to

Ending value for the range on the X axis.

Value Returned

o_waveform

Returns a waveform object if the input argument is a waveform object or returns a family of waveforms if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

closeResults

closeResults(
t_dirName
)
=> t / nil

Definition

Closes the simulation results stored in the input results directory. The function closes all the internal resources opened by the tool that are related to the results directory. It is recommended that you must call this function before deleting a results directory, moving the directory to any other location, or renaming a results directory.

After calling the closeResults function, the OCEAN commands, such as selectResults, getData, pv, which can also be called without passing the resultsDir argument and run based upon previously called openResults call, stops working if called without passing the resultsDir argument.

Arguments

t_dirName

Name of the directory which was earlier used in the openResults function.

Values Returned

t

If the results database has been closed successfully.

nil

If the results database has not been closed successfully.

compare

compare( 
o_waveform1
o_waveform1 
[ f_abstol [ f_reltol ] ]
) 
=> o_comparisonWaveform / nil

Description

Compares the two given waveforms based on the specified values for absolute and relative tolerances. This function compares only the sections of the two waveforms where the X or independent axes overlap.

The following situations are possible:

The function also compares parametric waveforms. However, for a successful comparison of parametric waveforms, the family tree structures of the two input waveforms should be the same. For both the input waveforms, the number of child waveforms at each level should also be the same, except at the leaf level where the elements are simple scalars. This is an obvious condition to obtain a meaningful comparison.

Arguments

o_waveform1

Waveform 1.

o_waveform2

Waveform 2.

f_abstol

Absolute tolerance.

Default value: 0.0

f_reltol

Relative tolerance.

Default value: 0.0

Value Returned

o_comparisonWaveform

Returns the difference of the two given waveforms based on the specified values of the relative and absolute tolerances.

nil

Returns nil and an error message otherwise.

Example

compare( wave1 wave2 2.2 0.4 )
=> srrWave:175051528

Returns the difference of the waveforms wave1 and wave2 based on the specified absolute and relative tolerances of 2.2 and 0.4, respectively.

compression

compression( 
o_waveform  
[ ?x f_x ]  
[ ?y f_y ]  
[ ?compression f_compression ]  
[ ?io s_measure ] 
[ ?tanSlope t_tanSlope ]
) 
=> f_compPoint / nil

Description

Performs an nth compression point measurement on a power waveform.

The compression function uses the power waveform to extrapolate a line of constant slope (dB/dB) according to a specified input or output power level. This line represents constant small-signal power gain (ideal gain). The function finds the point where the power waveform drops n dB from the constant slope line and returns either the X coordinate (input referred) value or the Y coordinate (output referred) value.

Arguments

o_waveform

Waveform object representing output power (in dBm) versus input power (in dBm).

?x f_x

The X coordinate value (in dBm) used to indicate the point on the output power waveform where the constant-slope power line begins. This point should be in the linear region of operation.

Default value: Unless f_y is specified, defaults to the X coordinate of the first point of the o_waveform wave.

?y f_y

The Y coordinate value (in dBm) used to indicate the point on the output power waveform where the constant-slope power line begins. This point should be in the linear region of operation.

Default value: Unless f_x is specified, defaults to the Y coordinate of the first point of the o_waveform wave.

?compression f_compression

The delta (in dB) between the power waveform and the ideal gain line that marks the compression point.

Default value: 1

?io s_measure

Symbol indicating whether the measurement is to be input referred (’input) or output referred (’output).

Default value: input

?tanSlope tranSlope

Default value: 1

Value Returned

f_compPoint

Depending on the setting of s_measure, returns either input referred or output referred compression point.

nil

Returns nil and an error message otherwise.

Example

xloc = compression( wave ?x -25 ?compress 1)
yloc = compression( wave ?x -25 ?measure "Output")
; Each of following returns a compression measurement:
compression(dB20(harmonic(v("/Pif" ?result "pss_fd") 2)))
compression(dbm(harmonic(spectralPower(v("/Pif" 
?result "pss_fd")/ 50.0
v("/Pif" ?result "pss_fd")) 2)))
compression(dbm(harmonic(spectralPower(v("/Pif" 
?result "pss_fd")/resultParam("rif:r"
?result "pss_td") v("/Pif"
?result "pss_fd")) 2)))
compression(dbm(harmonic(spectralPower(i("/rif/PLUS" 
?result "pss_fd") v("/Pif" ?result "pss_fd")) 2))
?x -25 ?compress 0.1 ?measure "Output")

compressionVRI

compressionVRI( 
o_vport 
x_harm 
[ ?iport o_iport ]
[ ?rport f_rport ] 
[ ?epoint f_epoint ] 
[ ?gcomp f_gcomp ] 
[ ?measure s_measure ] 
[ ?format format ]
)
=> o_waveform / n_number / nil

Description

Performs an nth compression point measurement on a power waveform.

Use this function to simplify the declaration of a compression measurement. This function extracts the specified harmonic from the input waveform(s), and uses dBm(spectralPower((i or v/r),v)) to calculate a power waveform. The function passes this power curve and the remaining arguments to the compression function to complete the measurement.

The compression function uses the power waveform to extrapolate a line of constant slope (dB/dB) according to a specified input or output power level. This line represents constant small-signal power gain (ideal gain). The function finds the point where the power waveform drops n dB from the constant slope line and returns either the X coordinate (input referred) value or the Y coordinate (output referred) value.

Arguments

o_vport

Voltage across the output port. This argument must be a family of spectrum waveforms (1 point per harmonic) created by parametrically sweeping an input power (in dBm) of the circuit.

x_harm

Harmonic index of the voltage wave contained in o_vport. When o_iport is specified, also applies to a current waveform contained in o_iport.

?iport o_iport

Current into the output port. This argument must be a family of spectrum waveforms (1 point per harmonic) created by parametrically sweeping an input power (in dBm) of the circuit. When specified, the output power is calculated using voltage and current.

Default value: nil

?rport f_rport

Resistance into the output port. When specified and o_iport is nil, the output power is calculated using voltage and resistance.

Default value: 50

?epoint f_epoint

The X coordinate value (in dBm) used to indicate the point on the output power waveform where the constant-slope power line begins. This point should be in the linear region of operation.

Default value: the X coordinate of the first point of the o_waveform wave

?gcomp f_gcomp

The delta (in dB) between the power waveform and the ideal gain line that marks the compression point.

Default value: 1

?measure s_measure

Symbol indicating if measurement is to be input referred (’input) or output referred (’output).

Default value: input

?format format

Default Value: power

Value Returned

o_waveform

Returns a waveform when o_waveform1 is a family of waveforms.

f_number

Returns a number when o_waveform1 is a waveform.

nil

Returns nil and an error message otherwise.

Example

Each of the following returns a compression measurement:
compressionVRI(v("/Pif" ?result "pss_fd") 2)
compressionVRI(v("/Pif" ?result "pss_fd") 2
?rport resultParam("rif:r" ?result "pss_td"))
compressionVRI(v("/Pif" ?result "pss_fd") 2
?iport i("/rif/PLUS" ?result "pss_fd") ?epoint -25
?gcomp 0.1 ?measure "Output")

compressionVRICurves

compressionVRICurves( 
o_vport 
x_harm 
[ ?iport o_iport ] 
[ ?rport f_rport ] 
[ ?epoint f_epoint ]
[ ?gcomp f_gcomp ] 
[ ?format format ]
) 
=> o_waveform / nil

Description

Constructs the waveforms associated with an nth compression measurement.

Use this function to simplify the creation of waveforms associated with a compression measurement. This function extracts the specified harmonic from the input waveform(s), and uses dBm(spectralPower((i or v/r),v)) to calculate a power waveform.

The compressionVRICurves function uses the power waveform to extrapolate a line of constant slope (1dB/1dB) according to a specified input or output power level. This line represents constant small-signal power gain (ideal gain). The function shifts the line down by n dB and returns it, along with the power waveform, as a family of waveforms.

This function only creates waveforms and neither performs a compression measurement nor includes labels with the waveforms. Use the compression or compressionVRI function for making measurements.

Arguments

o_vport

Voltage across the output port. This argument must be a family of spectrum waveforms (1 point per harmonic) created by parametrically sweeping an input power (in dBm) of the circuit.

x_harm

Harmonic index of the wave contained in o_vport. When o_iport is specified, also applies to a current waveform contained in o_iport.

?iport o_iport

Current into the output port. This argument must be a family of spectrum waveforms (1 point per harmonic) created by parametrically sweeping an input power (in dBm) of the circuit. When specified, the output power is calculated using voltage and current.

Default value: nil

?rport f_rport

Resistance into the output port. When specified and o_iport is nil, the output power is calculated using voltage and resistance.

Default value: 50

?epoint f_epoint

The X coordinate value (in dBm) used to indicate the point on the output power waveform where the constant-slope power line begins. This point should be in the linear region of operation.

Default value: the X coordinate of the first point of the o_waveform wave

?gcomp f_gcomp

The delta (in dB) between the power waveform and the ideal gain line that marks the compression point.

Default value: 1

?format format

Default Value: power

Value Returned

o_waveform

Returns a family of waveforms containing the output power and tangent line.

nil

Returns nil and an error message otherwise.

Example

Each of following examples returns curves related to a compression measurement:
compressionVRICurves(v("/Pif" ?result "pss_fd") 2)
compressionVRICurves(v("/Pif" ?result "pss_fd") 2
?rport resultParam("rif:r" ?result "pss_td"))
compressionVRICurves(v("/Pif" ?result "pss_fd") 2
?iport i("/rif/PLUS" ?result "pss_fd") ?epoint -25
?gcomp 0.1)

complex

complex( 
f_real 
f_imaginary
) 
=> o_complex 

Description

Creates a complex number of which the real part is equal to the real argument, and the imaginary part is equal to the imaginary argument.

Arguments

f_real

The real part of the complex number.

f_imaginary

The imaginary part of the complex number.

Value Returned

o_complex

Returns the complex number.

Example

complex( 1.0 2.0 ) 
=> complex( 1, 2 )

complexp

complexp(
g_value 
) 
=> t / nil

Description

Checks if an object is a complex number. The suffix p is added to the name of a function to indicate that it is a predicate function.

Arguments

g_value

A skill object.

Value Returned

t

Returns t when g_value is a complex number.

nil

Returns nil if there is an error.

Example

complexp( (complex 0 1) ) 
=> t
complexp( 1.0 ) 
=> nil

conjugate

conjugate(
{ o_waveform | n_x }
) 
=> o_waveform / n_y / nil

Description

Returns the conjugate of a waveform or number.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_x

Complex or imaginary number.

Value Returned

o_waveform

Returns the conjugate of a waveform if the input argument is a waveform.

n_y

Returns the result of n_x being mirrored against the real axis (X axis) if the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

For this example, assume that the first three statements are true for the conjugate function that follows them.

x=complex(-1 -2)
real(x) = -1.0
imag(x) = -2.0
conjugate(x) = complex(-1, 2)

Returns the conjugate of the input complex number.

convolve

convolve( 
o_waveform1
o_waveform2
n_from 
n_to 
t_type 
n_by 
) 
=> o_waveform /n_number /nil

Description

Computes the convolution of two waveforms.

Convolution is defined as

f1 and f2 are the functions defined by the first and second waveforms.

The convolve function is numerically intensive and might take longer than the other functions to compute.

Arguments

o_waveform1

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

o_waveform2

Additional waveform object.

n_from

Starting point (X-axis value) of the integration range.

n_to

Ending point (X-axis value) of the integration range.

t_type

Type of interpolation.

Valid values: "linear" or "log".

n_by

Increment.

Value Returned

o_waveform

Returns a waveform object representing the convolution if one of the input arguments is a waveform. Returns a family of waveforms if either of the input arguments is a family of waveforms.

n_number

Returns a value representing the convolution if both of the input arguments are numbers.

nil

Returns nil and an error message otherwise.

Example

sinWave = expr( n sin( n ) linRg( 0 20 0.01 ) )
triWave = artListToWaveform( ’( ( -4, 0 ) ( -3, 1 ) ( -2, 0 ) ( -1, -1 ) ( 0, 0 ) ( 1, 1 ) ( 2, 0 ) ( 3, -1 ) ( 4, 0 ) )
plot( convolve( sinWave triWave 0 10 "linear" 1 ) )

Gets the waveform from the convolution of the sine waveform and triangle waveform within the range of 0 to 10.

cPwrContour

cPwrContour( 
o_iwave 
o_vwave 
x_harm 
[ ?iwaveLoad o_iwaveLoad ] 
[ ?vwaveLoad o_vwaveLoad ] 
[ ?maxPower f_maxPower ] 
[ ?minPower f_minPower ] 
[ ?numCont x_numCont ]
[ ?refImp f_refImp ]
[ ?closeCont g_closeCont ] 
[ ?modifier s_modifier ]
[ ?ifam ifam ]
[ ?vfam vfam ]
) 
=> o_waveform / nil

Description

Constructs constant power contours for Z-Smith plotting. The trace of each contour correlates to reference reflection coefficients that all result in the same power level.

The x_harm harmonic is extracted from all the input waveforms. Power is calculated using the spectralPower function. The reference reflection coefficients are calculated using voltage, current, and a reference resistance.

Arguments

o_iwave

Current used to calculate power, expected to be a two-dimensional family of harmonic waveforms.

o_vwave

Voltage used to calculate power, expected to be a two-dimensional family of harmonic waveforms.

x_harm

Harmonic index of the waves contained in o_iwave and o_vwave.

?iwaveLoad o_iwaveLoad

Current used to calculate reflection coefficient, expected to be a two-dimensional family of harmonic waveforms.

Default value: o_iwave

?vwaveLoad o_vwaveLoad

Voltage used to calculate reflection coefficient, expected to be a two-dimensional family of harmonic waveforms.

Default value: o_vwave

?maxPower f_maxPower

Maximum power magnitude value for contours.

Default value: automatic

?minPower f_minPower

Minimum power magnitude value for contours.

Default value: automatic

?numCont x_numCont

Total number of contours returned.

Default value: 8

?refImp f_refImp

Reference resistance used to calculate reflection coefficients.

Default value: 50

?closeCont g_closeCont

Boolean indicating when to close the contours. When nil, largest segment of each contour is left open.

Default value: nil

?modifier s_modifier

Symbol indicating the modifier function to apply to the calculated power. The modifier function can be any single argument OCEAN function such as db10 or dBm.

Default value: dbm

?ifam ifam

?vfam vfam

Value Returned

o_waveform

Returns a family of waveforms (contours) for Z-Smith plotting.

nil

Returns nil and an error message otherwise.

Example

The following example plots constant output power contours according to output:

cPwrContour(i("/I8/out" ?result "pss_fd") v("/net28" 
?result "pss_fd")1)

The following example plots constant output power contours according to output reflection coefficients:

cPwrContour(i("/I8/out" ?result "pss_fd") v("/net28" 
?result "pss_fd") 1 ?maxPower 0.002 ?minPower 0.001 ?numCont 9)

The following example plots constant input power contours according to output reflection coefficients:

cPwrContour(i("/C25/PLUS" ?result "pss_fd") v("/net30" 
?result "pss_fd") 1 ?iwaveLoad i("/I8/out" ?result "pss_fd")
?vwaveLoad v("/net28" ?result "pss_fd") ?refImp 50.0
?numCont 9 ?modifier "mag")

cReflContour

cReflContour( 
o_iwave 
o_vwave 
x_harm 
[ ?iwaveLoad o_iwaveLoad ] 
[ ?vwaveLoad o_vwaveLoad ] 
[ ?maxRefl f_maxRefl ] 
[ ?minRefl f_minRefl ] 
[ ?numCont x_numCont ] 
[ ?refImp f_refImp ] 
[ ?closeCont g_closeCont ] 
) 
=> o_waveform / nil

Description

Constructs constant reflection coefficient magnitude contours for Z-Smith plotting. The trace of each contour correlates to reference reflection coefficients that all result in the same reflection coefficient magnitude.

The x_harm harmonic is extracted from all the input waveforms. Reflection coefficient magnitude is calculated using voltage, current, reference resistance, and the mag function. The reference reflection coefficients are calculated separately by using voltage, current, and a reference resistance.

Arguments

o_iwave

Current used to calculate reflection coefficient magnitude, expected to be a two-dimensional family of spectrum waveforms.

o_vwave

Voltage used to calculate reflection coefficient magnitude, expected to be a two-dimensional family of spectrum waveforms.

x_harm

Harmonic index of the waves contained in o_iwave and o_vwave.

?iwaveLoad o_iwaveLoad

Current used to calculate reference reflection coefficient, expected to be a two-dimensional family of harmonic waveforms.

Default value: o_iwave

?vwaveLoad o_vwaveLoad

Voltage used to calculate reference reflection coefficient, expected to be a two-dimensional family of spectrum waveforms.

Default value: o_vwave

?maxRefl f_maxRefl

Maximum reflection coefficient magnitude value for contours.

Default value: automatic

?minRefl f_minRefl

Minimum reflection coefficient magnitude value for contours.

Default value: automatic

?numCont x_numCont

Total number of contours returned.

Default value: 8

?refImp f_refImp

Reference resistance used to calculate reflection coefficients.

Default value: 50

?closeCont g_closeCont

Boolean indicating when to close the contours. When nil, the largest segment of each contour is left open.

Default value: nil

Value Returned

o_waveform

Returns a family of waveforms (contours) for Z-Smith plotting.

nil

Returns nil and an error message otherwise.

Example

The following example plots constant output reflection coefficient contours according to output reflection coefficients:

cReflContour(i("/I8/out" ?result "pss_fd") v("/net28"
?result "pss_fd") 1)

The following example plots constant output reflection coefficient contours according to output reflection coefficients:

cReflContour(i("/I8/out" ?result "pss_fd") v("/net28"
?result "pss_fd") 1 ?maxRefl 0.7 ?minRefl 0.1 ?numCont 7)

The following example plots constant output reflection coefficient contours according to output reflection coefficients:

cReflContour(i("/C25/PLUS" ?result "pss_fd")
v("/net30" ?result "pss_fd") 1
?iwaveLoad i("/I8/out" ?result "pss_fd")
?vwaveLoad v("/net28" ?result "pss_fd") ?refImp 50.0
?numCont 9)

cross

cross( 
o_waveform 
n_crossVal
x_n 
s_crossType 
[ g_multiple [ s_Xname ] ]
) 
=> o_waveform / g_value / nil

Description

Computes the X-axis value at which a particular crossing of the specified edge type of the threshold value occurs.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_crossVal

Y-axis value at which the corresponding values of X are calculated.

x_n

Number that specifies which X value to return. If x_n equals 1, the first X value with a crossing is returned. If x_n equals 2, the second X value with a crossing is returned, and so on. If you specify a negative integer for x_n, the X values with crossings are counted from right to left (from maximum to minimum). If you specify x_n equals to 0, it returns all occurrences of the crossing events.

s_crossType

Type of the crossing.

Valid values: ’rising, ’falling, ’either.

g_multiple

An optional boolean argument that takes the value nil by default. If set to t, the value specified for the x_n argument is ignored and the function returns all occurrences of the crossing event.

s_xName

An optional argument that is used only when g_multiple is set to t. It takes the value time by default. It controls the contents of the x vector of the waveform object returned by the function.

Valid values: ’time, ’cycle

Value Returned

o_waveform

Returns a waveform if the input argument is a family of waveforms.

g_value

Returns the X-axis value of the crossing point if the input argument is a single waveform.

nil

Returns nil and an error message otherwise.

Example

cross( v( "/net9" ) 2.5 2 ’rising )

Gets the time value (X axis) corresponding to specified voltage "/net9"=2.5V (Y axis) for the second rising edge.

cross( v( "/net9" ) 1.2 1 ’either )

Gets the time value (X axis) corresponding to specified voltage "/net9"=1.2V (Y axis) for the first edge, which can be a rising or falling edge.

cross(VT("/out") 2.5 0 0 t "time") (s)

Returns multiple occurrences of crossing events specified against time-points at which each crossing event occurs.

cross(VT("/out") 2.5 0 0 t "cycle") (s)

Returns multiple occurrences of crossing events specified against cycle numbers, where a cycle number refers to the n’th occurrence of the crossing event in the input waveform.

db10

db10(
{ o_waveform | n_number }
) 
=> o_waveform / n_number / nil

Description

Returns 10 times the log10 of the specified waveform object or number. This function can also be written as dB10.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform object if the input argument is a waveform object or returns a family of waveforms if the input argument is a family of waveforms.

n_number

Returns a number if the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

db10( ymax( v( "/net9" ) ) )

Returns a waveform representing log10(ymax(v("/net9")) multiplied by 10.

db10( 1000 ) 
=> 30.0

Gets the value log10(1000) multiplied by 10, or 30.

db20

db20(
{o_waveform | n_number} 
) 
=> o_waveform / n_number / nil

Description

Returns 20 times the log10 of the specified waveform object or number. This function can also be written as dB20.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform object if the input argument is a waveform object or returns a family of waveforms if the input argument is a family of waveforms.

n_number

Returns a number if the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

db20( ymax( v( "/net9" ) ) )

Returns a waveform representing 20 times log10(ymax(v("/net9")).

db20( 1000 ) 
=> 60.0

Returns the value of 20 times log10( 1000 ), or 60.

dbm

dbm(
{ o_waveform | n_number }
) 
=> o_waveform n_number / nil

Description

Returns 10 times the log10 of the specified waveform object plus 30. This function can also be written as dBm.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform object if the input argument is a waveform object or returns a family of waveforms if the input argument is a family of waveforms.

n_number

Returns a number if the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

dbm( ymax( v( "/net9" ) ) )

Returns a waveform representing 10 times log10(ymax(v("/net9")) plus 30.

delay

delay( 
[ ?wf1 o_waveform1 ]
[ ?value1 n_value1 ]
[ ?edge1 s_edge1 ]
[ ?nth1 x_nth1 ]
[ ?td1 n_td1 ]
[ ?wf2 o_waveform2 ]
[ ?value2 n_value2 ] 
[ ?edge2 s_edge2 ] 
[ ?nth2 x_nth2 
[ ?td2 n_td2 ] 
[ ?td2r0 n_td2r0 ]}
[ ?stop n_stop ]
[ ?histoDisplay g_histoDisplay ]
[ ?noOfHistoBins x_noOfHistoBins ]
[ ?period1 period1 ]
[ ?period2 period2 ]
[ ?multiple multiple ]
[ ?xName xName ]
@rest args 
) 
=> o_waveform / n_value / nil

Description

Calculates the delay between a trigger event and a target event.

The delay command computes the delay between two points using the cross command.

Arguments

?wf1 o_waveform1

First waveform object.

?value1 n_value1

Value at which the crossing is significant for the first waveform object.

?edge1 s_edge1

Type of the edge that must cross n_value1.Valid values: rising, falling, either

Default Value: either

?nth1 x_nth1

Number that specifies which crossing is to be the trigger event. For example, if x_nth1 is 2, the trigger event is the second edge of the first waveform with the specified type that crosses n_value1.

Default Value: 1

?td1 n_td1

Time at which to start the delay measurement. The simulator begins looking for the trigger event, as defined by o_waveform1, n_value1, t_edge1, and x_nth1, only after the n_td1 time is reached.

Default Value: 0

?wf2 o_waveform2

Second waveform object.

?value2 n_value2

Value at which the crossing is significant for the second waveform.

?edge2 s_edge2

Type of the edge for the second waveform.

Valid values: rising, falling, either

Default Value: either

?nth2 x_nth2

Number that specifies which crossing is to be the target event. For example, if x_nth2 is 2, the target event is the second edge of the second waveform with the specified type that crosses n_value2.

Default Value: 1

?td2 n_td2

Time to start observing the target event. n_td2 is specified relative to the trigger event. This parameter cannot be specified at the same time as n_td2r0.

The simulator begins looking for the target event, as defined by o_waveform2, n_value2, t_edge2, and x_nth2, only after the n_td2 time is reached

If you specify neither n_td2 nor n_td2r0, the simulator begins looking for the target event at t = 0.

Note: For non- multiple, If td2 is specified,  find the cross point of wf1 at edge nth. Use this as  trigger point for target(wf2) and ignore wf2 before wf1 trigger event to find its cross point. Calculate the delay between two cross points. If td2 is not specified, find the cross point at edge nth1 of wf1 and cross point of edge nth2 of wf2 with target at time at t=0 and calculate the delay between two cross points.

?td2r0 n_td2r0

Time to start observing the target event, relative to t = 0. Only applicable if both o_waveform1 and o_waveform2 are specified. This parameter cannot be specified at the same time with n_td2.....The simulator begins looking for the target event, as defined by o_waveform2, n_value2, t_edge2, and x_nth2, only after the n_tdr0 time is reached.

f you specify neither n_td2 nor n_td2r0, the simulator begins looking for the target event at t = 0.

?td2 and ?td2r0 take precedence over other options.

?stop n_stop

Time to stop observing the target event.

?histoDisplay g_histoDisplay

When set to t, returns a waveform that represents the statistical distribution of the riseTime data in the form of a histogram. The height of the bars (bins) in the histogram represents the frequency of the occurrence of values within the range of riseTime data.

Valid values: t nil

Default value: nil

?noOfHistoBins x_noOfHistoBins

Denotes the number of bins represented in the histogram representation.

Valid values: Any positive integer

Default value: 1

?period1 period1

Periodic interval for the first waveform.

?period2 period2

Periodic interval for the second waveform.

?multiple multiple

Finds all the cross points of wf1. If td2 is specified, finds cross points of target(wf2) staring at trigger event(first cross point of wf1) and ignore wf2 before wf1 trigger event. If td2 is not specified, finds cross points of target(wf2) at time at t=0. Calculate the delay between each of the cross points falling at interval of period1 and period2 of wf1 and wf2 respectively.

?xName xName

Specifies whether you want to retrieve delay data against trigger time, target time (or another X-axis parameter for non-transient data) or cycle. Cycle numbers refer to the n’th occurrence of the delay event in the input waveform.
The value in this field is ignored when you specify Number of Occurences as single.

@Rest args

Variable list of arguments passed to the delay function (as created from the Calculator UI). These variables also include support for multiple occurrences of the delay event.

g_histoDisplay and x_noOfHistoBins are added for backward compatibility only. It will be deprecated in future releases. Use the histo function for plotting the histogram of the resulting function.

Value Returned

o_waveform

Returns a waveform representing the delay if the input argument is a family of waveforms.

n_value

Returns the delay value if the input argument is a single waveform.

nil

Returns nil and an error message otherwise.

Example

delay(?wf1 v("16" ?result "tran"), ?value1 2.5, ?edge1 "rising", ?nth1 1, ?td1 0.0, ?wf2 v("1" ?result "tran"), ?value2 2.5, ?edge2 "rising", ?nth2 1,  ?td2 nil , ?stop nil,  ?period1 1 ?period2 1 ?multiple t ?xName "trigger" )

Calculates the delay between two waveforms wf1 and wf2 with the argument values specified as above.

delay( ?wf1 wf1 ?value1 2.5 ?nth1 2 ?edge1 ’either ?wf2 wf2 ?value2 2.5 ?nth2 1 ?edge2 ’falling )

Calculates the delay starting from the time when the second edge of the first waveform reaches the value of 2.5 to the time when the first falling edge of the second waveform crosses 2.5.

delay( ?td1 5 ?wf2 wf2 ?value2 2.5 ?nth2 1 ?edge2 ’rising ?td2 5)

Calculates the delay starting when the time equals 5 seconds and stopping when the value of the second waveform reaches 2.5 on the first rising edge 5 seconds after the trigger.

delay( ?wf1 wf1 ?value1 2.5 ?nth1 1 ?edge1 ’rising ?td1 5 ?wf2 wf2 ?value2 2.5 ?nth2 1 ?edge2 ’rising ?td2 0)

Waits until after the time equals 5 seconds, and calculates the delay between the first and the second rising edges of wf2 when the voltage values reach 2.5.

delay(VT(“/out”), 2.5, 1, ‘rising, VT(“/in”), 2.5, 1, ‘rising’, 1, 1, t)

Computes the delay between the rising edges of VT(“/out”) and VT(“/in”) when the waveforms cross their respective threshold values (that is, 2.5).

delay(VT("/out") 1.5 1 "rising" VT("/out") 1.5 2 "rising" 1 1 t "trigger") (s)

Returns multiple occurrences of delay specified against trigger time-points at which each delay event occurs.

delay(VT("/out") 1.5 1 "rising" VT("/out") 1.5 2 "rising" 1 1 t "target") (s)

Returns multiple occurrences of delay specified against target time-points at which each delay event occurs.

delay(VT("/out") 1.5 1 "rising" VT("/out") 1.5 2 "rising" 1 1 t "cycle") (s)

Returns multiple occurrences of delay specified against cycle numbers, where a cycle number refers to the n’th occurrence of the delay event in the input waveform.

delayMeasure

delayMeasure( 
o_waveform1
o_waveform2
[ ?edge1 s_edge1 ]
[ ?nth1 x_nth1 ]
[ ?value1 n_value1 ]
[ ?edge2 s_edge2 ] 
[ ?nth2 x_nth2 
[ ?value2 n_value2 ] 
=> n_value / nil

Description

Calculates the delay between a trigger event and a target event.

Arguments

?wf1 o_waveform1

First waveform object.

?wf2 o_waveform2

Second waveform object.

?edge1 s_edge1

Type of the edge that must cross n_value1.Valid values: rising, falling, either

Default Value: either

?nth1 x_nth1

Number that specifies which crossing is to be the trigger event. For example, if x_nth1 is 2, the trigger event is the second edge of the first waveform with the specified type that crosses n_value1.

Default Value: 1

?value1 n_value1

Threshold value at which the crossing is significant for the first waveform object. If this value is nil or blank, threshold is calculated internally using average(wave1)

?edge2 s_edge2

Type of the edge for the second waveform.

Valid values: rising, falling, either

Default Value: either

?value2 n_value2

Threshold value at which the crossing is significant for the second waveform. If this value is nil or blank, threshold is calculated internally using average(wave2).

?nth2 x_nth2

Number that specifies which crossing is to be the target event. For example, if x_nth2 is 2, the target event is the second edge of the second waveform with the specified type that crosses n_value2.

Default Value: 1

Example

delayMeasure(wave1 wave2)

Calculates the delay between the two waveforms, wave1 and wave2.

delayMeasure( wave1 wave2 ?value1 2.5 ?nth1 2 ?edge1 ’either ?wf2 wf2 ?value2 2.5 ?nth2 1 ?edge2 ’falling )

Calculates the delay starting from the time when the second edge of the first waveform reaches the value of 2.5 to the time when the first falling edge of the second waveform crosses 2.5.

deriv

deriv( 
o_waveform 
) 
=> o_waveform / nil

Description

Computes the derivative of a waveform with respect to the X axis.

Note the following:

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform object representing the derivative with respect to the X axis of the input waveform. Returns a family of waveforms if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

plot( deriv( VT( "/net8" ) ) )

Plots the waveform representing the derivative of the voltage of "/net8".

plot( deriv( mag(VF( "/OUT" ) ) ) )

Plots the waveform representing the derivative of the frequency of "/OUT".

dft

dft(
o_waveform 
n_from 
n_to 
x_num 
[ t_windowName ] 
[ n_param1 ] 
[ coherentGain ]
[ n_adcSpan ]
) 
=> o_waveform / nil

Description

Computes the discrete Fourier transform and fast Fourier transform of the input waveform.

The waveform is sampled at the following n timepoints: from, from + deltaT, from + 2 * deltaT,…, from + (N - 1) * deltaT The output of dft is a frequency waveform, W(f), which has (N/2 + 1) complex values—the DC term, the fundamental, and (N/2 - 1) harmonics.

The last time point, (from + (N - 1) * deltaT), is (to - deltaT) rather than to. The dft command assumes that w(from) equals w(to).

The DFT function assumes that w(from) equals to w(to). A warning message appears when w(from) is not equal to w(to) in the following situation:

window function is Rectangular or not specified, and

|w(from)-w(to)|>1e-3*range(w),

where, range(w) is max(w)- min(w) in [from,to]

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_from

Starting value for the dft computation.

n_to

Ending value for the dft computation.

x_num

Number of timepoints.

t_windowName

Variable representing different methods for taking a dft computation.

Valid values: Rectangular, ExtCosBell, HalfCycleSine, Hanning or Cosine2, Triangle or Triangular, Half3CycleSine or HalfCycleSine3, Hamming, Cosine4, Parzen, Half6CycleSine or HalfCycleSine6, Blackman, Kaiser, or Nuttall.

For more information about windowName, see the information about Discrete Fourier Transform (dft) in the Virtuoso Analog Design Environment L User Guide.

n_param1

Smoothing parameter.

Applies only if the t_windowName argument is set to Kaiser.

n_coherentGain

When you apply the function dft, the applied window type (besides the rectangular type) changes the signal’s amplitude. Applying a coherent gain factor is a way to get consistent results regardless of the window type.

The default value is 1.

n_adcSpan

Specifies the peak saturation level of the FFT waveform. When specified the magnitude of the input waveform is divided by adc span value before computing FFT. This is full-scale span ignoring any DC offsets.

Valid values : Any floating point number

Default Value : 1.0

Value Returned

o_waveform

Returns a waveform representing the magnitude of the various harmonics for the specified range of frequencies. Returns a family of waveforms if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Examples

The following example creates the waveform object waveDFT, representing the discrete Fourier transform, fast Fourier transform, of the waveform representing the voltage of the net "in". The computation is done from 0n to 20n with 64 timepoints.

openResults("./simulation/vdr_demo/inverter_chain/maestro/results/maestro/Interactive.1/psf/vdr_demo:inverter_chain_test:1/psf")
;Opens the simulation results stored in the specified results directory.
results()
; Lists the available results in the currently selected results directory.
selectResults('tran)
; Selects the result tran
outputs()
; Lists the outputs available in the selected result.
v=v("in")
;Creates a waveform object v, which represents the voltage waveform of the net 'in'. This is the input waveform to which the function 'dft' will be applied.
waveDFT=dft(v 0 20 64 "HalfCycleSine" 1 2 2.0)
; Creates the waveform object waveDFT, representing the discrete Fourier transform, fast Fourier transform, of the waveform representing the voltage of the net "in". The computation is done from 0n to 20n with 64 timepoints.
window=awvCreatePlotWindow()
; Creates the waveform window.
awvPlotWaveform(
    window
    list(v waveDFT)
    ?expr list("inputWave" "outputWave")
    ?color list("y1" "y66")
    ?index list(1 2)
    ?lineType list("line" "line")
    )
; Plots the inputWaveform v and output waveform waveDFT in the specified waveform window.
=> "./simulation/vdr_demo/inverter_chain/maestro/results/maestro/Interactive.1/psf/vdr_demo:inverter_chain_test:1/psf"
=> 
tran(tranOp model instance output designParamVals
    primitives subckts variables
)
=> stdobj@0x37375c80
=> 
("/net7" "/net5" "/net6" "/out" "/in"
   )
=> srrWave:0x3cd2d180
=> srrWave:0x3cd2d190
=> window:5
=> t

dftbb

dftbb( 
o_waveform1 
o_waveform2 
f_timeStart 
f_timeEnd 
x_num 
[ ?windowName t_windowName ]
[ ?smooth x_smooth ]
[ ?cohGain f_cohGain ]
[ ?spectrumType s_spectrumType ]
) 
=> o_waveformComplex / nil

Description

Computes the discrete Fourier transform (fast Fourier transform) of a complex signal.

Arguments

o_waveform1

Time domain waveform object with units of volts or amps.

o_waveform2

Time domain waveform object with units of volts or amps.

f_timeStart

Start time for the spectral analysis interval. Use this parameter and f_timeEnd to exclude part of the interval. For example, you might set these values to discard initial transient data.

f_timeEnd

End time for the spectral analysis interval.

x_num

The number of time domain points to use. The maximum frequency in the Fourier analysis is directly proportionate to x_num and inversely proportional to the difference between f_timeStart and f_timeEnd.

?windowName t_windowName

The window to be used for applying the moving window FFT.

Valid values: Rectangular, ExtCosBell, HalfCycleSine, Hanning, Cosine2, Triangle or Triangular, Half3CycleSine or HalfCycleSine3, Hamming, Cosine3, Cosine4, Parzen, Half6CycleSine or HalfCycleSine6, Blackman, Kaiser, or Nuttall.

Default value: Rectangular.

?smooth x_smooth

The Kaiser window smoothing parameter. If there are no requests, there is no smoothing.

Valid values: 0 <= x_smooth <= 15

Default value: 1

?cohGain f_cohGain

A scaling parameter. A non-zero value scales the power spectral density by 1/(f_cohGain).

Valid values: 0 <= f_cohGain <= 1. You can use 1 if you do not want the scaling parameter to be used.

Default value: 1

?spectrumType t_spectrumType

A string that can be either singleSided or doubleSided. When this option is single-sided, the resultant waveform is only on one side of the y axis starting from 0 to N-1. When it is double-sided, it is symmetric to the Y axis from -N/2 to (N/2) -1.

Default value: SingleSided

Value Returned

o_waveformComplex

The discrete Fourier transform for baseband signals of the two waveforms returned when the command is successful.

nil

Returns nil and an error message otherwise.

Example

dftbb(VT("/net32") VT("/net11") , 0, 16m, 12000, ?windowName ’Hanning,?smooth 1, ?cohGain 1, ?spectrumType "SingleSided")

dnl

dnl( 
o_dacSignal
o_sample | o_pointList | n_interval 
[ ?mode t_mode ] 
[ ?threshold n_threshold ] 
[ ?crossType t_crossType ] 
[ ?delay f_delay ] 
[ ?method t_method ]
[ ?units x_units ] 
[ ?nbsamples n_nbsamples ] 
)
=> n_dnl / nil

Description

Computes the differential non-linearity of a transient simple or parametric waveform.

Arguments

o_dacSignal

Waveform for which the differential non-linearity is to be calculated.

o_sample

Waveform used to obtain the points for sampling the dacSignal. These are the points at which the waveform crosses the threshold while either rising or falling (defined by the crossType argument) with the delay added to them.

n_pointList

List of domain values at which the sample points are obtained from the dacSignal.

n_interval

The sampling interval.

?mode t_mode

The mode for calculating the threshold.

Valid values: auto and user.Default value: auto.

If set to user, an n_threshold value needs to be provided.

If set to auto, n_threshold is calculated internally.

?threshold n_threshold

The threshold value against which the differential non-linearity is to be calculated. It needs to be specified only when the mode is selected as user.

?crossType t_crossType

The points at which the curves of the waveform intersect with the threshold. While intersecting, the curve may be either rising or falling.

Valid values: rising and falling, respectively.

Default crossType is rising.

?delay f_delay

The delay time after which the sampling begins.

Valid values: Any valid time value.

Default value: 0.

?method t_method

The method to be used for calculation.

Valid values: end (end-to-end) and fit (straight line).

Default value: end.

?units x_units

Unit for expressing the output waveform.

Valid values: abs (absolute) and lsb (multiples of least significant bit).

Default value: abs.

?nbsamples n_nbsamples

Number of samples used for calculating the non-linearity. If not specified, the samples are taken against the entire data window.

For each of the three ways in which the sample points can be specified, only a few of the other optional arguments are meaningful, as indicated below:

Value Returned

n_dnl

Returns the differential waveform.

nil

Returns nil and an error message otherwise.

Example

dnl( wave1 wave2 ?crossType "rising" ?delay 0.4 )
=> srrWave:175051544

Returns the differential non-linearity for wave1 by taking the points at which wave2 crosses the internally calculated threshold while rising as the sample points and adding a delay of 0.4 to them.

dutyCycle

dutyCycle( 
o_waveform 
[ ?threshold n_threshold ] 
[ ?xName t_xName ] 
[ ?outputType t_outputType ] 
[ ?mode mode ]
) 
=> o_waveform / f_average / nil

Description

Computes the duty cycle for a given waveform as a function of time or cycle.

Duty cycle is the ratio of the time for which the signal remains ‘high’ and the time period of the signal.

Arguments

o_waveform

Waveform, expression, or a family of waveforms.

?threshold n_threshold

The threshold value. It needs to be specified only when the mode is selected as user.

?xName t_xName

The X-axis of the output waveform.

Valid values: time and cycle.

Default value: time.

?outputType t_outputType

Type of output.Valid values: average and plot.

If set to average, the output is an average value.If set to plot, the output is a waveform.

In both the cases, the output is expressed in terms of a percentage.

Default value: plot.

?mode t_mode

The mode used to calculate the threshold value.

Valid values: auto and user.

Default value: auto.

If you want to specify the threshold value, set the variable to user. If you want Virtuoso Visualization and Analysis XL to calculate the threshold value, set the variable to auto.

The Auto Threshold Value is calculated as the average which is integral of the waveform divided by the X range.

Value Returned

o_waveform

Returns a waveform that represents duty cycle as a function of time.

f_average

Returns the average duty cycle value as a percentage.

nil

Returns nil if the duty cycle cannot be calculated.

Example

dutyCycle( wave1 )
=> srrWave:175051552

Returns the duty cycle as a function of time for the wave wave1.

dutyCycle( wave1 ?outputType "average" )
=> 52.1066

Returns the average (in percentage) of the duty cycle values for the wave wave1.

evmQAM

evmQAM( 
o_waveformI 
o_waveformQ 
n_tDelay 
n_samplingT 
x_levels 
g_normalize 
[ ?percent d_percent ]
) 
=> o_waveform / nil

Description

Processes the I and Q waveform outputs from the transient simulation run to calculate the Error Vector Magnitude (EVM) for multi-mode modulations. The function plots the I versus Q scatterplot. EVM is a useful measurement to describe the overall signal amplitude and phase modulated signal quality. It is based on a statistical error distribution normalized from an ideal digital modulation. Quadrature Amplitude Modulation (QAM) is a typical modulation scheme where EVM is useful. The EVM is calculated by detecting the I and Q signal levels corresponding to the four possible I and Q symbol combinations and calculating the difference between the actual signal level and the ideal signal level.

This function is not supported for families of waveforms.

Arguments

o_waveformI

The waveform for the I signal.

o_waveformQ

The waveform for the Q signal.

n_tDelay

The start time (a numerical value) for the first valid symbol. This can be obtained from the Waveform Viewer window by recording the time of the first minimum or first maximum (whichever is earlier) on the selected signal stream.

n_samplingT

A sampling time (a numerical value) for the symbol. Each period is represented by a data rate. The data rate at the output is determined by the particular modulation scheme being used.

x_levels

The modulation levels.

Valid values: 4, 16, 64, 256

Default value: 4

g_normalize

An option to see the scatter plot normalized to the ideal values +1 and -1 (for example, when superimposing scatter plots from different stages in the signal flow, where the levels may be quite different but you want to see relative degradation or improvement in the scatter). This option does not affect the calculation of the EVM number.

Valid values: nil, t

Default value: t

?percent d_percent

Value Returned

o_waveform

Returns a waveform object representing the EVM value computed from the input waveforms.

nil

Returns nil and an error message if the function is unsuccessful.

Example

evmQAM( v("samp_out_Q"), v("samp_out_I") 1.5u, 181.81n, 4, t ) 

Calculates the EVM value for the modulation level 4 in normalized form.

evmQpsk

evmQpsk( 
o_waveform1 
o_waveform2 
n_tDelay 
n_sampling 
g_autoLevelDetect 
n_voltage 
n_offset 
g_normalize 
[ ?percent d_percent ]
)
=> o_waveform / nil

Description

Processes the I and Q waveform outputs from the transient simulation run to calculate the Error Vector Magnitude (EVM) and plot the I versus Q scatterplot. EVM is a useful measurement to describe the overall signal amplitude and phase modulated signal quality. It is based on a statistical error distribution normalized from an ideal digital modulation. Quadrature Phase Shift Keying (QPSK) is a typical modulation scheme where EVM is useful. The EVM is calculated by detecting the I and Q signal levels corresponding to the four possible I and Q symbol combinations and calculating the difference between the actual signal level and the ideal signal level.

This function is not supported for families of waveforms.

Arguments

o_waveform1

The waveform for the I signal.

o_waveform2

The waveform for the Q signal.

n_tDelay

The start time for the first valid symbol. This can be obtained from the Waveform Viewer window by recording the time of the first minimum or first maximum (whichever is earlier) on the selected signal stream.

n_sampling

A period for the symbol. Each period is represented by a data rate. The data rate at the output is determined by the particular modulation scheme being used.

g_autoLevelDetect

An option to indicate that you want the amplitude (n_voltage) and DC offset (n_offset) to be automatically calculated. Amplitude is calculated by averaging the rectified voltage level of the signal streams and DC offset by averaging the sum of an equal number of positive and negative symbols in each signal stream. These values are used to determine the EVM value. If this value is set to nil, you must specify values for n_voltage and n_offset.

Valid values: ‘nil, ‘t

Default value: ‘t

n_voltage

The amplitude of the signal.

n_offset

The DC offset value.

g_normalize

An option to see the scatter plot normalized to the ideal values +1 and -1 (for example, when superimposing scatter plots from different stages in the signal flow, where the levels may be quite different but the you want to see relative degradation or improvement in the scatter). This option does not affect the calculation of the EVM number.

Valid values: nil,t

Default value: nil

?percent d_percent

Value Returned

o_waveform

Returns a waveform object representing the EVM value computed from input waveforms.

nil

Returns nil and an error message if the function is unsuccessful.

Example

evmQpsk( v("samp_out_Q"), v("samp_out_I") 1.5u, 181.81n, t, nil, nil, nil) 

Calculates the EVM value when g_autoLevelDetect is set to t. In this case, no values are specified for n_voltage and n_offset.

evmQpsk( v("samp_out_Q"), v("samp_out_I") 1.5u, 181.81n, nil, 1.3, 0, nil) 

Calculates the EVM value when g_autoLevelDetect is set to nil. In this case, values are specified for n_voltage and n_offset.

eyeDiagram

eyeDiagram( 
o_waveform 
n_start 
n_stop 
n_period 
[ ?advOptions t_advOptions ]
[ ?intensityPlot g_intensityPlot ]
) 
=> o_waveform / nil

Description

Returns an eye-diagram plot of the input waveform signal. It returns the waveform object of the eye-diagram plot. Using an advanced option, the function also calculates the maximum vertical and horizontal opening of the eye formed when the input waveform is folded by the specified period to form the eye.

Arguments

o_waveform

Input waveform signal.

n_start

The X-axis start value from where the eye-diagram plot is to begin.

n_stop

The X-axis stop value where the eye-diagram plot is to terminate.

n_period

The period after which the waveform is to be folded to form the eye.

?advOptions t_advOptions

Specifies whether the vertical (Max Vertical Opening) or horizontal opening (Max Horizontal Opening) of the eye is to be calculated.

Valid values: vertical, horizontal

Default value: nil

?intensityPlot g_intensityPlot

Boolean used to specify whether to generate a high intensity eye diagram plot.

If t_advOptions is specified, the function approximates vertical eye height and horizontal eye width to assume the symmetry of the eye. The function returns the most optimum results for single-eye scenarios.

Value Returned

o_waveform

Returns a waveform object representing the eye-diagram plot of the input waveform

nil

Returns nil and an error message otherwise

Example

eyeDiagram( v("/out" ) 0n 500n 12.5n )

Returns a waveform that represents an eye-diagram plot.

eyeDiagram( v("/out" ) 0n 500n 12.5n ?advOptions “vertical” )

Calculates the maximum vertical opening of the eye that is formed when the input waveform is folded after 12.5n

eyeDiagram( v("/out" ) 0n 500n 12.5n ?advOptions “horizontal” )

Calculates the maximum horizontal opening of the eye that is formed when the input waveform is folded after 12.5n

eyeHeightAtXY

eyeHeightAtXY( 
o_eyeDiagram 
f_x
f_y
[ ?output t_output ]
)
=> f_eyeHeight / nil

Description

Calculates the eye height at the specified point (x,y) inside the eye diagram. Eye height is the difference of two intercepts made with the innermost traces of the eye in the y-axis direction.

The specified point (x,y) must lie within the open eye whose height you want to calculate.

For more information about how the eye height is calculated, see the eyeHeightAtXY calculator function.

Arguments

o_eyeDiagram

The eye diagram waveform that is used to calculate the eye height.

f_x

The x-axis value that is used to calculate the eye height.

f_y

The y-axis value that is used to calculate the eye height.

?output t_output

Specifies whether to calculate the total eye height or the eye height relative to the specified y-axis value. Possible values are:

  • total: (Default) Calculates the total eye height at the specified point inside the eye.
  • above: Calculates the eye height that is above the specified y-axis value.
  • below: Calculates the eye height that is below the specified y-axis value.

Values Returned

f_eyeHeight

Returns the eye height at the specified point (x,y) inside the eye diagram.

nil

Returns nil if there is an error.

Example

The following example returns the value of the total eye height at the point, x=70p and y=2.2.

eyeHeightAtXY(eyeDiagram(v("/example_1" ?result "tran") 560p 5.000n 140p ?triggerPeriod 7e-11 ?autoCenter t) 70p 2.2 ?output "total")
=> 1.494594

The following example returns the value of the total eye height at the point, x=40ns, y=500mV.

eyeHeightAtXY(eyeDiagram(v("jitter" ?result "tran-tran") 200n 1.4u 2*40n ?triggerPeriod 40n ?autoCenter t) 40n 0.5 ?output "total" )
=> 838.3E-3

The following example returns the value of the eye height that is above y=0.5V (500mV) at the point, x=40ns, y=500mV.

eyeHeightAtXY(eyeDiagram(v("jitter" ?result "tran-tran") 200n 1.4u 2*40n ?triggerPeriod 40n ?autoCenter t) 40n 0.5 ?output "above" )
=> 439.0E-3

The following example returns the value of the eye height that is below y=0.5V (500mV) at the point, x=40ns, y=500mV.

eyeHeightAtXY(eyeDiagram(v("jitter" ?result "tran-tran") 200n 1.4u 2*40n ?triggerPeriod 40n ?autoCenter t) 40n 0.5 ?output "below" )
=> 399.3E-3

eyeWidthAtXY

eyeWidthAtXY( 
o_eyeDiagram 
f_x
f_y
[ ?output t_output ]
)
=> f_eyeWidth / nil

Description

Calculates the eye width at the specified point (x,y) inside the eye diagram. Eye width is the difference of two intercepts made with the innermost traces of the eye in the x-axis direction.

The specified point (x,y) must lie within the open eye whose width you want to calculate.

For more information about how the eye width is calculated, see the eyeWidthAtXY calculator function.

Arguments

o_eyeDiagram

The eye diagram waveform that is used to calculate the eye width.

f_x

The x-axis value that is used to calculate the eye width.

f_y

The y-axis value that is used to calculate the eye width.

?output t_output

Specifies whether to calculate the total eye width or the eye width relative to the specified x-axis value. Possible values are:

  • total: (Default) Calculates the total eye width at the specified point inside the eye.
  • left: Calculates the eye width that is left to the specified x-axis value.
  • right: Calculates the eye width that is right to the specified x-axis value.

Values Returned

f_eyeWidth

Returns the eye width at the specified point (x,y) inside the eye diagram.

nil

Returns nil if there is an error.

Example

The following example returns the value of the total eye width at the point, x=70p and y=2.2.

eyeWidthAtXY(eyeDiagram(v("/example_1" ?result "tran") 560p 5.000n 140p ?triggerPeriod 7e-11 ?autoCenter t) 70p 2.2 ?output "total")
=> 2.388933e-11

The following example returns the value of the total eye width at the point, x=40ns, y=500mV.

eyeWidthAtXY(eyeDiagram(v("jitter" ?result "tran-tran") 200n 1.4u 2*40n ?triggerPeriod 40n ?autoCenter t) 40n 0.5 ?output "total" )
=> 36.65E-9

The following example returns the value of the eye width that is left to x=40ns at the point, x=40ns, y=500mV.

eyeWidthAtXY(eyeDiagram(v("jitter" ?result "tran-tran") 200n 1.4u 2*40n ?triggerPeriod 40n ?autoCenter t) 40n 0.5 ?output "left" )
=> 18.44E-9

The following example returns the value of the eye width that is right to x=40ns at the point, x=40ns, y=500mV.

eyeWidthAtXY(eyeDiagram(v("jitter" ?result "tran-tran") 200n 1.4u 2*40n ?triggerPeriod 40n ?autoCenter t) 40n 0.5 ?output "right" )
=> 18.21E-9

eyeAperture

eyeAperture( 
o_waveform 
f_vref
f_acHeight
f_dcHeight 
g_plotBox 
?optimize g_optimize 
) 
=> o_waveform / aperture_width / nil

Description

Returns the aperture of the input eye diagram signal.

Arguments

o_waveform

Input signal, which is a eye diagram waveform for which aperture is to be calculated.

f_vref

Reference voltage.

f_acHeight

AC height, which specifies the height of the left side of the aperture window.

f_dcHeight

DC height, which specifies the height of the right side of the aperture window.

g_plotBox

Specifies whether to display the aperture in the eye diagram or calculate the eye width.

Valid values: t or nil. When this argument is set to t, the eye aperture is displayed in the output plot. When set to nil, the eye aperture width is returned.

?optimize g_optimize

Specifies whether to calculate the reference voltage that can be used to achieve the maximum eye aperture width.

Valid values: t or nil.

Values Returned

o_waveform

Returns the output waveform with eye aperture plotted.

aperture_width

Returns the aperture width.

nil

Returns nil and an error message otherwise.

Example

eyeAperture(list(eyeDiagram(v("signal" ?result "tran") 0.1n 200.0n 2.5n) eyeDiagram(v("signal" ?result "tran") 0.3n 200.0n 2.5n) ) 0.75 0.6 0.5 t nil )

This example calculates the eye aperture on the two eye diagram signals, signal1 and signal2, with following values:

eyeMeasurement

eyeMeasurement(
o_waveform
[ ?sample n_sample ]
[ ?auto g_auto ]
[ ?horizThreshold n_horizThreshold ]
[ ?sample n_sample ]
[ ?xTypePercent0 g_xTypePercent0 ]
[ ?startx0 n_startx0 ] 
[ ?starty0 n_starty0 ]
[ ?yTypePercent0 g_yTypePercent0 ]
[ ?endx0 n_endx0 ]
[ ?endy0 n_endy0 ]
[ ?xTypePercent1 g_xTypePercent1 ]
[ ?startx1 n_startx1 ]
[ ?starty1 n_starty1 ]
[ ?yTypePercent1 g_yTypePercent1 ]
[ ?endx1 n_endx1 ]
[ ?endy1 n_endy1 ]
[ ?noOfBins n_noOfBins ]
[ ?measure t_measure ]
) 
=> o_waveform / nil

Description

Evaluates the measurements for the eye diagram plot.

Arguments

o_waveform

The eye diagram waveform.

?sample n_sample

The time interval after which the signals are divided in the eye diagram plot. If this field is left blank, the data within the level 1 and level 0 regions are used to analyze the amplitude variation of the signal. This means there is some sensitivity to the actual spacing between the data points in the signal, which is caused by the variable time steps in the simulator. If the points are clustered in the curve portion, the distribution can be skewed. To perform the analysis, the sampling interval you specify in this field is divided into even time points.

?auto g_auto

When this argument is set to true, then the following agument values are computed automatically:

horizThreshold, startx0, startx1, xTypePercent0, xTypePercent1, endx0, endx1, yTypePercent0, yTypePercent1, starty0, endy0, starty1, and endy1.

?horizThreshold n_horizThreshold

The Y-axis level (for example voltage) that represents the switching threshold of the signal, typically half the signal range. This is used to compute statistical information about the threshold.

?sample n_sample

The time interval after which the signals are divided in the eye diagram plot. If this field is left blank, the data within the level 1 and level 0 regions are used to analyze the amplitude variation of the signal. This means there is some sensitivity to the actual spacing between the data points in the signal, which is caused by the variable time steps in the simulator. If the points are clustered in the curve portion, the distribution can be skewed. To perform the analysis, the sampling interval you specify in this field is divided into even time points.

?xTypePercent0 g_xTypePercent0

Level0 X-range specified whether specified in "%". If the value is t, it signifies the "%" value and if the value is nil, it signifies the absolute value.
Default value is t.

?startx0 n_startx0

Level0 X-range start value. Default value is 40.

?starty0 n_starty0

Level0 Y-range start value. Default value is 0.

?yTypePercent0 g_yTypePercent0

Level0 Y-range specified whether specified in "%". If the value is t, it signifies the "%" value and if the value is nil, it signifies the absolute value.
Default value is t.

?endx0 n_endx0

Level0 X-range end value. Default value is 60.

?endy0 n_endy0

Level0 Y-range end value. Default value is 50.

?xTypePercent1 g_xTypePercent1

Level1 X-range specified whether specified in "%". If the value is t, it signifies the "%" value and if the value is nil, it signifies the absolute value.
Default value is t.

?startx1 n_startx1

Level1 X-range start value. Default value is 40.

?starty1 n_starty1

Level1 Y-range start value. Default value is 50.

?yTypePercent1 g_yTypePercent1

Level1 Y-range specified whether specified in "%". If the value is t, it signifies the "%" value and if the value is nil, it signifies the absolute value.
Default value is t.

?endx1 n_endx1

Level1 X-range end value. Default value is 60.

?endy1 n_endy1

Level1 Y-range end value. Default value is 100.

?noOfBins n_noOfBins

Number of signal bins to be displayed in the eye diagram plot. These signals bins are used to form the horizontal (threshold crossing times) and vertical (amplitude variation) histograms.

?measure t_measure

Computes one of the measurement values described below:

  • level0Mean (Level0 Mean)—Mean of the Y-values within the level0 region.
  • level0Stddev (Level0 Stddev)—Standard deviation of the Y-values within the level0 region.
  • level1Mean (Level1 Mean)—Mean of the Y-values within the level1 region.
  • level1Stddev (Level1 Stddev)—Standard deviation of the Y-values within the level1 region.
  • amplitude (Eye amplitude)—Mean to mean amplitude of the eye, computed as: Meanlevel1 - Meanlevel0.
  • height (Eye height)—Vertical opening of the eye, computed as: (Meanlevel1 - 3*level1) - (Meanlevel0 - 3*level0).
  • signalToNoise (Eye signalToNoise)—Signal to noise ratio of the eye, computed as: (Meanlevel1 - Meanlevel0) / (level1 + level0).
  • thresholdCrossingStddev (Threshold crossing stddev)—Threshold crossing standard deviation is computed only when there is a single transition region in the eye diagram because it is analyzed over the entire period.
  • thresholdCrossingAverage (Threshold crossing average)—This is computed over the entire period.
  • width (Eye width)—Represents the opening of the eye in the X direction. It is computed as: (Meantransition2 - 3*std(transition2)) - (Meantransition1 - 3*std(transition1)).

  • riseTime (Eye Rise Time)—Two thresholds taken at the 20% and 80% points between the level0 mean and level1 mean. At each of these two thresholds, a horizontal histogram is computed, which is an analysis of the crossing points of these two thresholds, and the resulting rise time is the difference in the mean crossing point at each of these two thresholds.
  • fallTime (Eye Fall Time)—Signal measured between the percent high and percent low of the difference between the initial and final value.
  • randJitterLeft—Random jitter calculated from the crossing histogram of the left crossing area
  • randJitterRight—Random jitter calculated from the crossing histogram of the right crossing area
  • determJitter—Average deterministic jitter of the crossing areas

Value Returned

o_waveform

Returns the computed scalar value or a waveform for the specific measure that was passed.

nil

Returns nil and an error message otherwise.

Example

The following function computes the threshold crossing average for the eye diagram for signal /net1 from 0.0 to 2e-08 with a period of 5e-10:

wave_eyeDiagram=eyeDiagram(vtime('tran "/net1") 0.0 2e-08 5e-10 ?intensityPlot t)
eyeMeasurement(wave_eyeDiagram ?horizThreshold 0 ?startx0 40 ?starty0 0 ?xTypePercent0 "t" ?endx0 60 ?endy0 50 ?yTypePercent0 "t" ?startx1 40 ?starty1 50 ?xTypePercent1 "t" ?endx1 60 ?endy1 100 ?yTypePercent1 "t" ?noOfBins 10 ?measure "thresholdCrossingAverage")

The following function is used to get the eye open width:

wave_eyeDiagram=eyeDiagram(vtime('tran "/net1") 0.0 2e-08 5e-10 ?intensityPlot t)
eyeMeasurement(wave_eyeDiagram ?horizThreshold 0  ?startx0 40 ?starty0 0 ?xTypePercent0 "t" ?endx0 60 ?endy0 50 ?yTypePercent0 "t" ?startx1 40 ?starty1 50 ?xTypePercent1 "t" ?endx1 60 ?endy1 100 ?yTypePercent1 "t" ?noOfBins 10 ?measure "width")

edgeTriggeredEyeDiagram

edgeTriggeredEyeDiagram(
o_waveform 
n_start 
n_stop 
o_triggerWave 
n_threshold 
s_edgeType 
n_triggerOffset 
[ ?intensityPlot g_intensityPlot ]
) 
=> o_waveform / nil

Desription

Returns a signal triggered at the beginning of the eye diagram instead of a fixed period.

Arguments

o_waveform

The eye diagram waveform.

n_start

The X-axis start value from where the eye diagram plot is to begin.

n_stop

The X-axis stop value where the eye diagram plot is to terminate.

o_triggerWave

The waveform that is used for triggering the eye diagram.

n_threshold

The Y-axis value of trigger wave at which the corresponding cross points of the trigger wave are calculated.

s_edgeType

Type of the crossing.

Valid values: rising, falling, either.

n_triggerOffset

The value by which the trigger wave should be l-shifted to align with the input waveform signal.

?intensityPlot g_intensityPlot

Controls the intensity based plotting of the eye diagram.

Value Returned

o_waveform

Returns the computed scalar value or a waveform for the specific measure that was passed.

nil

Returns nil and an error message otherwise.

Examples

In the following example VT("/out") is an input waveform for which eye diagram is to be determined from 0n to 10n. The period to wrap or fold the eye diagram is determined by the cross points of the trigger waveform VT("/clk") at the given threshold.

edgeTriggeredEyeDiagram(VT("/out") 0n 10n VT("/clk") 2.5 "either" 0n)

The above function returns a waveform with the relevant edge Trigger eye diagram attributes set so that when plotted the edge trigger eye diagram is displayed.

The following example shows that an offset of 1n signifies that VT("/clk") is be l-shifted by 1n, lshift(VT("/clk") 1n), before determining the cross points. Also. intensity-based plotting is turned on.

edgeTriggeredEyeDiagram(VT("/out") 0n 10n VT("/clk") 2.5 "rising" 1n ?intensityPlot t)

flip

flip( 
o_waveform 
) 
=> o_waveform / nil

Description

Returns a waveform with the X vector values negated.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform object representing the input waveform mirrored about its Y axis. Returns a family of waveforms if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

plot( flip( v("/net4") ) )

Plots the waveform for the voltage of "/net4" with the X vector values negated.

fourEval

fourEval( 
o_waveform 
n_from 
n_to 
n_by 
[ ?baseBand g_baseBand ]
) 
=> o_waveform / nil

Description

Evaluates the Fourier series represented by an expression.

This function is an inverse Fourier transformation and thus the inverse of the dft command. The fourEval function transforms the expression from the frequency domain to the time domain.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_from

Starting point on the X axis at which to start the evaluation.

n_to

Increment.

n_by

Ending point on the X axis.

?baseBand g_baseBand

Accepts boolean values t or nil. The default value is nil.

When set to t, the function evaluates the baseband version of the inverse of the dft function by converting the unsymmetrical spectrum to a symmetrical one.

Value Returned

o_waveform

Returns a waveform object representing the inverse Fourier transformation of the input waveform. Returns a family of waveforms if the input argument is a family of waveforms. Returns the baseband version of the inverse of the dft function if baseBand is set to t.

nil

Returns nil and an error message otherwise.

Example

plot( fourEval( v( "/net3" ) 1k 10k 10 )

Plots the waveform representing the inverse Fourier transformation of the voltage of "/net3" from 1k to 10k.

fallTime

fallTime(
o_waveform 
n_initVal 
g_initType 
n_finalVal
g_finalType 
n_theta1
n_theta2 
[ g_multiple [ s_Xname ][ g_histoDisplay ][ x_noOfHistoBins ] ] 
) 
=> o_waveform / n_value / nil

Description

Returns the fall time measured between theta1 (percent high) to theta2 (percent low) of the difference between the initial value and the final value.

The fallTime function can also be used to compute the rise time if initVal is lower than finalVal.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_initVal

Initial value at which to start the computation.

g_initType

Specifies how n_initVal functions.

Valid values: a non-nil value specifies that the initial value is taken to be the value of the waveform, interpolated at n_initVal, and the waveform is clipped from below as follows:

o_waveform = clip( o_waveform g_initVal nil )

where nil specifies that n_initVal is defined by the X value entered. (The command gets the Y value for the specified X value and uses that value for n_initVal.)

n_finalVal

Final value at which to end the computation.

g_finalType

Specifies how the n_finalVal argument functions.

Valid values: a non-nil value specifies that the final value is taken to be the value of the waveform, interpolated at n_finalVal, and the waveform is clipped from above, as follows:

o_waveform = clip(o_waveform nil n_finalVal)

where nil specifies that the n_finalVal argument is defined by the X value entered. (The command gets the Y value for the specified X value and uses that value for n_finalVal.)

n_theta1

Percent high.

n_theta2

Percent low.

g_multiple

An optional boolean argument that takes the value nil by default. If set to t, the function returns multiple occurrences of the fallTime event.

s_xName

An optional argument that is used only when g_multiple is set to t. It takes the value time by default. It controls the contents of the x vector of the waveform object returned by the function.

Valid values: ‘time, ‘cycle

g_histoDisplay

When set to t, returns a waveform that represents the statistical distribution of the fallTime data in the form of a histogram. The height of the bars (bins) in the histogram represents the frequency of the occurrence of values within the range of fallTime data.

Valid values: t nil

Default value: nil

x_noOfHistoBins

Denotes the number of bins represented in the histogram representation.Valid values: Any positive integerDefault value: nil

g_histoDisplay and x_noOfHistoBins are added for backward compatibility only. It will be deprecated in future releases. Use the histo function for plotting the histogram of the resulting function.

Value Returned

o_waveform

Returns a waveform representing the fall time for a family of waveforms if the input argument is a family of waveforms or if g_multiple is set to t.

n_value

Returns a value for the fall time if the input is a single waveform.

nil

Returns nil and an error message otherwise.

Example

fallTime( v( "/net8" ) 9 nil 1 nil 10 90 )

Computes the fall time for the waveform representing the voltage of "/net8" from 9 to 1.

freq

freq( 
o_waveform 
t_crossType 
[ ?threshold n_threshold ] 
[ ?mode t_mode ]
[ ?xName xName ]
[ ?histoDisplay g_histoDisplay ]
[ ?noOfHistoBins x_noOfHistoBins ] 
) 
=> o_outputWave / nil

Description

Computes the frequency of the input waveform(s) as a function of time or cycle.

Arguments

o_waveform

Waveform, expression, or a family of waveforms.

t_crossType

The points at which the curves of the waveform intersect with the threshold. While intersecting, the curve may be either rising or falling. For the freq function, you may specify the frequency to be calculated against either the rising points or the falling points by setting crossType to rising or falling, respectively. The default crossType is rising.

?threshold n_threshold

The threshold value against which the frequency is to be calculated. This needs to be specified only when the mode selected is user.

?mode t_mode

The mode for calculating the threshold. This is auto, by default, in which case n_threshold is calculated internally. It can alternatively be set to user, in which case, an n_threshold value needs to be provided. Default Value: auto

?xName t_xName

The X-axis of the output waveform. The default value is time but cycle is also a valid value.

Default Value: time

?histoDisplay g_histoDisplay

When set to t, returns a waveform that represents the statistical distribution of the riseTime data in the form of a histogram. The height of the bars (bins) in the histogram represents the frequency of the occurrence of values within the range of riseTime data.

Valid values: t nil

Default value: nil

?noOfHistoBins x_noOfHistoBins

Denotes the number of bins represented in the histogram representation.

Valid values: Any positive integer

Default value: 1

g_histoDisplay and x_noOfHistoBins are added for backward compatibility only. It will be deprecated in future releases. Use the histo function for plotting the histogram of the resulting function.

Value Returned

o_outputWave

Returns the frequency as a function of time or cycle.

nil

Returns nil if the frequency cannot be calculated.

Example

freq( wave1 “rising” ?mode “user” ?threshold 18.5 ?xName “cycle” )
=> srrWave: 170938688

Returns the frequency for wave1 with the threshold at 18.5 against cycle on the x-axis.

freq_jitter

freq_jitter( 
o_waveform 
t_crossType 
[ ?mode t_mode ] 
[ ?threshold n_threshold ]
[ ?binSize n_binSize ]
[ ?xName t_xName ]
[ ?outputType t_outputType ]
) 
=> o_waveform / f_val / nil

Description

Calculates the frequency jitter.

Arguments

o_waveform

Waveform, expression, or a family of waveforms.

t_crossType

The points at which the curves of the waveform intersect with the threshold. While intersecting, the curve may be either rising or falling.

Valid values: rising and falling.

Default value: rising

?mode t_mode

The mode for calculating the threshold.

Valid values: auto and user.

If set to user, an n_threshold value needs to be provided.

If set to auto, n_threshold is calculated internally.

Default value: auto

?threshold n_threshold

The threshold value against which the frequency is to be calculated. It needs to be specified only when the mode selected is user.

?binSize n_binSize

The width of the moving average window.The deviation of value at the particular point from the average of this window is the jitter.

Default value: 0

?xName t_xName

The X-axis of the output waveform.Valid values: time and cycle.Default value: time

?outputType t_outputType

Type of output.

Valid values: sd and plot.

If set to sd, the output is a standard deviation jitter.

If set to plot, the output is a waveform.

Default value: plot

Value Returned

o_waveform

Returns the frequency jitter values as a function of time or cycle when the outputType is set to plot.

f_val

Returns the standard deviation value when the outputType is set to sd.

nil

Returns nil otherwise.

Example

freq_jitter( wave1 “rising” ?mode “user” ?threshold 1 ?binSize 2 ?xName “cycle” ?outputType “sd” )
=> 0.1338585

Returns the standard deviation for the frequency jitter of wave1 with the threshold of 1 against the cycle on the x-axis.

frequency

frequency( 
o_waveform 
) 
=> o_waveform / n_value / nil

Description

Computes the reciprocal of the average time between two successive midpoint crossings of the rising waveform.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform representing the frequency of a family of waveforms if the input argument is a family of waveforms.

n_value

Returns a number representing the frequency of the specified waveform.

nil

Returns nil and an error message otherwise.

Example

frequency( v( "/net12" ) )

Returns the frequency of "/net12".

ga

ga(
o_s11 
o_s12
o_s21 
o_s22 
[ ?gs n_gs ] 
) 
=> o_waveform / nil

Description

Returns the available gain in terms of the supplied parameters and the optional source reflection coefficient (Gs).

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

n_gs

Source reflection coefficient.

Default value: 0

Value Returned

o_waveform

Waveform object representing the available gain.

nil

Returns nil and an error message otherwise.

Example

s11 = sp(1 1)
s12 = sp(1 2)
s21 = sp(2 1)
s22 = sp(2 2)
plot(ga(s11 s12 s21 s22))

gac

gac( 
o_s11 
o_s12 
o_s21 
o_s22
g_level
g_frequency 
) 
=> o_waveform / nil

Description

Computes the available gain circles.

The g data type on g_level and g_frequency allows either the level or the frequency to be swept while the other remains fixed.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

g_level

Level in dB. It can be specified as a scalar or a vector. If it is specified as a vector, the level is swept. The linRg function can be called to generate a linear range. For example, linRg( -30 30 5 ) is the same as list(-30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30) and the g_level argument can be specified as either of the above. In that case, an available gain circle is calculated at each one of the 13 levels.

g_frequency

Frequency, which can be specified as a scalar or a linear range. If it is specified as a linear range, the frequency is swept. The linear range is specified as a list with three values: the start of the range, the end of the range, and the increment. For example, list(100M 1G 100M) specifies a linear range with the following values:

{ 100M, 200M, 300M, 400M, 500M, 600M, 700M, 800M, 900M, 1G }

In that case, an available gain circle is calculated at each one of the 10 frequencies.

Value Returned

o_waveform

Waveform object representing the available gain circles.

nil

Returns nil and an error message otherwise.

Example

s11 = sp(1 1 ?result "sp")
s12 = sp(1 2 ?result "sp")
s21 = sp(2 1 ?result "sp")
s22 = sp(2 2 ?result "sp")
plot(gac(s11 s12 s21 s22 linRg(-30 30 5) 900M))

gainBwProd

gainBwProd( 
o_waveform 
) 
=> o_waveform / n_value / nil

Description

Calculates the gain-bandwidth product of a waveform representing the frequency response of interest over a sufficiently large frequency range.

Returns the product of the zero-frequency-gain and 3dB-gain-frequency.

.

The gain-bandwidth product is calculated as the product of the DC gain Ao and the critical frequency f2. The critical frequency f2 is the smallest frequency for which the gain equals times the DC gain Ao.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform representing the gain-bandwidth product for a family of waveforms if the input argument is a family of waveforms.

n_value

Returns a value for the gain-bandwidth product for the specified waveform.

nil

Returns nil and an error message otherwise.

Example

gainBwProd( v( "/OUT" ) ) 

Returns the gain-bandwidth product for the waveform representing the voltage of the "/OUT" net.

gainMargin

gainMargin(
o_waveform 
[ g_stable ]
) 
=> o_waveform / n_value / nil

Description

Computes the gain margin of the loop gain of an amplifier.

The first argument is a waveform representing the loop gain of interest over a sufficiently large frequency range. This command returns the dB value of the waveform when its phase crosses negative pi.

gainMargin( gain ) = 20 * log10( value( gain f0 ) )

The gain margin is calculated as the magnitude of the gain in dB at f0. The frequency f0 is the lowest frequency in which the phase of the gain provided is -180 degrees. For stability, the gain margin will be negative when g_stable is set to nil. If g_stable value is set to t, then a stable design will have a positive value.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

g_stable

Boolean optional value that takes the value nil by default.

Value Returned

o_waveform

Returns a waveform representing the gain margin for a family of waveforms if the input argument is a family of waveforms.

n_value

Returns the value for the gain margin of the specified waveform.

nil

Returns nil and an error message otherwise.

Example

gainMargin( v( "/OUT" ) ) = -9.234
gainMargin( v( "/OUT" ) nil ) = -9.234
gainMargin( v( "/OUT" ) t ) =  9.234

gmax

gmax( 
o_s11
o_s12 
o_s21 
o_s22 
) 
=> o_waveform / nil

Description

Returns the maximum power gain in terms of the supplied parameters.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

Value Returned

o_waveform

Load reflection coefficient.

nil

Returns nil and an error message otherwise.

Example

s11 = sp(1 1)
s12 = sp(1 2)
s21 = sp(2 1)
s22 = sp(2 2)
plot(gmax(s11 s12 s21 s22))

gmin

gmin( 
o_Gopt 
o_Bopt 
f_zref 
) 
=> o_gminWave / nil

Description

Returns the optimum noise reflection coefficient in terms of o_Gopt, o_Bopt, and f_zref.

gmin is returned as follows:

yOpt = o_Gopt + (complex 0 1) * o_Bopt
return ( 1 / f_zref(1) - yOpt ) / ( 1 / f_zref(1) + yOpt )

Arguments

o_Gopt

Waveform object representing the optimum source conductance.

o_Bopt

Waveform object representing the optimum source susceptance.

f_zref

Reference impedance.

Value Returned

o_gminWave

Waveform object representing the optimum noise reflection coefficient.

nil

Returns nil and an error message otherwise.

Example

Gopt = getData("Gopt")
Bopt = getData("Bopt")
Zref = zref(1 ?result "sp")
plot(gmin(Gopt Bopt Zref))

gmsg

gmsg( 
o_s11 
o_s12
o_s21 
o_s22 
) 
=> o_waveform / nil

Description

Returns the maximum stable power gain in terms of the supplied parameters.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

Value Returned

o_waveform

Waveform object representing the maximum stable power gain.

nil

Returns nil and an error message otherwise.

Example

s11 = sp(1 1)
s12 = sp(1 2)
s21 = sp(2 1)
s22 = sp(2 2)
plot(gmsg(s11 s12 s21 s22))

gmux

gmux( 
o_s11 
o_s12 
o_s21 
o_s22 
) 
=> o_waveform / nil

Description

Returns the maximum unilateral power gain in terms of the supplied parameters.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

Value Returned

o_waveform

Waveform object representing the maximum unilateral power gain.

nil

Returns nil and an error message otherwise.

Example

s11 = sp(1 1)
s12 = sp(1 2)
s21 = sp(2 1)
s22 = sp(2 2)
plot(gmux(s11 s12 s21 s22))

gp

gp(
o_s11 
o_s12
o_s21 
o_s22
[ ?gl n_gl ]
) 
=> o_waveform / nil

Description

Computes the power gain in terms of the S-parameters.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22

n_gl

Load reflection coefficient. Default value: 0

Value Returned

o_waveform

Waveform object representing the power gain.

nil

Returns nil and an error message otherwise.

Example

s11 = sp(1 1)
s12 = sp(1 2)
s21 = sp(2 1)
s22 = sp(2 2)
plot(gp(s11 s12 s21 s22))
gl is an imaginary number which should be input in the following format: gp( s11 s12 s21 s22 ?gl complex(<realPart> <imagPart>))

gpc

gpc( 
o_s11 
o_s12
o_s21
o_s22 
g_level 
g_frequency
) 
=> o_waveform / nil

Description

Computes the power gain circles.

The g datatype on g_level and g_frequency allows either the level or the frequency to be swept while the other remains fixed.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

g_level

Level in dB. It can be specified as a scalar or a vector. If it is specified as a vector, the level is swept. The linRg function can be called to generate a linear range. For example, linRg( -30 30 5 ) is the same as list(-30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30) and the g_level argument can be specified as either. In that case, a power gain circle is calculated at each one of the 13 levels.

g_frequency

The frequency. It can be specified as a scalar or a linear range. If it is specified as a linear range, the frequency is swept. The linear range is specified as a list with three values: the start of the range, the end of the range, and the increment. For example, list(100M 1G 100M) specifies a linear range with the following values:

{ 100M, 200M, 300M, 400M, 500M, 600M, 700M, 800M, 900M, 1G }

In that case, a power gain circle is calculated at each one of the 10 frequencies.

Value Returned

o_waveform

Waveform object representing the power gain circles.

nil

Returns nil and an error message otherwise.

groupDelay

groupDelay( 
o_waveform 
) 
=> o_waveform / nil

Description

Computes the group delay of a waveform.

This command returns the derivative of the phase of o_waveform / 2pi. Group delay is defined as the derivative of the phase with respect to frequency. Group delay is expressed in seconds.

It is calculated using the vp function as shown below:

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform representing the group delay of the specified waveform.

nil

Returns nil and an error message otherwise.

Example

plot( groupDelay( v( "/net3" ) ) )

Plots the waveform representing the group delay of the voltage of "/net3".

gt

gt( 
o_s11 
o_s12 
o_s21
o_s22 
[ ?gs n_gs ]
[ ?gl n_gl ]
) 
=> o_waveform / nil

Description

Returns the transducer gain in terms of the supplied parameters and the optional source reflection coefficient (Gs) and the input reflection coefficient (Gl).

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

n_gs

Source reflection coefficient. Default value: 0

n_gl

Input reflection coefficient. Default value: 0

Value Returned

o_waveform

Waveform object representing the transducer gain.

nil

Returns nil and displays a message if there is an error.

Example

s11 = sp(1 1)
s12 = sp(1 2)
s21 = sp(2 1)
s22 = sp(2 2)
plot(gt(s11 s12 s21 s22))
gl is an imaginary number which should be input in the following format: gt( s11 s12 s21 s22 ?gl complex(<realPart> <imagPart>))

harmonic

harmonic( 
o_waveform 
h_index
) 
=> o_waveform / g_value / nil

Description

Returns the waveform for a given harmonic index.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

h_index

The index number that designates the harmonic information to be returned. For the ’pss, ’pac, and ’pxf analyses, the index is an integer number. For the ’pdisto analysis, the index is a list of integers that correspond with the frequency names listed in the funds analysis parameter in the netlist. If more than one h_index is desired at one time, a list can be specified.

Value Returned

o_waveform

Returns a waveform (when a single h_index is specified) or family of waveforms (when more than one h_index is specified) if the input argument is a family of waveforms.

g_value

Returns the harmonic value if the input is a single waveform with the X values being harmonics

nil

Returns nil and displays a message if there is an error.

Example

For each of the following commands:

harmonic(v("/net49" ?result "pss-fd.pss") 1)
harmonic(v("/Pif" ?result "pdisto-fi.pdisto") list(1 -1))

Each result is a complex number.

For each of the following commands:

harmonic(v("/net54" ?result "pac-pac") 1)
harmonic(v("/net51" ?result "sweeppss_pss_fd-sweep") list(8))
harmonic(v("/Pif" ?result "sweeppss_pac-sweep") -8) 
harmonic(v("/net36" ?result "sweeppdisto_pdisto_fi-sweep") ’(1 -1))

Each result is a waveform.

For each of the following commands:

harmonic(v("/net54" ?result "pac-pac") list(1 5))
harmonic(v("/net51" ?result "sweeppss_pss_fd-sweep") ’(1 8))
harmonic(v("/Pif" ?result "sweeppss_pac-sweep") list(-8 0))
harmonic(v("/net36" ?result "sweeppdisto_pdisto_fi-sweep") ’((1 -1) (2 -2) (-1 2)))

Each result is a family of waveforms.

Neither of the following commands should be entered:

harmonic(v("/net49" ?result "pss-fd.pss") list(0 1))
harmonic(v("/Pif" ?result "pdisto-fi.pdisto") ’((1 -1) (-1 2)))

Each resulting waveform is not in a useful format.

harmonicFreqList

harmonicFreqList( 
[ ?resultsDir t_resultsDir ] 
[ ?result S_resultName ]
) 
=> n_list / nil

Description

Returns a list of lists, with each sublist containing a harmonic index and the minimum and maximum frequency values that the particular harmonic ranges between.

If both of these frequency values are the same, just one frequency value is returned.

Arguments

t_resultsDir

Directory containing the PSF files (results). If you supply this argument, you must also supply the resultName argument.

S_resultName

Results from an analysis.

Value Returned

n_list

Returns a list of lists. For the ’pss, ’pac, and ’pxf analyses, the first element of each sublist is an integer number. For the ’pdisto analysis, the first element of each sublist is a list of integers that correspond with the frequency names listed in the funds analysis parameter in the netlist. For all sublists, the remaining entries are the minimum and maximum frequency values that the particular harmonic ranges between. If both of these frequency values are the same, just one frequency value is returned.

nil

Returns nil if no harmonics are found in the data.

Example

For each of the following commands:

harmonicFreqList( ?result "pss-fd.pss" )
harmonicFreqList( ?result "pac-pac" )
harmonicFreqList( ?result "sweeppss_pss_fd-sweep" )
harmonicFreqList( ?result "sweeppss_pac-sweep" ) 

Each result is a list of integers.

For each of the following commands:

harmonicFreqList( ?result "pdisto-fi.pdisto" )
harmonicFreqList( ?result "sweeppdisto_pdisto_fi-sweep" )

Each result is a list of lists, with each sublist containing a combination of integer numbers that correspond with the frequency names listed in the funds analysis parameter in the netlist. These names can also be extracted from the PSF data by using the resultParam function to find the ’largefundname and ’moderatefundnames values. For example:

strcat(resultParam( ’largefundname ?result "pdisto-fi.pdisto" ) " "
resultParam( ’moderatefundnames ?result "pdisto-fi.pdisto" ))

Returns a string representing the order of the frequency names.

harmonicList

harmonicList(
[ ?resultsDir t_resultsDir ] 
[ ?result S_resultName ] 
)
=> n_list

Description

Returns the list of harmonic indices available in the resultName or current result data.

Arguments

t_resultsDir

Directory containing the PSF files (results). If you supply this argument, you must also supply the resultName argument.

S_resultName

Results from an analysis.

Value Returned

n_list

Returns a list of harmonic indices. For the ’pss, ’pac, and ’pxf analyses, the index is an integer number. For the ’pdisto analysis, the index is a list of integers that correspond with the frequency names listed in the ’funds analysis parameter in the netlist.

nil

Returns nil if no harmonics are found in the data.

Example

For each of the following commands:

harmonicList( ?result "pss-fd.pss" )
harmonicList( ?result "pac-pac" )
harmonicList( ?result "sweeppss_pss_fd-sweep" )
harmonicList( ?result "sweeppss_pac-sweep" ) 

Each result is a list of integers.

For each of the following commands:

harmonicList( ?result "pdisto-fi.pdisto" )
harmonicList( ?result "sweeppdisto_pdisto_fi-sweep" )

Each result is a list of lists, with each sublist containing a combination of integer numbers that correspond with the frequency names listed in the ’funds analysis parameter in the netlist. These names can also be extracted from the PSF data by using the ’resultParam function to find the ’largefundname and ’moderatefundnames values. For example:

strcat(resultParam( ’largefundname ?result "pdisto-fi.pdisto" ) " "
resultParam( ’moderatefundnames ?result "pdisto-fi.pdisto" ))

Returns a string representing the order of the frequency names.

histo

histo( 
o_waveform 
x_bins 
n_min 
n_max 
)
=> o_histoWaveform / nil

Description

Returns a waveform that represents the statistical distribution of input data in the form of a histogram. The height of the bars (or bins) in the histogram represents the frequency of the occurrence of values within a specific period. Using the histo function, the range for capturing these frequencies can be specified through the n_min and n_max values.

Arguments

o_waveform

Input waveform.

x_bins

Number of bins to represent the input data.

n_min

The first value on the horizontal axis of the histogram. By default, it assumes the minimum value of the input waveform.

n_max

The last value on the horizontal axis of the histogram. By default, it assumes the maximum value of the input waveform.

Value Returned

o_histoWaveform

Returns a waveform representing the statistical distribution of the input waveform o_waveform.

nil

Returns nil in case of an error.

Example

histo( VT("/vin") 3 1.5 3.5)
=> out_wave
plot( out_wave )

Plots the output waveform out_wave as a histogram, which represents the statistical distribution of the input waveform VT("/vin").

histogram2D

histogram2D(
o_waveform 
x_nbins 
[ t_type ]
[ g_setAnnotation ]
[ g_setDensityEstimator ]
)
=> o_waveform / nil

Description

Returns a waveform that represents the statistical distribution of input data in the form of a histogram. The height of the bars (or bins) in the histogram represents the frequency of the occurrence of values within a specific period.

Arguments

o_waveform

Input waveform.

x_nbins

Number of bins (bars) to be plotted in the resulting histogram plot.

Valid values: 1 to 50.

Default value:10.

t_type

Type of histogram to be plotted.

Valid values: standard, cumulative line, and cumulative box.

Default value: standard.

g_setAnnotation

Boolean specifying whether to display the standard deviation lines in the resulting histogram plot.

Valid values: t or nil

Default value: nil

g_setDensityEstimator

Boolean specifying whether the resulting histogram plot display a curve that estimates the distribution concentration.

Valid values: t or nil

Default value: nil

Value Returned

o_waveform

Returns a waveform representing the statistical distribution of the input waveform o_waveform.

nil

Returns nil in case of an error.

Examples

histogram2D(i("/V2/PLUS" ?result "tran") 10 "standard" t t )

Plots the output waveform out_wave as a histogram, which represents the statistical distribution of the input waveform /V2/PLUS.

iinteg

iinteg( 
o_waveform 
) 
=> o_waveform / nil

Description

Computes the indefinite integral of a waveform with respect to the X-axis variable.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform representing the indefinite integral of the input waveform.

nil

Returns nil and an error message otherwise.

Example

plot( iinteg( v( "/net8" )))

Computes the indefinite integral of the waveform representing the voltage of
"/net8".

imag

imag( 
{ o_waveform | n_input }
) 
=> o_waveformImag / n_numberImag / nil

Description

Returns the imaginary part of a waveform representing a complex number or returns the imaginary part of a complex number.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_input

Complex number.

Value Returned

o_waveformImag

Returns a waveform when the input argument is a waveform.

n_numberImag

Returns a number when the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

imag( v( "/net8" ) )

Returns a waveform representing the imaginary part of the voltage of "/net8". You also can use the vim alias to perform the same command, as in
vim( "net8" ).

x=complex( -1 -2 ) => complex(-1, -2)
imag( x ) => -2.0

Creates a variable x representing a complex number, and returns the real portion of that complex number.

inl

inl( 
o_dacSignal
o_sample | o_pointList | n_interval
[ ?mode t_mode ] 
[ ?threshold n_threshold ] 
[ ?crossType t_crossType ] 
[ ?delay f_delay ] 
[ ?units x_units ] 
[ ?nbsamples n_nbsamples ] 
)
=> n_inl / nil

Description

Computes the integral non-linearity of a transient simple or parametric waveform.

Arguments

o_dacSignal

Waveform for which the integral non-linearity is to be calculated.

o_sample

Waveform used to obtain the points for sampling the dacSignal. These are the points at which the waveform crosses the threshold while either rising or falling (defined by the crossType argument) with the delay added to them.

n_pointList

List of domain values at which the sample points are obtained from the dacSignal.

n_interval

The sampling interval.

?mode t_mode

The mode for calculating the threshold.

Valid values: auto and user.

Default value: auto.

If set to user, an n_threshold value needs to be provided.

If set to auto, n_threshold is calculated internally.

?threshold n_threshold

The threshold value against which the integral non-linearity is to be calculated. It needs to be specified only when the mode is selected as user.

?crossType t_crossType

The points at which the curves of the waveform intersect with the threshold. While intersecting, the curve may be either rising or falling.

Valid values: rising and falling, respectively.

Default crossType is rising.

?delay f_delay

The delay time after which the sampling begins.

Valid values: Any valid time value.

Default value: 0.

?unit x_units

Unit for expressing the output waveform.

Valid values: abs (absolute) and lsb (multiples of least significant bit).

Default value: abs.

?nbsamples n_nbsamples

Number of samples used for calculating the non-linearity. If not specified, the samples are taken against the entire data window.

For each of the three ways in which the sample points can be specified, only a few of the other optional arguments are meaningful, as indicated below:

Value Returned

n_inl

Returns the integral non-linearity waveform.

nil

Returns nil and an error message otherwise.

Example

inl( wave1 wave2 ?crossType "rising" ?delay 0.4 )
=> srrWave:175051544

Returns the integral non-linearity for wave1 by taking the points at which wave2 crosses the internally calculated threshold while rising as the sample points and adding a delay of 0.4 to them.

integ

integ( 
o_waveform
[ n_intial_limit , n_final_limit ] 
) 
=> o_waveform / n_value / nil

Description

Computes the definite integral of the waveform with respect to a range specified on the X-axis of the waveform. The result is the value of the area under the curve over the range specified on the X-axis.

You should specify either both the limits or neither. In case you do specify the limits, they become the end points of the range on the X-axis for definite integration. If you do not specify the limits, then the range for definite integration is the entire range of the sweep on the X-axis.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

initial_limit_n

Initial limit for definite integration.

final_limit_n

Final limit for definite integration.

Value Returned

o_waveform

Returns a waveform representing the definite integral for a family of waveforms if the input argument is a family of waveforms.

n_value

Returns a numerical value representing the definite integral of the input waveform if the input argument is a single waveform.

nil

Returns nil and an error message otherwise.

Example

integ( v( "/out" ) )

Returns the definite integral of the waveform representing the voltage of "/out" over its entire range.

integ( VT( "/out" ),12.5n,18n)

Returns the definite integral of the waveform representing the voltage of "/out" within a specified range.

intersect

intersect( 
o_waveform1
o_waveform2 
) 
=> o_wave / nil

Description

Returns a waveform containing the points of intersection for two waveforms passed as arguments.

Arguments

o_waveform1

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

o_waveform2

Additional waveform object.

Value Returned

o_wave

Returns a waveform containing the points of intersection for the two waveforms passed as arguments.

nil

Returns nil if the two waveforms are disjoint or overlap each other, and an error message, if the arguments to the function are not correct.

Example

intersect( VT("/inp1") VT("/inp2") )

ipn

ipn( 
o_spurious 
o_reference 
[ f_ordspur f_ordref f_epspur f_epref g_psweep s_measure ]
) 
=> o_waveform / f_number / nil

Description

Performs an intermodulation nth-order intercept measurement.

The data for this measurement can be either a single input power value or a parametric input power sweep.

From each of the spurious and reference power waveforms (or points), the ipn function extrapolates a line of constant slope (dB/dB) according to the specified order and input power level. These lines represent constant small-signal power gain (ideal gain). The ipn function calculates the intersection of these two lines and returns the value of either the X coordinate (input referred) or Y coordinate.

Arguments

o_spurious

Waveform or number representing the spurious output power (in dBm).

o_reference

Waveform or number representing the reference output power (in dBm).

f_ordspur

Order or slope of the spurious constant-slope power line.

Default value: 3

f_ordref

Order or slope of the reference constant-slope power line.

Default value: 1

f_epspur

Value (in dBm) used to indicate the point where the spurious constant-slope power line begins. If g_psweep is t, this value is the input power value of the point on the o_spurious waveform, otherwise this value is paired with the o_spurious value to define the point. This point should be in the linear region of operation. (If g_psweep is t, f_spspur defaults to the X coordinate of the first point of the o_spurious wave; if s_measure is ’input, a number must be specified.)

f_epref

Value (in dBm) used to indicate the point where the reference constant-slope power line begins. If g_psweep is t, this value is the input power value of the point on the o_reference waveform, otherwise this value is paired with the o_reference value to define the point. This point should be in the linear region of operation. (If g_psweep is t, f_epref defaults to the X coordinate of the first point of the o_reference wave; if s_measure is ’input, a number must be specified.)

g_psweep

Boolean indicating that the input power to the circuit was a parametric sweep. The power sweep must both be in dBm and be performed at the lowest parametric level.

Default value: t

s_measure

Name indicating if measurement is to be input referred (’input) or output referred (’output).

Default value: ’input

Value Returned

o_waveform

Depending on setting of g_psweep and the dimension of the input waveforms, returns either a waveform or a family of waveforms.

f_number

If o_spurious and o_reference are numbers or they are waveforms when g_psweep is t, returns a number.

nil

Returns nil and an error message otherwise.

Example

spurWave = db20(harmonic(wave signalHarmonic))
refWave = db20(harmonic(wave referenceHarmonic))
xloc = ipn( spurWave refWave 3.0 1.0 -25 -25 )
yloc = ipn( spurWave refWave 3.0 1.0 -25 -25 t "Output")

Computes the IP3 point for the given wave.

Each of the following examples returns an ip3 measurement.

ipn(dB20(harmonic(v("/Pif" ?result "pss_fd") 9))
dB20(harmonic(v("/Pif" ?result "pss_fd") 8)))
ipn(dbm(harmonic(spectralPower(v("/Pif" ?result "pss_fd")/50.0 
v("/Pif" ?result "pss_fd")) 9))
dbm(harmonic(spectralPower(v("/Pif" ?result "pss_fd")/50.0
v("/Pif" ?result "pss_fd")) 8)))
ipn(dbm(harmonic(spectralPower(v("/Pif" ?result "pss_fd")
/resultParam("rif:r" ?result "pss_td")
v("/Pif" ?result "pss_fd")) 9))
dbm(harmonic(spectralPower(v("/Pif" ?result "pss_fd")
/resultParam("rif:r" ?result "pss_td")
v("/Pif" ?result "pss_fd")) 8)))
ipn(dbm(harmonic(spectralPower(i("/rif/PLUS" ?result "pss_fd") 
v("/Pif" ?result "pss_fd")) 9))
dbm(harmonic(spectralPower(i("/rif/PLUS" ?result "pss_fd")
v("/Pif" ?result "pss_fd")) 8))
3. 1. -25 -25 t "Output")
ipn(dbm(harmonic(spectralPower(v("/Pif" ?result "pac")
/resultParam("rif:r" ?result "pss_td")
v("/Pif" ?result "pac")) -21))
dbm(harmonic(spectralPower(v("/Pif" ?result "pac")
/resultParam("rif:r" ?result "pss_td")
v("/Pif" ?result "pac")) -25)))

ipnVRI

ipnVRI( 
o_vport 
x_harmspur 
x_harmref 
[ ?iport o_iport ]
[ ?rport f_rport ]
[ ?ordspur f_ordspur ]|[ ?epoint f_epoint ]
[ ?psweep g_psweep ]
[ ?epref f_epref ] 
[ ?ordref f_ordref ]
[ ?measure s_measure ]
) 
=> o_waveform / f_number / nil

Description

Performs an intermodulation nth-order intercept point measurement.

Use this function to simplify the declaration of an ipn measurement. This function extracts the spurious and reference harmonics from the input waveform(s), and uses dBm(spectralPower((i or v/r),v)) to calculate the respective powers. The function passes these power curves or numbers and the remaining arguments to the ipn function to complete the measurement.

From each of the spurious and reference power waveforms (or points), the ipn function extrapolates a line of constant slope (dB/dB) according to the specified order and input power level. These lines represent constant small-signal power gain (ideal gain). The ipn function calculates the intersection of these two lines and returns the value of either the X coordinate (input referred) or the Y coordinate.

Arguments

o_vport

Voltage across the output port. This argument must be a family of spectrum waveforms (1 point per harmonic), with the option of containing a parametric input power sweep (in dBm).

x_harmspur

Harmonic number of the spurious voltage contained in o_vport. When o_iport is specified, also applies to a current waveform contained in o_iport.

x_harmref

Harmonic index of the reference voltage contained in o_vport. When o_iport is specified, also applies to a current waveform contained in o_iport.

?iport o_iport

Current into the output port. This argument must be a family of spectrum waveforms (1 point per harmonic), with the option of containing a parametric input power sweep (in dBm). When specified, power is calculated using voltage and current.

?rport f_rport

Resistance into the output port. When specified and o_iport is nil, the output power is calculated using voltage and resistance.

Default value: 50

?ordspur f_ordspur

Order or slope of the spurious constant-slope power line.

Default value: 3

?epoint f_epoint

Value (in dBm) used to indicate the point where the spurious constant-slope power line begins. If g_psweep is t, this value is the input power value of the point on the o_spurious waveform, otherwise this value is paired with the o_spurious value to define the point. This point should be in the linear region of operation.

Default value: If g_psweep is t, the lowest input power value; if s_measure is ’input, a number must be specified.

?psweep g_psweep

Boolean indicating that the input power to the circuit was a parametric sweep. The power sweep must be in dBm and must be performed at the lowest parametric level.

Default value: t

?epref f_epref

Value (in dBm) used to indicate the point where the reference constant-slope power line begins. If g_psweep is t, this value is the input power value of the point on the o_reference waveform, otherwise this value is paired with the o_reference value to define the point. This point should be in the linear region of operation.

Default value: If f_epoint is not nil, f_epoint; else if g_psweep is t, the X coordinate of the first point of the o_reference wave; else if s_measure is ’input, a number must be specified.

?ordref f_ordref

Order or slope of the reference constant-slope power line.

Default value: 1

?measure s_measure

Symbol indicating if measurement is to be input referred (’input) or output referred (’output).

Default value: ’input

Value Returned

o_waveform

Depending on the setting of g_psweep and the dimension of input waveform(s), the ipnVRI function returns either a waveform or a family of waveforms.

f_number

Depending on the setting of g_psweep and the dimension of input waveform(s), the ipnVRI function returns a number.

nil

Returns nil and an error message otherwise.

Example

Each of following examples returns an ip3 measurement:

ipnVRI(v("/Pif" ?result "pss_fd") 9 8)
ipnVRI(v("/Pif" ?result "pss_fd") 9 8 
?rport resultParam("rif:r" ?result "pss_td"))
ipnVRI(v("/Pif" ?result "pss_fd") 9 8
?iport i("/rif/PLUS" ?result "pss_fd") ?epoint -25
?measure "Output")
ipnVRI(v("/Pif" ?result "pac") -21 -25
?rport resultParam("rif:r" ?result "pss_td"))

ipnVRICurves

ipnVRICurves( 
o_vport 
x_harmspur 
x_harmref 
[ ?iport o_iport ]
[ ?rport f_rport ]
[ ?ordspur f_ordspur ]
[ ?epoint f_epoint ]
[ ?psweep g_psweep ]
[ ?epref f_epref ]
[ ?ordref f_ordref ]
[ ?displayLabels g_displayLabels ]
) 
=> o_waveform / nil

Description

Constructs the waveforms associated with an ipn measurement.

Use this function to simplify the creation of waves associated with an ipn measurement. This function extracts the spurious and reference harmonics from the input waveform(s), and uses dBm(spectralPower((i or v/r),v)) to calculate the respective powers.

From each of the spurious and reference power waveforms (or points), the ipnVRICurves function extrapolates a line of constant slope (dB/dB) according to the specified order and input power level. These lines represent constant small-signal power gain (ideal gain). The function returns these lines and power waveforms (when present) as a family of waveforms.

This function only creates waveforms and does not perform an ipn measurement or include labels with the waveforms. Use the ipn or ipnVRI function for making measurements.

Arguments

o_vport

Voltage across the output port. This argument must be a family of spectrum waveforms (1 point per harmonic), with the option of containing a parametric input power sweep (in dBm).

x_harmspur

Harmonic index of the spurious voltage contained in o_vport. When o_iport is specified, also applies to a current waveform contained in o_iport.

x_harmref

Harmonic index of the reference voltage contained in o_vport. When o_iport is specified, also applies to a current waveform contained in o_iport.

?iport o_iport

Current into the output port. This argument must be a family of spectrum waveforms (1 point per harmonic), with the option of containing a parametric input power sweep (in dBm). When specified, power is calculated using voltage and current.

?rport f_rport

Resistance into the output port. When specified and o_iport is nil, the output power is calculated using voltage and resistance.

Default value: 50

?ordspur f_ordspur

Order or slope of the spurious constant-slope power line.

Default value: 3

?epoint f_epoint

Value (in dBm) used to indicate the point where the spurious constant-slope power line begins. If g_psweep is t, this value is the input power value of the point on the o_spurious waveform, otherwise this value is paired with the o_spurious value to define the point. This point should be in the linear region of operation.

Default value: If g_psweep is t, the X coordinate of the first point of the o_spurious wave; otherwise a number must be specified.

?psweep g_psweep

Boolean indicating that the input power to the circuit was a parametric sweep. The power sweep must be in dBm and must be performed at the lowest parametric level.

Default value: t

?epref f_epref

Value (in dBm) used to indicate the point where the reference constant-slope power line begins. If g_psweep is t, this value is the input power value of the point on the o_reference waveform, otherwise this value is paired with the o_reference value to define the point. This point should be in the linear region of operation.

Default value: If f_epoint is not nil, f_epoint; else if g_psweep is t, the X coordinate of the first point of the o_reference wave; else a number must be specified.

?ordref f_ordref

Order or slope of the reference constant-slope power line.

Default value: 1

?displayLabels g_displayLabels

Specifies whether to display labels on the plot.

Valid values:

  • t: Labels are displayed on the plot.
  • nil: Labels are not displayed on the plot.

Default value: t

Value Returned

o_waveform

A family of waveforms that contains the spurious and reference tangent lines, and when g_psweep is t, contains the spurious and reference waveforms.

nil

Returns nil and an error message otherwise.

Example

Each of following examples returns curves related to an ip3 measurement:

ipnVRICurves(v("/Pif" ?result "pss_fd") 9 8)
ipnVRICurves(v("/Pif" ?result "pss_fd") 9 8
?rport resultParam("rif:r" ?result "pss_td"))
ipnVRICurves(v("/Pif" ?result "pss_fd") 9 8
?iport i("/rif/PLUS" ?result "pss_fd") ?epoint -25)
ipnVRICurves(v("/Pif" ?result "pac") -21 -25
?rport resultParam("rif:r" ?result "pss_td"))

kf

kf(
o_s11
o_s12 
o_s21 
o_s22 
)
=> o_waveform / nil

Description

Returns the stability factor in terms of the supplied parameters.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

Value Returned

o_waveform

Waveform object representing the stability factor.

nil

Returns nil if there is an error.

Example

s11 = sp(1 1)
s12 = sp(1 2)
s21 = sp(2 1)
s22 = sp(2 2)
plot(kf(s11 s12 s21 s22))

ln

ln(
{ o_waveform | n_number }
) 
=> o_waveform / f_number / nil

Description

Gets the base-e (natural) logarithm of a waveform or number.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform object representing the base-e (natural) logarithm of the input waveform if the input argument is a waveform object, or returns a family of waveforms if the input argument is a family of waveforms

f_number

Returns a number if the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

ln( v( "/net9" ) )

Gets a waveform that is calculated as the natural logarithm of the input waveform.

ln(ymax(v("/net9")))

Gets a waveform that is calculated as the natural logarithm of the following: ymax(v("/net9")).

ln(100) 
=> 4.60517

Gets the natural logarithm of 100.

log10

log10(
{ o_waveform | n_number } 
) 
=> o_waveform / n_number / nil

Description

Gets the base-10 logarithm of a waveform or a number.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform object if the input argument is a waveform object or returns a family of waveforms if the input argument is a family of waveforms.

n_number

Returns a number that is calculated as the base-10 logarithm of the input number.

nil

Returns nil and an error message otherwise.

Example

log10( v( "/net9" ) )

Gets a waveform that is calculated as the base-10 logarithm of the input waveform.

log10( ymax( v( "/net9" ) ) )

Gets a waveform representing the base-10 logarithm of ymax(v("/net9")).

log10( 100 ) 
=> 2.0

Gets the base-10 logarithm of 100, or 2.

lsb

lsb( 
o_s11 
o_s12
o_s21 
o_s22 
g_frequency 
) 
=> o_waveform / nil

Description

Computes the load stability circles.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

g_frequency

Frequency. It can be specified as a scalar or a linear range. If it is specified as a linear range, the frequency is swept. The linear range is specified as a list with three values: the start of the range, the end of the range, and the increment. For example, list(100M 1G 100M) specifies a linear range with the following values:

{ 100M, 200M, 300M, 400M, 500M, 600M, 700M, 800M, 900M, 1G }

In that case, a load stability circle is calculated at each one of the 10 frequencies

Value Returned

o_waveform

Waveform object representing the load stability circles.

nil

Returns nil and an error message otherwise.

Example

plot(lsb(s11 s12 s21 s22 list(800M 1G 100M)))

lshift

lshift( 
o_waveform 
n_delta
) 
=> o_waveform / nil

Description

Shifts the waveform to the left by the delta value.

This command is the inverse of the rshift command.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_delta

Value by which the waveform is to be shifted.

Value Returned

o_waveform

Returns a waveform object representing the input waveform shifted to the left. Returns a family of waveforms if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

plot( lshift( v( "/net8" ) 30u ) )

Shifts the waveform representing the voltage of "/net8" to the left by 30u and plots the resulting waveform.

mag

mag( 
{ o_waveform | n_number }
) 
=> o_waveform / n_number / nil

Description

Gets the magnitude of a waveform or number.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform object if the input argument is a waveform object or returns a family of waveforms if the input argument is a family of waveforms.

n_number

Returns a number if the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

mag( v( "5" ) )

Gets the magnitude of the waveform representing the voltage at net 5. You can also use the vm alias to perform the same command, as in vm( "5" ).

mag( i( "VFB" ) )

Gets the magnitude of the waveform representing current through the VFB component. You can also use the im alias to perform the same command, as in im( "VFB" ).

mag( -10 ) => 10

Returns the magnitude of -10.

nc

nc( 
o_Fmin 
o_Gmin
o_rn 
g_level 
g_frequency 
) 
=> o_waveform / nil

Description

Computes the noise circles.

Arguments

o_Fmin

Waveform object representing the minimum noise factor.

o_Gmin

Waveform object representing the optimum noise reflection.

o_rn

Waveform object representing the normalized equivalent noise resistance.

g_level

Level in dB. It can be specified as a scalar or a vector. The level is swept, if it is specified as a vector. The linRg function can be called to generate a linear range. For example, linRg( -30 30 5 ) is the same as list(-30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30) and the g_level argument can be specified as either of the above. In that case, a noise circle is calculated at each one of the 13 levels.

g_frequency

Frequency. It can be specified as a scalar or a linear range. The frequency is swept if it is specified as a linear range. The linear range is specified as a list with three values: the start of the range, the end of the range, and the increment. For example, list(100M 1G 100M) specifies a linear range with the following values:

{100M, 200M, 300M, 400M, 500M, 600M, 700M, 800M, 900M, 1G }

In that case, a noise circle is calculated at each one of the 10 frequencies.

Value Returned

o_waveform

Waveform object representing the noise circles.

nil

Returns nil and an error message otherwise.

Example

Gopt = getData("Gopt")
Bopt = getData("Bopt")
Zref = zref(1 ?result "sp")
Gmin = gmin(Gopt Bopt Zref)
Fmin = getData("Fmin")
rn = getData("NNR")
NC = nc(Fmin Gmin rn 10 list(100M 1G 100M))
displayMode("smith")
smithType("impedance")
plot(NC)

normalQQ

normalQQ(
o_waveform 
)
=> o_waveform / nil

Description

Returns a quantile-quantile plot of the sample quantiles versus theoretical quantiles from a normal distribution. If the distribution is normal, the plot is close to a linear waveform.

Argument

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Values Returned

o_waveform

Returns the waveform representing the normal quantile plot.

nil

Returns nil and an error message otherwise.

Example

normalQQ(v("net10" ?result "tran"))

Returns the quantile plot for the v("net10" ?result "tran") signal.

overshoot

overshoot( 
o_waveform 
n_initVal 
g_initType 
n_finalVal 
g_finalType 
[ g_multiple [ s_Xname ] ]
[ g_histoDisplay ]
[ x_noOfHistoBins ] 
) 
=> o_waveform / n_value /nil

Description

Computes the percentage by which an expression overshoots a step going from the initial value to the final value you enter.

This command returns the overshoot of o_waveform as a percentage of the difference between the initial value and the final value.

In the equation below, M represents Maximum Value of the peak wave, F represents Final Value of the settled wave, and I represents Initial Value of the wave.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_initVal

Initial X value at which to start the computation.

g_initType

Specifies how initVal functions.

Valid values: a non-nil value specifies that the initial value is taken to be the value of the waveform, interpolated at initVal, and the waveform is clipped from below, as follows:

o_waveform = clip( o_waveform initVal nil )

nil specifies that initVal is defined by the X value entered. (The command gets the Y value for the specified X value and uses that value for initVal.)

n_finalVal

Final value at which to end the computation.

g_finalType

Specifies how finalVal functions.

Valid values: a non-nil value specifies that the final value is taken to be the value of the waveform, interpolated at finalVal, and the waveform is clipped from above, as follows:

o_waveform = clip( o_waveform nil finalVal )

nil specifies that finalVal is defined by the X value entered. (The command gets the Y value for the specified X value and uses that value for finalVal.)

g_multiple

An optional boolean argument that takes the value nil by default. If set to t, the function returns multiple occurrences of the overshoot event.

s_xName

An optional argument that is used only when g_multiple is set to t. It takes the value time by default. It controls the contents of the x vector of the waveform object returned by the function.

Valid values: ‘time, ‘cycle

g_histoDisplay

When set to t, returns a waveform that represents the statistical distribution of the riseTime data in the form of a histogram. The height of the bars (bins) in the histogram represents the frequency of the occurrence of values within the range of riseTime data.

Valid values: t nil

Default value: nil

x_noOfHistoBins

Denotes the number of bins represented in the histogram representation.

Valid values: Any positive integer

Default value: nil

g_histoDisplay and x_noOfHistoBins are added for backward compatibility only. It will be deprecated in future releases. Use the histo function for plotting the histogram of the resulting function.

Value Returned

o_waveform

Returns a waveform (or family of waveforms) representing the amount of overshoot in comparison to the whole signal if the input argument is a family of waveforms or if g_multiple is set to t.

n_value

Returns a value for the amount of overshoot in comparison to the whole signal if the input is a single waveform.

nil

Returns nil and an error message otherwise.

Example

overshoot( v( "/net8" ) 7n t 3.99u t )

Returns the value of the overshoot for the waveform representing the voltage of "/net8".

overshoot(VT("/out") 0.5 nil 4.95 nil 5 t ‘time) 

Returns multiple occurrences of overshoot specified against time-points at which each overshoot event occurs.

overshoot(VT("/out") 0.5 nil 4.95 nil 5 t ‘cycle) 

Returns multiple occurrences of overshoot specified against cycle numbers, where a cycle number refers to the n’th occurrence of the overshoot event in the input waveform.

pavg

pavg(
o_waveform 
n_from 
n_to
[ n_period [ n_sfactor ] ]
) 
=> o_waveform / nil

Description

Computes the periodic average of a family of signals for each time point.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like srrWave:XXXXX.).

n_from

Starting numeric value for the range on the X-axis.

n_to

Ending numeric value for the range on the X-axis.

n_period

Numeric value for the period of the input waveform.

n_sfactor

Sampling factor. This can be increased in order to increase the accuracy of the output.

Default value: 1

Values Returned

o_waveform

Returns a waveform representing the periodic average of a family of signals.

nil

Returns nil and an error message otherwise.

Example

pavg( v("/net8") ?from 1n ?to 20n ?period 2n ?sfactor 1)

Returns the value of the periodic average for the family of waveforms representing the voltage of "/net8".

peak

peak( 
o_waveform 
[ ?from f_from ]
[ ?to f_to ]
[ ?xtol f_xtol ]
[ ?ytol f_ytol ]
[ ?withLast g_withLast ] 

) 
=> o_waveform / nil

Description

Detects the peaks in the input waveform and returns the X and Y coordinates of these peak points in the form of a waveform.

The function will not work for waveforms that comprise of complex numbers.

Arguments

o_waveform

Input waveform.

?from f_from

The initial point on the given waveform to start determining the peaks. By default, the first point of the waveform is the starting point.

?to f_to

The final point on the given waveform up to which the peaks are to be determined. By default, the last point of the waveform is the end point.

?xtol f_xtol

The distance on the X axis within which all peaks are to be filtered.Default: 0.0

?ytol f_ytol

The distance on the Y axis within which all peaks are to be filtered.Default: 0.0

?withLast g_withLast

Determines whether to include the last point in the peak calculation or not. When this argument is set to t, the last point is included in the plot if it is a higher than the previous point. When set to nil, the plot stops at the last peak.

If both f_xtol and f_ytol are specified, the filtering mechanism will operate as follows:

If only one of f_xtol or f_ytol is specified, the peaks are filtered only in either the X-axis direction or the Y-axis direction, respectively.

Value Returned

o_waveform

Returns a waveform whose X and Y coordinates of the peaks are determined from the input waveform and the peaks are filtered based on thef_xtol and f_ytol criteria.

nil

Returns nil and an error message otherwise.

Example

peak( vt("/out") ?from 1n ?to 20n ?xtol 2n ?ytol 0.5) 

Out of all the peaks in the region starting from 1n to 20n, the function returns a waveform comprising of some of these peaks that satisfy the criteria of x-tol (2n) and ytol (0.5).

peakToPeak

peakToPeak( 
o_waveform 
[ ?overall type_overall ]
) 
=> o_waveform / n_value / nil

Description

Returns the difference between the maximum and minimum values of a waveform.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

?overall overall

Value Returned

o_waveform

Returns a waveform or a family of waveforms if the input argument is a family of waveforms.

n_value

Returns the difference between the maximum and minimum values of a waveform if the input argument is a single waveform.

nil

Returns nil and an error message otherwise.

Example

peakToPeak( v( "/net2" ) ) 

Returns the difference between the maximum and minimum values of the waveform representing the voltage of the "/net2" net.

period_jitter

period_jitter( 
o_waveform 
t_crossType 
[ ?mode t_mode ] 
[ ?threshold n_threshold ] 
[ ?binSize n_binSize ] 
[ ?xName t_xName ] 
[ ?outputType t_outputType ] 
) 
=> o_waveform / f_val / nil

Description

Computes the period jitter. It returns a waveform or a value representing deviation from the average period.

Arguments

o_waveform

Name of the signal, expression, or a family of waveforms.

t_crossType

The points at which the curves of the waveform intersect with the threshold. While intersecting, the curve may be either rising or falling.

Valid values: rising and falling.

Default value: rising.

?mode t_mode

The mode for calculating the threshold.Valid values: auto and user.

If set to user, an n_threshold value needs to be specified by you.

If set to auto, n_threshold is calculated as:

Auto Threshold Value = integral of the waveform divided by the X range

Default value: auto

?threshold n_threshold

The threshold value against which the period is to be calculated. It needs to be specified only when the mode selected is user.

?binSize n_binSize

The width of the moving average window.The deviation of value at the particular point from the average of this window is the jitter.

If binsize=0, all periods are used to calculate the average.

If binsize=N, the last N periods are used to calculate the average.

Default value: 0

?xName t_xName

The X-axis of the output waveform. It specifies whether you want to retrieve the period jitter against time (or another X-axis parameter for non-transient data) or cycle. Cycle numbers refer to the n’th occurrence of the delay event in the input waveform.

Valid values: time and cycle.

Default value: time

?outputType t_outputType

Type of output.Valid values: sd and plot.

If set to plot, the output is a jitter waveform.

If set to sd, the output is a standard deviation of the jitter waveform.

Default value: plot

Value Returned

o_waveform

Returns the period jitter values as a function of time or cycle when the outputType is set to plot.

f_val

Returns the standard deviation value when the outputType is set to sd.

nil

Returns nil otherwise.

Example

period_jitter( wave1 “rising” ?mode “user” ?threshold 1 ?binSize 2 ?xName “cycle” ?outputType “sd” )
=> 1.695467

Returns the standard deviation for the period jitter of wave1 with the threshold of 1 against the cycle on the x-axis.

phase

phase(
{ o_waveform | n_number }
) 
=> o_waveform / n_number / nil

Description

Gets the phase of the waveform or number. The phase command is similar to the phaseDegUnwrapped command and returns the unwrapped phase in degrees.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform object if the input argument is a waveform object or returns a family of waveforms if the input argument is a family of waveforms.

n_number

Returns a number if the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

phase( v( "5" ) )

Gets the phase of the waveform representing the voltage at net 5. You can also use the vp alias to perform the same command, as in vp( "5" ).

phase( i( "VFB" ) )

Gets the phase of the waveform representing the current through the VFB component. You can also use the ip alias to perform the same command, as in ip( "VFB" ).

phase( -2.0 ) => 180.0

Gets the phase of -2.

phaseDeg

phaseDeg(
{ o_waveform | n_number } 
) 
=> o_waveform / n_number / nil

Description

Calculates the wrapped phase in degrees of a waveform and returns a waveform.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform object representing the wrapped phase in degrees of the input waveform. Returns a family of waveforms if the input argument is a family of waveforms.

n_number

Returns a number if the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

phaseDeg( v( "vout" ) )

Takes the input waveform, representing the voltage of the "vout" net, and returns the waveform object representing the wrapped phase in degrees.

phaseDegUnwrapped

phaseDegUnwrapped(
{ o_waveform | n_number }
) 
=> o_waveform / n_number / nil

Description

Calculates the unwrapped phase in degrees of a waveform and returns a waveform.

The phaseDegUnwrapped function shifts the phase by ±2 pi when the difference in phases of two consecutive points is greater than pi radians.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform object representing the unwrapped phase in degrees of the input waveform. Returns a family of waveforms if the input argument is a family of waveforms.

n_number

Returns a number if the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

phaseDegUnwrapped( v( "vout" ) )

Takes the input waveform, representing the voltage of the "vout" net, and returns the waveform object representing the unwrapped phase in degrees.

phaseDegUnwrappedWithFreq

phaseDegUnwrappedWithFreq(
o_waveform
g_frequency
)
=> o_waveform / nil

Description

Calculates the unwrapped phase in degrees of a waveform and returns a waveform with the specified start frequency, the phase of which remains in the range of -180 to 180 degrees.

Note that if the phase increases with frequency, the waveform does not start from +180 because otherwise the rest of the waveform will be out of the range. Similarly, if the phase decreases with frequency, the waveform does not start from -180.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

g_frequency

Starting frequency.

Value Returned

o_waveform

Returns a waveform object, representing the unwrapped phase in degrees.

nil

Returns nil if there is an error.

Examples

The following function returns a waveform object representing the unwrapped phase in degrees.

openResults("./simulation/loopfinder/opAmp_tb/maestro/results/maestro/Interactive.3/psf/loopfinder_opAmp_tb_1/psf")
;Opens the simulation results stored in the specified results directory.
results()
;Lists the available results in the specified dirrectory.
selectResult('stb)
;Selects the specified result.
outputs()
;List the available outputs in the selected result.
w=getData("loopGain" ?result "stb")
;Creates the waveform object 'w' for the output 'loopGain' of the result 'stb'.
phaseDegUnwrappedWithFreq(w 10G)
;Creates a waveform object representing  the unwrapped phase in degrees of the specified waveform 'w' for the specified start frequency, the phase of which is in the range of -180 to 180 degrees.
plot(phaseDegUnwrappedWithFreq(waveform 10G))
;Plots the waveform object in the Waveform window.
=> "./simulation/loopfinder/opAmp_tb/maestro/results/maestro/Interactive.3/psf/loopfinder_opAmp_tb_1/psf"
=> 
(pz stb stb_margin tran tranOp
    lf model instance output designParamVals
    primitives subckts variables
)
=> 
stdobj@0x36c9f2f0
=> 
("loopGain")
=> 
srrWave:0x3894e260
=> 
srrWave:0x3894e270
=> 
rdbLoadResults("fnxSession0" "./simulation/loopfinder/opAmp_tb/maestro/results/maestro/Interactive.3/psf/loopfinder_opAmp_tb_1/psf")
=>t
=>t

phaseMargin

phaseMargin( 
o_waveform 
) 
=> o_waveform / n_value / nil

Description

Computes the phase margin of the loop gain of an amplifier.

You supply a waveform representing the loop gain of interest over a sufficiently large frequency range. phaseMargin( gain ) = 180 + phase( value( gain f0 ) ) The phase margin is calculated as the difference between the phase of the gain in degrees at f0 and at -180 degrees. The frequency f0 is the lowest frequency where the gain is 1. For stability, the phase margin must be positive.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform representing the phase margin of the loop gain of an amplifier for a family of waveforms if the input argument is a family of waveforms.

n_value

Returns the value (in degrees) equivalent to the phase margin of the input waveform.

nil

Returns nil and an error message otherwise.

Example

phaseMargin( v( "/OUT" ) )

Returns the phase margin for the waveform representing the voltage of the
"/OUT" net.

phaseRad

phaseRad( 
{ o_waveform | n_number }
) 
=> o_waveform / n_number / nil

Description

Calculates the wrapped (discontinuous) phase in radians of a waveform.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_number

Number.

Value Returned

o_waveform

Returns a waveform representing a discontinuous value (in radians) for the phase of the input waveform. Returns a family of waveforms if the input argument is a family of waveforms.

n_number

Returns a number when the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

plot( phaseRad( v( "/OUT" ) ) )

Returns the wrapped phase of the waveform representing the voltage of the "/OUT" net.

phaseRadUnwrapped

phaseRadUnwrapped( 
o_waveform 
) 
=> o_waveform / nil

Description

Calculates the unwrapped (continuous) phase in radians of a waveform and returns a waveform.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform representing the unwrapped (continuous) value for the phase of the input waveform in radians. Returns a family of waveforms if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

plot( phaseRadUnwrapped( v( "/OUT" ) )

Returns the unwrapped phase of the waveform representing the voltage of the "/OUT" net.

PN

PN( 
o_waveform 
t_crossType 
n_threshold 1.0 
[ ?windowName t_windowName ]
[ ?smooth x_smooth ]
[ ?windowsize x_windowsize ]
[ ?detrending t_detrending ]
[ ?cohGain f_cohGain ]
)
=> o_waveform / nil

Description

Calculates the transient phase noise of the input waveforms in decibels (dBc/Hz). Phase noise is defined as the power spectral density of the absolute jitter of an input waveform.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

?crossType t_crossType

The points at which the curves of the waveform intersect with the threshold. While intersecting, the curve may be either rising or falling.

Valid values: rising and falling, respectively.

Default crossType is rising.

?windowName t_windowName

The window type.Valid values: ’Blackman, ’Cosine2, ’Cosine4, ’ExtCosBell, ’HalfCycleSine, ’HalfCycleSine3 or ’HalfCycleSine6, ’Hamming, ’Hanning, ’Kaiser, ’Parzen, ’Rectangular, ’Triangular, or ’Nuttall.

Default value: ’Rectangular

?smooth x_smooth

The Kaiser window smoothing parameter. The 0 value requests no smoothing.Valid values: 0 <= x_smooth <= 15.

Default value: 1

?windowsize x_windowsize

The number of frequency domain points to use in the Fourier analysis. A larger window size results in an expectation operation over fewer samples, which leads to larger variations in the power spectral density. A small window size can smear out sharp steps in the power spectral density that might really be present.

Default value: 256

?detrending t_detrending

The detrending mode to use.Valid values: ’None, ’mean, ’Linear

Default value: ’Mean

?cohGain f_cohGain

A scaling parameter. A non-zero value scales the power spectral density by 1/(f_cohGain).Valid values: none, default, magnitude, dB20, or dB10

Default value: db20

Value Returned

o_waveform

The power spectral density waveform returned when the command is successful.

nil

Returns nil when the command fails.

Example

PN(v("net9") "rising" 1.0 ?windowName "Rectangular" ?smooth 1 ?windowSize 256 ?detrending "Mean" ?cohGain (10**(/20)) )

Returns the Phase Noise waveform, net9, for the window type rectangular at threshold value 1.0.

pow

pow( 
{ o_waveformBase | n_numberBas } 
{ o_waveformExpn | n_numberExpn }
) 
=> o_waveform / n_result / nil

Description

Takes the exponent of a given waveform or number.

Arguments

o_waveformBase

Waveform object to be used as the base for the expression.

o_waveformExpn

Waveform object to be used as the exponent for the expression.

n_numberBase

Number to be used as the base for the expression.

n_numberExpn

Number to used as the exponent for the expression.

Value Returned

o_waveform

Returns a family of waveforms if one of the input arguments is a family of waveforms or returns a waveform if one of the input arguments is a waveform (and none is a family).

n_result

Returns a number if both the input arguments are numbers.

nil

Returns nil and an error message otherwise.

Example

pow( average( v( "/net9" ) ) 0.5 )

Gets the square root of the average value of the voltage at "/net9".

pow( 2 3 ) 
=> 8

Gets the value of 2 to the third power, or 8.

pow( -2 2 ) 
=> 4

Gets the value of -2 to the second power.

pow( 2.5 -1.2 ) 
=> 0.3330213

Gets the value of 2.5 to the power of -1.2.

prms

prms(
o_waveform 
n_from
n_to 
[ n_period [ n_sfactor ] ]
)
=> o_waveform / nil

Description

Computes the periodic root mean square of a family of signals for each time point, which is the square root of the periodic average of the square of the input waveform.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like srrWave:XXXXX.).

n_from

Starting numeric value for the range on the X-axis.

n_to

Ending numeric value for the range on the X-axis.

n_period

Numeric value for the period of the input waveform.

n_sfactor

Sampling factor. This can be increased in order to increase the accuracy of the output.

Default value: 1

Values Returned

o_waveform

Returns a waveform representing the periodic root mean square of a family of signals.

nil

Returns nil and an error message otherwise.

Example

prms v("/net8") ?from 1n ?to 20n ?period 2n ?sfactor 1)

Returns the value of the periodic root mean square for the family of waveforms representing the voltage of "/net8".

psd

psd( 
o_waveform 
f_timeStart 
f_timeEnd 
x_num 
[ ?windowName t_windowName ]
[ ?smooth x_smooth ]
[ ?cohGain f_cohGain ]
[ ?windowsize x_windowsize ]
[ ?detrending t_detrending ]
) 
=> o_waveformReal / nil

Description

Returns an estimate for the power spectral density of o_waveform. If x_windowsize is not a power of 2, it is forced to the next higher power of 2. If x_num is less than x_windowsize, x_num is forced to x_windowsize.

Arguments

o_waveform

Time domain waveform object with units of volts or amps.

f_timeStart

Starting time for the spectral analysis interval. Use this parameter and f_timeEnd to exclude part of the interval. For example, you might set these values to discard initial transient data.

f_timeEnd

Ending time for the spectral analysis interval.

x_num

The number of time domain points to use. The maximum frequency in the Fourier analysis is proportional to x_num and inversely proportional to the difference between f_timeStart and f_timeEnd.

Default value: 512

?windowName t_windowName

The window to be used for applying the moving window FFT.

Valid values: Blackman, Cosine2, Cosine4, ExtCosBell, HalfCycleSine, Half3CycleSine or HalfCycleSine3, Half6CycleSine or HalfCycleSine6,Hamming, Hanning, Kaiser, Parzen, Rectangular, Triangle, Triangular, or Nuttall.

Default value: Hanning

?smooth x_smooth

The Kaiser window smoothing parameter. The 0 value requests no smoothing.Valid values: 0 <= x_smooth <= 15.

Default value: 1

?cohGain f_cohGain

A scaling parameter. A non-zero value scales the power spectral density by 1/(f_cohGain).

Valid values: 0 < f_cohGain < 1 (You can use 1 if you do not want the scaling parameter to be used)

Default value: 1

?windowSize x_windowsize

The number of frequency domain points to use in the Fourier analysis. A larger window size results in an expectation operation over fewer samples, which leads to larger variations in the power spectral density. A small window size can smear out sharp steps in the power spectral density that might really be present.

Default value: 256

?detrending t_detrending

The detrending mode to use.

Valid values: mean, linear, none

Default value: none

The psd function works by applying a moving windowed FFT to time-series data. If there is a deterministic trend to the underlying data, you might want to remove the trend before performing the spectral analysis. For example, consider analyzing phase noise in a VCO model. Without the noise, the phase increases more or less linearly with time, so it is appropriate to set the detrending mode to ’linear. To subtract an average value, set the detrending mode to ’mean. Where the spectrum of raw data is desired, set the detrending mode to none.

Value Returned

o_waveformReal

The power spectral density waveform returned when the command is successful.

nil

Returns nil when the command fails.

Example

psd(VT("/net32" "/hm/test_bench/spectre/schematic"), 0, 16m, 12000,
?windowName Hanning,?smooth 1, ?windowSize 256,
?detrending None, ?cohGain 1)

Consider applying this command to one of the waveforms in the following illustration.

The result is the following spectrum, which is displayed with a logarithmic vertical scale.

psdbb

psdbb( 
o_waveform1 
o_waveform2 
f_timeStart 
f_timeEnd 
x_num 
[ ?windowName t_windowName ]
[ ?smooth x_smooth ]
[ ?cohGain f_cohGain ]
[ ?windowsize x_windowsize ]
[ ?detrending t_detrending ]
) 
=> o_waveformReal / nil

Description

Returns an estimate for the power spectral density of o_waveform1+j*o_waveform2. If x_windowsize is not a power of 2, it is forced to the next higher power of 2. If x_num is less than x_windowsize, x_num is forced to x_windowsize.

Arguments

o_waveform1

Time domain waveform object with units of volts or amps.

o_waveform2

Time domain waveform object with units of volts or amps.

f_timeStart

Starting time for the spectral analysis interval. Use this parameter and f_timeEnd to exclude part of the interval. For example, you might set these values to discard initial transient data.

f_timeEnd

Ending time for the spectral analysis interval.

x_num

The number of time domain points to use. The maximum frequency in the Fourier analysis is proportional to x_num and inversely proportional to the difference between f_timeStart and f_timeEnd.

?windowName t_windowName

The window to be used for applying the moving window FFT.

Valid values: Blackman, Cosine2, Cosine4, ExtCosBell, HalfCycleSine, Half3CycleSine or HalfCycleSine3, Half6CycleSine or HalfCycleSine6, Hamming, Hanning, Kaiser, Parzen, Rectangular, Triangle, Triangular, or Nuttall.

Default value: Hanning

?smooth x_smooth

The Kaiser window smoothing parameter. 0 requests no smoothing.

Valid values: 0 <= x_smooth <= 15.

Default value: 1

?cohGain f_cohGain

A scaling parameter. A non-zero value scales the power spectral density by 1/(f_cohGain).Valid values: 0 < f_cohGain < 1 (You can use 1 if you do not want the scaling parameter to be used)

Default value: 1

?windowSize x_windowsize

The number of frequency domain points to use in the Fourier analysis. A larger window size results in an expectation operation over fewer samples, which leads to larger variations in the power spectral density. A small window size can smear out sharp steps in the power spectral density that might really be present.

Default value: 256

?detrending t_detrending

The detrending mode to use.

Valid values: mean, linear, none

Default value: none

The psd function works by applying a moving windowed FFT to time-series data. If there is a deterministic trend to the underlying data, you might want to remove the trend before performing the spectral analysis. For example, consider analyzing phase noise in a VCO model. Without the noise, the phase increases more or less linearly with time, so it is appropriate to set the detrending mode to ’linear. To subtract an average value, set the detrending mode to ’mean. Where the spectrum of raw data is desired, set the detrending mode to ’none.

Value Returned

o_waveformReal

The power spectral density waveform returned when the command is successful.

nil

Returns nil when the command fails.

Example

psdbb(VT("/net32" "/hm/test_bench/spectre/schematic"), 
VT("/net11" "/hm/test_bench/spectre/schematic"), 0, 16m, 12000,
?windowName Hanning,?smooth 1, ?windowSize 256,
?detrending None, ?cohGain 1)

Consider applying this command to both of the waveforms in the following illustration.

The result is the following spectrum, which is displayed with a logarithmic vertical scale.

pstddev

pstddev( 
o_waveform
n_from 
n_to 
[ n_period [ n_sfactor ] ]
)
=> o_waveform / nil

Definition

Computes the periodic standard deviation of a family of signals for each time point.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like srrWave:XXXXX.).

n_from

Starting numeric value for the range on the X-axis.

n_to

Ending numeric value for the range on the X-axis.

n_period

Numeric value for the period of the input waveform.

n_sfactor

Sampling factor. This can be increased in order to increase the accuracy of the output. Default value: 1

Values Returned

o_waveform

Returns a waveform representing the periodic standard deviation of a family of signals.

nil

Returns nil and an error message otherwise.

Example

pstddev( v("/net8") ?from 1n ?to 20n ?period 2n ?sfactor 1)

Returns the value of the periodic standard deviation for the family of waveforms representing the voltage of "/net8"

pzbode

pzbode(
f_transferGain
f_minfrequency
f_maxfrequency
x_nponits 
[ ?poles o_waveform1 ]
[ ?zeros o_waveform2 ]
)
=> o_waveform / nil

Description

Calculates and plots the transfer function of a circuit from pole zero simulation data.

This command also works for the parametric or sweep data.

Arguments

f_transferGain

The transfer gain constant.

f_minfrequency

The minimum frequency for the bode plot.

f_maxfrequency

The maximum frequency for the bode plot.

x_npoints

The frequency interval for the bode plot, in points per decade.

?poles waveform1

Poles from the dumped simulation data.

Default value: all

?zeros o_waveform2

Zeros from the dumped simulation data.

Default value: all

Value Returned

o_waveform

Waveform containing the X and Y points of the transfer function. The scale of the Y-axis will be db20.

nil

Returns nil and error message otherwise.

Example

pzbode( 1.0 1M 1G 20 ?poles complexPoleWave ?zeros complexZeroWave )

pzfilter

pzfilter(
[ o_PoleWaveform ]
[ o_ZeroWaveform ]
[ ?maxfreq t_maxfreq ]
[ ?reldist n_reldist ]
[ ?absdist n_absdist ]
[ ?minq n_minq ]
[ ?output_type o_output ] 
)
=> o_waveform / nil

Description

Returns the filtered Pole and Zero waveforms.

If you do not specify values for o_PoleWaveform and o_ZeroWaveform arguments, you should have run pz analysis prior to using this function. This command also works for the parametric or sweep data.

Arguments

o_PoleWaveform

Input Pole waveform (complex points).

Default value: Poles of the simulator pz-analysis dump

o_ZeroWaveform

Input Zero waveform (complex points).

Default value: Zeros of the simulator pz-analysis dump

t_maxfreq

Maximum frequency.

Default value: 1e10

?reldist n_reldist

Relative distance to be considered while filtering.

Default value: 0.05

?absdist n_absdist

Absolute distance to be considered while filtering.

Default value: 1e-6

?minq n_minq

Minimum q factor to be allowed while filtering.

?output_type o_output

Specifies the type of the output. If this argument is not passed, the output is a family of waves with two child waveforms, representing poles and zeros respectively, with the real component of each waveform as the X values and the imaginary components as the Y values.

Valid value: complexwave. The output is a family of waves with two child waves, both of which are complex and represent poles and zeros, respectively.

Value Returned

o_waveform

Returns a family (waveform) of Pole and Zero waveforms.

nil

Returns nil otherwise.

Example

pzfilter( complexPoleWave complexZeroWave )
=> srrWave:175051584

Returns a family of filtered Pole and Zero waveforms, which correspond to the sweep values of “Pole” and “Zero”, respectively.

rapidIPNCurves

rapidIPNCurves( 
o_result
[ ?resultsDir t_resultsDir ]
[ ?resistance n_resistance ]
@Rest args
) 
=> o_waveformReal / nil

Description

Plots IPN curves.

Arguments

o_result

Object representing simulation results that can be displayed as a series of points on a grid.

?resultsDir t_resultsDir

Name of the directory where results are saved.

?resistance n_resistance

Value of resistance

Default value: 50

@Rest l_args

List of arguments to be used by the value function on the results data. Refer to the value function for more details.

Value Returned

o_waveformReal

Returns a waveform.

nil

Returns nil or an error message otherwise.

Example

w2 = rapidIPNCurves("ac-ip3" ?resultsDir "./simulation/amplifier/spectre/schematic/psf" ?r 50)

rapidIIPN

rapidIIPN( 
o_result
[ ?resultsDir t_resultsDir ]
[ ?resistance n_resistance ]
@Rest args 
) 
=> o_waveform / nil

Description

Plots the input IPN curves.

Arguments

o_result

Object representing simulation results that can be displayed as a series of points on a grid.

?resultsDir t_resultsDir

Name of the directory where results are saved.

?resistance n_resistance

Value of resistance

Default value: 50

l_args

List of arguments to be used by the value function on the results data. Refer to the value function for more details.

Value Returned

o_waveform

Returns a waveform.

nil

Returns nil or an error message otherwise.

Example

rapidIIPN("hbac_ip3")

real

real(
{ o_waveform | n_input } 
) 
=> o_waveformReal / n_numberReal / nil

Description

Returns the real part of a waveform representing a complex number, or returns the real part of a complex number.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_input

Complex number.

Value Returned

o_waveformReal

Returns a waveform when the input argument is a waveform.

n_numberReal

Returns a number when the input argument is a number.

nil

Returns nil and an error message otherwise.

Example

real( v( "/net8" ) )

Returns a waveform representing the real part of the voltage of "/net8". You also can use the vr alias to perform the same command, as in vr( "net8").

x=complex( -1 -2 ) => complex(-1, -2)
real( x ) => -1.0

Creates a variable x representing a complex number, and returns the real portion of that complex number.

riseTime

riseTime(
o_waveform 
n_initVal
g_initType 
n_finalVal 
g_finalType
n_theta1
n_theta2 
[ g_multiple [ s_Xname ] [ g_histoDisplay ] [ x_noOfHistoBins ] ]
) 
=> o_waveform / n_value / nil

Description

Returns the rise time measured between theta1 (percent low) to theta2 (percent high) of the difference between the initial value and the final value.

The riseTime function can also be used to compute the fall time if initVal is higher than finalVal.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_initVal

Initial value at which to start the computation.

g_initType

Specifies how n_initVal functions.

Valid values: a non-nil value specifies that the initial value is taken to be the value of the waveform, interpolated at n_initVal, and the waveform is clipped from below as follows:

o_waveform = clip( o_waveform g_initVal nil )

where nil specifies that n_initVal is defined by the X value entered. (The command gets the Y value for the specified X value and uses that value for n_initVal.)

n_finalVal

Final value at which to end the computation.

g_finalType

Specifies how the n_finalVal argument functions.

Valid values: a non-nil value specifies that the final value is taken to be the value of the waveform, interpolated at n_finalVal, and the waveform is clipped from above, as follows:

o_waveform = clip(o_waveform nil n_finalVal)

where nil specifies that the n_finalVal argument is defined by the X value entered. (The command gets the Y value for the specified X value and uses that value for n_finalVal.)

n_theta1

Percent low.

n_theta2

Percent high.

g_multiple

An optional boolean argument that takes the value nil by default. If set to t, the function returns multiple occurrences of the riseTime event.

s_xName

An optional argument that is used only when g_multiple is set to t. It takes the value time by default. It controls the contents of the x vector of the waveform object returned by the function.

Valid values: ‘time, ‘cycle

g_histoDisplay

When set to t, returns a waveform that represents the statistical distribution of the riseTime data in the form of a histogram. The height of the bars (bins) in the histogram represents the frequency of the occurrence of values within the range of riseTime data.

Valid values: t nil

Default value: nil

x_noOfHistoBins

Denotes the number of bins represented in the histogram representation.

Valid values: Any positive integer

Default value: nil

g_histoDisplay and x_noOfHistoBins are added for backward compatibility only. It will be deprecated in future releases. Use the histo function for plotting the histogram of the resulting function.

Value Returned

o_waveform

Returns a waveform representing the rise time for a family of waveforms if the input argument is a family of waveforms or if g_multiple is set to t.

n_value

Returns a value for the rise time if the input is a single waveform.

nil

Returns nil and an error message otherwise.

Example

riseTime( v( "/net8" ) 0 t 2 t 10 90 )

Computes the rise time for the waveform representing the voltage of "/net8" from 0 to 2.

For the next example, assume that v is the following sinusoidal waveform:

sin( 2 * pi * time)
riseTime( v 0.25 t 0.5 t 10 90)

Computes the fall time of the first falling edge from 1 to 0.

riseTime(VT("/out") 0.5 nil 4.5 nil 10 90 t "time") (s)

Returns multiple occurrences of riseTime specified against time-points at which each riseTime event occurs.

riseTime(VT("/out") 0.5 nil 4.5 nil 10 90 t "cycle") (s)

Returns multiple occurrences of riseTime specified against cycle numbers, where a cycle number refers to the n’th occurrence of the riseTime event in the input waveform.

rms

rms(
o_waveform 
) 
=> o_waveform / n_value / nil

Description

Returns the root-mean-square value of a waveform.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform representing the root-mean-square value for a family of waveforms if the input argument is a family of waveforms.

n_value

Returns a value for the root-mean-square value for the specified waveform if the input is a single waveform.

nil

Returns nil and an error message otherwise.

Example

rms( v( "/out" ) )

Returns the root-mean-square value of the waveform representing the voltage of the "/out" net.

rmsNoise

rmsNoise( 
n_from 
n_to 
) 
=> o_waveform / n_value / nil

Description

Computes the integrated root-mean-square noise over the specified bandwidth.

Arguments

n_from

Frequency in hertz that specifies the minimum value for the bandwidth.

n_to

Frequency in hertz that specifies the maximum value for the bandwidth.

Value Returned

o_waveform

Returns a waveform (or a family of waveforms) representing the integrated root-mean-square noise if the data being analyzed is parametric.

n_value

Returns a value for the integrated root-mean-square noise if the data being analyzed is from a single simulation run.

nil

Returns nil and an error message otherwise.

Example

rmsNoise( 100 100M ) 
=> 250e-6

Computes the integrated root-mean-square noise from 100 to 100M.

rmsVoltage

rmsVoltage( 
t_net 
[ t_net1 ] 
) 
=> f_voltage / nil

Description

Calculates the root-mean-square voltage between two nets for fast and regular envelop analysis.

Arguments

t_net

Name of the net selected in the schematic.

t_net1

Name of the second net selected in the schematic. This argument is optional. If not specified, the default value is assumed as gnd.

Value Returned

f_voltage

Returns a value in terms of voltage.

nil

Returns nil and an error message otherwise.

Example

rmsVoltage( "net1" "!gnd") 
=> 120

Calculates the root-mean-square voltage between net1 and gnd.

rmsTerminalVoltage

rmsTerminalVoltage(
t_terminal 
[ t_terminal1 ]
)
=> f_voltage / nil

Description

Calculates the root-mean-square voltage between two terminals for fast and regular envlp analysis.

Arguments

t_terminal

Name of the terminal selected in the schematic.

t_terminal1

Name of the second terminal selected in the schematic. This argument is optional. If not specified, the default value is assumed as gnd.

Value Returned

f_voltage

Returns a value in terms of voltage.

nil

Returns nil or an error message.

Example

If the following expression is created and plotted:

clip(psdbb(real(harmonic(v("/I19/M4/G" ?result "envlp_fd" ?type 'terminalV) 1)) imag(harmonic(v("/I19/M4/G" ?result "envlp_fd" ?type 'terminalV) 1)) 0.0 1e-08 4 ?windowName "Hanning" ?windowSize 4 ?detrending "None") 0.0 1e+07)

The rms terminal voltage function creates the following expression:

rmsTerminalVoltage("IO/M1/D")

If the result is re-evaluated, the scalar value is added to the ADE output.

root

root(
o_waveform 
n_rootVal
x_n )

=> o_waveform / n_value / l_value / nil

Description

Returns the nth X value at which the Y value equals the specified Y value (rootVal).

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_rootVal

Y value of interest.

x_n

Number that specifies which X value to return. If n equals 1, the first X value that crosses over the Y rootVal is returned. If n equals 2, the second X value that crosses over the Y rootVal is returned, and so on. If you specify a negative integer for n, the X values that cross the rootVal are counted from right to left (from maximum to minimum). If you specify n as 0, the list of root values is returned.

Value Returned

o_waveform

Returns a waveform if the input argument is a family of waveforms.

n_value

Returns an X value when the input argument is a single waveform.

l_value

Returns a list of all the root values when n is 0.

nil

Returns nil and an error message otherwise.

Example

root( v( "vout" ), 1.0, 4 )

Returns the X value for the point at which the waveform curve crosses the 1.0 Y value for the fourth time.

rshift

rshift( 
o_waveform
n_delta
) 
=> o_waveform / nil

Description

Shifts the waveform to the right by the n_delta value.

This command is the inverse of the lshift command.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_delta

Value by which the waveform is to be shifted.

Value Returned

o_waveform

Returns a waveform object. Returns a family of waveforms if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

rshift( v( "vout" ) ) 10n )

Shifts the waveform representing the voltage through the "vout" net to the right by 10n.

sample

sample( 
o_waveform 
n_from 
n_to
t_type
n_by 
) 
=> o_waveform / n_number / nil

Description

Samples a waveform at the specified interval.

You can use this function to reduce the time it takes to plot waveforms that have many data points. If you sample a waveform beyond its range, you get the final value of the waveform. You can use this function to demodulate a signal. Consider an AM modulated sine wave. Assume the carrier frequency is 1 GHz, and the modulation frequency is 1 MHz. If the waveform is sampled every 1 ns, the resulting signal is cleanly demodulated (the 1 GHz carrier is completely eliminated by the sampling).

The function can be used to sample both a waveform object as well as a family of waveforms. If the family is of dimension m, the arguments n_from, n_to, and n_by would be of dimension m-1.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_from

Starting value for the sampling.

n_to

Ending value for the sampling.

t_type

Type of the sampling.

Valid values: "linear" or "log"

n_by

Interval at which to sample.

Value Returned

o_waveform

Returns a waveform representing the sampling you specified.

n_number

Returns a number if the output contains only one point.

nil

Returns nil and an error message otherwise.

Example

sample( v( "vout" ) 0 50n "linear" 0.1n )

Takes a linear sample of the waveform representing the voltage of the "vout" net.

sample( v( "vout" ) 0 100m "log" 10 )

Takes a logarithmic sample of the waveform representing the voltage of the "vout" net.

settlingTime


settlingTime( 

o_waveform
 

n_initVal
 

g_initType
n_finalVal
 

g_finalType
n_theta
 

[ g_multiple [ s_Xname ] ] 

) 
=> 
o_waveform 
/ 
n_value / nil

Description

The settling time is the time by which the signal settles within the specified Percent of step (theta) of the difference between the Final Value and Initial Value from the Final Value.

The above graph represents the Initial value of the signal as 0% and Final value as 100%. The Percent of Step is taken as 5%.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_initVal

Initial value at which to start the computation.

g_initType

Specifies whether the values entered are X values or Y values.

Valid values: t specifies that initVal is defined by the X value entered; nil specifies that initVal is defined by the Y value entered

n_finalVal

Final value at which to start the computation.

g_finalType

Specifies whether the values entered are X values or Y values.

Valid values: t specifies that finalVal is defined by the X value entered; nil specifies that finalVal is defined by the Y value entered

n_theta

Percent of the total step.g_multiple

An optional boolean argument that takes the value nil by default. If set to t, the function returns multiple occurrences of the settlingTime event.

s_xName

An optional argument that is used only when g_multiple is set to t. It takes the value time by default. It controls the contents of the x vector of the waveform object returned by the function.

Valid values: ‘time, ‘cycle

Additional Information

The equation used to calculate maximum delta value is:

maxDeltaY = ((theta/100.0)*abs(FinalVal-InitVal))

Firstly, check if the absolute difference between the last element of the waveform and finalVal is less than maxDeltaY. If yes, then compute settlingTime, else returns nil.

To compute settlingTime, subtract finalVal from the waveform, get the subtracted-wave and calculate settling time as first cross on subtracted-wave  at maxDeltaY (from opposite direction for falling edge). If no such crossing exists, then return 0.0.

maxDeltaY = ((theta/100.0) * abs(FinalVal -InitVal))
if( abs(last_Y_element_of_waveform - finalVal) < maxDeltaY then
    or( cross( abs(waveform - finalVal)  maxDeltaY -1 -1) 0.0)
else
     nil
)

Value Returned

o_waveform

Returns a waveform representing the settling time for a family of waveforms if the input argument is a family of waveforms or if g_multiple is set to t.

n_value

Returns a value for the settling time for the specified waveform if the input is a single waveform.

nil

Returns nil and an error message otherwise.

Example

settlingTime( v("/out" ) 0 t 2 t 90 )

Computes the time required for the waveform representing the voltage of
the "/out" net to settle within 90 percent of the step from 0 to 2.

settlingTime(VT("/out") 0.5 nil 4.95 nil 5 t "time") (s)

Returns multiple occurrences of settlingTime specified against time-points at which each settlingTime event occurs.

settlingTime(VT("/out") 0.5 nil 4.95 nil 5 t "cycle") (s)

Returns multiple occurrences of settlingTime specified against cycle numbers, where a cycle number refers to the n’th occurrence of the settlingTime event in the input waveform.

slewRate

slewRate( 
o_waveform
n_initVal 
g_initType
n_finalVal 
g_finalType 
n_theta1
n_theta2
[ g_multiple [ s_Xname ] ]
[ g_histoDisplay ] [ x_noOfHistoBins ]
) 
=> o_waveform / n_value / nil

Description

Computes the average rate at which an expression changes from theta1 (percent low) to theta2 (percent high) of the difference between the initial value and final value.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_initVal

Initial X-axis value at which to start the computation.

g_initType

Specifies whether the values entered are X values or Y values.

Valid values: t specifies that initVal is defined by the X value entered; nil specifies that initVal is defined by the Y value entered

n_finalVal

Final value at which to end the computation.

g_finalType

Specifies whether the values entered are X values or Y values.

Valid values: t specifies that finalVal is defined by the X value entered; nil specifies that finalVal is defined by the Y value entered

n_theta1

Percent low (percentage of the total step).

n_theta2

Percent high (percentage of the total step).

g_multiple

An optional boolean argument that takes the value nil by default. If set to t, the function returns multiple occurrences of the slewRate event.

s_xName

An optional argument that is used only when g_multiple is set to t. It takes the value time by default. It controls the contents of the x vector of the waveform object returned by the function.

Valid values: ‘time, ‘cycle

g_histoDisplay

When set to t, returns a waveform that represents the statistical distribution of the riseTime data in the form of a histogram. The height of the bars (bins) in the histogram represents the frequency of the occurrence of values within the range of riseTime data.

Valid values: t nil

Default value: nil

x_noOfHistoBins

Denotes the number of bins represented in the histogram representation.

Valid values: Any positive integer

Default value: nil

g_histoDisplay and x_noOfHistoBins are added for backward compatibility only. It will be deprecated in future releases. Use the histo function for plotting the histogram of the resulting function.

Value Returned

o_waveform

Returns a waveform representing the slew rate for a family of waveforms if the input argument is a family of waveforms or if g_multiple is set to t.

n_value

Returns a value for the slew rate for the specified waveform if the input is a single waveform.

nil

Returns nil or an error message otherwise.

Example

slewRate( v( "vout" ) 10n t 30n t 10 90 )

Computes the slew rate for the waveform representing the voltage of the "vout" net from 10n to 30n.

slewRate( v( "vout" ) 0 nil 10 nil 5 95 )

Computes the slew rate for the waveform representing the voltage of the "vout" net from 0 to 10. In this example, the initial value and final value are entered as Y values.

slewRate(VT("/out") 0.5 nil 4.5 nil 10 90 t ‘time)

Return multiple occurrences of slewRate values, computed at different time-points.

slewRate(VT("/out") 0.5 nil 4.5 nil 10 90 t ‘cycle)

Returns multiple occurrences of slewRate values specified against cycle numbers (where cycle number refers to the n’th occurrence of slewRate computation).

smithType

smithType( 
x_mode
) 
=> t / nil

Description

Sets the Smith display mode type for the active graph.

Arguments.

x_mode

Type of Smith display.

Valid Values:

  • impedance: Circular graph, also known as Z Smith, where the region above the x-axis repre-sents inductive impedances and the region below the x-axis represents capacitive impedances.
  • admittance: Circular graph, also known as Y Smith, where the region above the x-axis repre-sents capacitive admittances and the region below the x-axis represents inductive admittances.
  • polar: plot graph, representing data using the polar coordinates system.

For more information on circular graphs, see the Creating a Circular Graph section in Virtuoso Visualization and Analysis XL User Guide.s

Value Returned

t

Returns t when the specified Smith display id set.

nil

Returns nil if there is an error.

Example

smithType("impedance")
=>t

Sets the Smith display to impedance.

spectralPower

spectralPower(
o_current 
o_voltage 
) 
=> o_power / nil

Description

Returns the spectral power given the spectral current and voltage.

To obtain a list of the harmonic frequencies, use harmonicList.

Arguments

o_current

Waveform representing the current. The current can be obtained by calling the i data access function for the desired terminal.

Value Returned

o_power

Waveform representing the power of the net.

nil

Returns nil if there is an error.

Example

plot(db10(spectralPower(i("/PORT0/PLUS") v("/net28"))))

Plots power of the output "/net28".  "/PORT0/PLUS" is a member of "/net28".

spectrumMeasurement

spectrumMeasurement( 
o_waveform 
g_isTimeWave
n_from 
n_to 
x_numSamples
n_startFreq
n_endFreq
x_signalBins 
t_windowName 
n_satLvl 
g_isNoiseAnalysis
x_noOfHarmonics
t_measType
) 
=> g_value / nil

Description

Calculates Signal-to-Noise-and-Distortion Ratio (SINAD), Spurious Free Dynamic Range (SFDR), Effective Number of Bits (ENOB), and Signal-to-Noise Ratio (without distortion) by using Fast Fourier Transform (FFT) of any given input signal.

The spectrum measure is used for characterizing A-to-D converters and is typically supported for transient simulation data.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

g_isTimeWave

Boolean that specifies whether the input wave type is time domain waveform or frequency domain waveform.

n_from

The X-axis start value of the portion of input o_waveform to be used for FFT and subsequent calculations.

n_to

The X-axis end value of the portion of input o_waveform to be used for FFT and subsequent calculations.

x_numSamples

Number of sampled points used for the FFT.

Valid values: Any integer power of two greater than zero. For a value that is not a power of two, the function rounds it up to the next closest power of two.

Default value: Number of data points in the Signal.

n_startFreq

Lower limit of frequency range for the spectrum measures.

Default value: First frequency point of the FFT.

n_endFreq

Upper limit of frequency range for the spectrum measures.

Default value: Last frequency point of the FFT.

x_signalBins

Number of signal bins. When you select a window type, this field displays the default number of bins for the selected window type.

For example, if you select the Window Type as Kaiser that has two signal bins, this field displays 2. You can increase the number of signal bins to up to half the value of the sample count.

For example, if the sample count is 16 for the window type Kaiser, you can increase the signal bin count in the Signal Bins field up to 8. You cannot decrease the displayed signal bin value.Valid values: 0 to 99.

Default value: 0.

t_windowName

Windowing function applied to o_wave while applying the FFT for measurement calculations.

Valid values: Blackman, Cosine2, Cosine4, ExtCosBell, HalfCycleSine, HalfCycleSine3, HalfCycleSine6, Hanning, Hamming, Kaiser, Parzen, Rectangular, and Triangular.

Default value: Rectangular.

n_satLvl

Peak saturation level of the FFT waveform. Magnitude of the FFT wave is divided by the Peak Sat Level before using it in calculations. Peak sat level is the full-scale span ignoring any DC offsets and used in ENOB calculation.Valid values: Any floating point number.

Default value: 0

g_isNoiseAnalysis

Boolean that specifies whether the analysis type is Signal Analysis or Noise Analysis.

x_noOfHarmonics

Number of harmonics for the waveform that you want to plot.

For example, If this variable is n, where n should be greater than 1 and the fundamental frequency is harmonic 1, the n harmonics are considered for the harmonic power calculation. The signal bins are used for calculating the harmonic power.

For example, to calculate the total harmonic distortion (THD), if you set the Harmonics value to n, where n is greater than 1, and the fundamental frequency is harmonic 1, the number of harmonics used to calculate THD is 2,...,n. If n=3, the 2nd and 3rd harmonics are used to calculate THD.

t_measType

Result specifier.

Valid values: sinad, sfdr(db), enob, and snhr.

Default value: sinad

Value Returned

g_value

Returns the spectrum measure specified by the t_measType argument.

nil

Returns nil and an error message otherwise.

Example

spectrumMeasurement(v("/OUT" ?result "tran") t 0 3e-08 1024 0 1.25e+08 0 "Rectangular" 0 0 1 "sinad")
=> -0.07218201

Returns the value of the spectrum measure sinad, as specified by the spectrumMeasurement function.

ssb

ssb( 
o_s11 
o_s12
o_s21
o_s22
g_frequency
) 
=> o_waveform / nil

Description

Computes the source stability circles.

Arguments

o_s11

Waveform object representing s11.

o_s12

Waveform object representing s12.

o_s21

Waveform object representing s21.

o_s22

Waveform object representing s22.

g_frequency

Frequency. It can be specified as a scalar or a linear range. The frequency is swept if it is specified as a linear range. The linear range is specified as a list with three values: the start of the range, the end of the range, and the increment. For example, list(100M 1G 100M) specifies a linear range with the following values:

{ 100M, 200M, 300M, 400M, 500M, 600M, 700M, 800M, 900M, 1G }

In that case, a source stability circle is calculated at each one of the 10 frequencies.

Value Returned

o_waveform

Waveform object representing the source stability circles.

nil

Returns nil and an error message otherwise.

Example

plot(ssb(s11 s12 s21 s22 list(800M 1G 100M)))

stddev

stddev( 
o_waveform 
[ ?overall overall ]
[ ?type t_type ]
[ ?continuous g_continuous ]
) 
=> n_stddev / o_waveformStddev / nil

Description

Computes the standard deviation of a waveform (or a family of waveforms) over its entire range.

You can calculate the standard deviation for a population as well as for a sample. The population standard deviation is a parameter, which is a fixed value calculated from every individual in the population. A sample standard deviation is a statistic, which means that it is calculated from only some of the individuals in a population. Since the sample standard deviation depends upon the sample, it has greater variability. Thus, the standard deviation of the sample is greater than that of the population.

If y=f(x):

Standard deviation for a population is calculated as follows:

Standard deviation for a sample is calculated as follows:

Where N is the total number of data points.

Arguments

o_waveform

Waveform object or family of waveforms representing simulation results that can be displayed as a series of points. (A waveform object identifier looks like this: srrWave:XXXXX)

?overall g_overall

Specifies whether to calculate the overall average across corners and sweeps. Possible values are t and nil.

  • When the overall argument is set to t, the average is calculated across all corners and sweeps.
  • When the overall argument is set to nil, the average is calculated per leaf.

The default value is t.

?type t_type

Specifies whether to calculate the standard deviation for a population or for a sample.

Possible values are population and sample. The default value is population.

?continuous g_continuous

Specifies whether to calculate the average amplitude of the input waveform by considering it as a continuous signal or as a discrete signal. Possible values are:

  • t: The waveform is considered as a continuous signal.
  • nil: The waveform is considered as a discrete signal.

The default value is t.

Value Returned

n_stddev

Returns a number representing the standard deviation value of the input waveform.

o_waveformStddev

Returns a waveform representing the average value if the input is a family of waveforms.

nil

Returns nil or an error message.

Example

Returns the population standard deviation of the voltage (y-axis value) of /OUT by considering it as a continuous signal.

stddev(VS("/OUT") ?type "population" ?continuous t )
=>314.4e-6

Returns the sample standard deviation of the voltage (y-axis value) of /OUT by considering it as a discrete signal.

stddev(VS("/OUT") ?type "sample" ?continuous nil )
=>329.9e-6

tangent

tangent( 
o_waveform 
[ ?x n_x ] 
[ ?y n_y ] 
[ ?slope n_slope ] 
[ ?ckm ckm ]
) 
=> o_waveform / nil

Description

Returns the tangent to a waveform through the point (n_x, n_y) with the given slope.

Arguments

o_waveform

Waveform object representing the wave.

?x n_x

X coordinate of the point. The default value is the X coordinate of the first point on the wave.

?y n_y

Y coordinate of the point. The default value is the Y coordinate at the given or default X coordinate.

?slope n_slope

Slope of the line. Default value: 1.0

?ckm ckm

Value Returned

o_waveform

Wave object representing the line.

nil

Returns nil if there is an error.

Example

refLine 
=> tangent(refWave ?x -25 ?slope 1.0)

thd

thd(
o_waveform 
n_from
n_to
x_num
n_fund
) 
=> o_waveform / n_thdValue / nil

Description

The thd function computes the percentage of total harmonic content of a signal with respect to the fundamental frequency expressed as a voltage percentage.

The computation uses the dft function. Assume that the dft function returns complex coefficients A0, A1…, Af , ... . Please note that fundamental frequency f is the frequency contributing to the largest power in the signal. A0 is the complex coefficient for the DC component and Ai is the complex coefficient for the ith harmonic where . Then, total harmonic distortion is computed as:

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

n_from

Starting time for the DFT sample window.

n_to

Ending time for the DFT sample window.

x_num

Number of timepoints.

n_fund

Fundamental Frequency of the signal. If it is nil or zero then the non-zero frequency contributing to the largest power in the signal is used as the fundamental frequency. Otherwise, the harmonic frequency nearest to its value is used as the fundamental frequency.

Value Returned

o_waveform

Returns a waveform representing the absolute value of the total harmonic distortion if the input argument is a family of waveforms.

n_thdValue

Returns the absolute value of the total harmonic distortion of the input waveform.

nil

Returns nil and an error message otherwise.

Example

plot( thd( v( "/net8" ) 10u 20m 64 0 ) ) 

Computes the absolute value of the total harmonic distortion for the waveform representing the voltage of "/net8". The computation is done from 10u to 20m with 64 time points using the non-zero frequency contributing to the largest power in the signal as the fundamental frequency. The resulting waveform is plotted.

plot( thd( v( "/net8" ) 10u 20m 64 90 ) ) 

Computes the absolute value of the total harmonic distortion for the waveform representing the voltage of "/net8". The computation is done from 10u to 20m with 64 timepoints using a harmonic frequency, whose absolute difference w.r.t 90 is minimum, as the fundamental frequency. The resulting waveform is plotted.

thd_fd

thd_fd(
t_name
t_result
)
=> n_thdValue / nil

Description

The thd_fd function returns the total harmonic distortion of the input waveform.

Arguments

t_name

Name of the node for which total harmonic distorted is to be computed.

t_result

Name of the result of the specified node.

Value Returned

n_thdValue

Return a value of total harmonic distortion of the input waveform.

nil

Returns nil and an error message otherwise.

Example

thd_fd( "Plo"  ?result "FOUR0-tran.test_fourier" )

Computes the total harmonic distortion for the "FOUR0-tran.test_fourier" dataset in the results, where Fourier is connected to node "Plo".

unityGainFreq

unityGainFreq( 
o_gainFreqWaveform 
) 
=> n_frequency / nil

Description

Computes and reports the frequency at which the gain is unity.

Arguments

o_gainFreqWaveform

Gain frequency waveform.

Value Returned

n_frequency

Returns a scalar value representing the frequency at which the gain of the input waveform is unity.

nil

Returns nil otherwise.

Example

unityGainFrequency( VF("/out") )

value

value( 
o_waveform 
[ ?scale scale ]
[ ?period n_period ]
[ ?xName s_xName] 
[ ?histoDisplay g_histoDisplay ]
[ ?noOfHistoBins x_noOfHistoBins ]
@Rest args
) 
=> o_waveform / g_value / nil

Description

Returns the Y value of a waveform for a given X value.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

?scale scale

Specifies the interpolation scale for WREAL signals. Valid values: linear, log, nil. Note that all scale elements after the second element are ignored.

  • X is interpolated in linear mode if scale=nil or the first element of scale is linear.
  • X is interpolated in log mode if the first element of scale is log.
  • Y is interpolated in linear mode if scale has a single element linear or second element is linear.
  • Y is interpolated in log mode if scale has a single element log, or second element is log

s_name

The name of the innermost or outermost sweep variable. If the sweep variable name is not supplied, the innermost sweep variable is used.

g_value

Value (X value) at which to provide the Y value. If a string has been defined for a value or set of values, the string may be used instead of the value.

?period n_period

The interval or period after which the value needs to be computed.

g_multiple

An optional boolean argument that takes the value nil by default. If set to t, the function returns multiple occurrences of the interpolated value.

?xName s_xName

An optional argument that is used only when g_multiple is set to t. It takes the value time by default. It controls the contents of the x vector of the waveform object returned by the function.

Valid values: time, cycle

?histoDisplay g_histoDisplay

When set to t, returns a waveform that represents the statistical distribution of the riseTime data in the form of a histogram. The height of the bars (bins) in the histogram represents the frequency of the occurrence of values within the range of riseTime data.

Valid values: t nil

Default value: nil

?noOfHistoBins x_noOfHistoBins

Denotes the number of bins represented in the histogram representation.

Valid values: Any positive integer

Default value: 1

@Rest args

g_histoDisplay and x_noOfHistoBins are added for backward compatibility only. It will be deprecated in future releases. Use the histo function for plotting the histogram of the resulting function.

For the simplest calls to the function, which specify only the given waveform (o_waveform) and the X value (g_value), the given waveform can be a family of waveforms. If the family is of dimension m, g_value can be either of dimension m-1 or a scalar. If g_value is scalar, the function returns the Y value of all the components of the family at the specified g_value.

Value Returned

o_waveform

Returns a waveform or a family of waveforms if the input argument is a family of waveforms or if values are expected at multiple points.

g_value

Returns the Y value if the input argument is a single waveform.

For parametric sweeps, the value might be a waveform that can be printed with the ocnPrint command.

nil

Returns nil and an error message if the value cannot be printed.

Example

value( v( "/net18" ) 4.428e-05 )

Prints the value of "/net18" at time=4.428e-05. This is a parametric sweep of temperature over time.

value( v( "/OUT" )’TEMPDC 20.0 ) 

Returns srrWave:XXXXX, indicating that the result is a waveform.

print( value( v( "/OUT" )’TEMPDC 20.0 ) )

Prints the value of v( "/OUT" ) at every time point for TEMPDC=20.

print( value( v( "/OUT" ) 200n ?period 100n) )

Prints the value of v( "/OUT" ) at 200n, 300n and so on at intervals of 100n until the end of the waveform.

value(VT("/out") 2e-07 ?period 2e-07 ?xName "time") (V)

Returns multiple occurrences of the value specified against time-points at which each interpolated value occurs.

value(VT("/out") 2e-07 ?period 2e-07 ?xName "cycle") (V)

Returns multiple occurrences of value specified against cycle numbers, where a cycle number refers to the n’th occurrence of the value event in the input waveform.

xmax

xmax(
o_waveform 
x_numberOfPeaks 
) 
=> o_waveform / g_value / l_value / nil

Description

Computes the value of the independent variable (X) at which the Y value attains its maximum value.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

x_numberOfPeaks

Specifies the nth X value corresponding to the maximum Y value. For example, if x_numberOfPeaks is 3, the X value corresponding to the third maximum Y value is returned. If you specify a negative integer for x_numberOfPeaks, the X values are counted from right to left (from maximum to minimum). If x_numberOfPeaks is 0, xmax returns a list of X locations.

Value Returned

o_waveform

Returns a waveform (or a family of waveforms) if the input argument is a family of waveforms.

g_value

Returns the X value corresponding to the peak specified with x_numberOfPeaks if the input argument is a single waveform.

l_value

Returns a list of X locations when x_numberOfPeaks is 0 and the input argument is a single waveform.

nil

Returns nil and an error message otherwise.

Example

xmax( v( "/net9" ) 1 )

Gets the time value (X-axis value) at which the voltage of "/net9" attains its first peak value.

xmax( v( "/net9" ) 0 )

Gets the list of time values (X-axis values) at which the voltage of "/net9" attains each of its peak values.

xmin

xmin(
o_waveform 
x_numberOfValleys 
) 
=> o_waveform / g_value / l_value / nil

Description

Computes the value of the independent variable (X) at which the Y value attains its minimum value.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

x_numberOfValleys

Specifies the nth X value corresponding to the minimum Y value. For example, if x_numberOfValleys is 3, the X value corresponding to the third minimum Y value is returned. If you specify a negative integer for x_numberOfValleys, the X-values are counted from right to left (from maximum to minimum). If x_numberOfValleys is 0, xmin returns a list of X locations.

Value Returned

o_waveform

Returns a waveform (or a family of waveforms) if the input argument is a family of waveforms.

g_value

Returns the X value corresponding to the valley specified with x_numberOfValleys if the input argument is a single waveform.

l_value

Returns a list of X locations when x_numberOfValleys is 0 and the input argument is a single waveform.

nil

Returns nil and an error message otherwise.

Example

xmin( v( "/net9" ) 1 )

Gets the time value (X axis) at which the voltage of "/net9" has its first low point or valley.

xmin( v( "/net9" ) 0 )

Gets the list of time values (X axis) at which the voltage of "/net9" has low points or valleys.

xval

xval(
o_waveform
) 
=> o_waveform / nil

Description

Returns a waveform whose X vector and Y vector are equal to the input waveform’s X vector.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

Value Returned

o_waveform

Returns a waveform if the input argument is a single waveform. Returns a family of waveforms if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

xval( v( "/net8" ))

Returns a waveform in which the X vector for the voltage of "/net8" is also used for the Y vector.

ymax

ymax( 
o_waveform 
[ ?overall overall ]
) 
=> n_max / o_waveformMax / nil

Description

Computes the maximum value of the waveform’s Y vector.

A waveform consists of an independent-variable X vector and a corresponding Y vector.

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

?overall overall

Value Returned

n_max

Returns a number representing the maximum value of Y if the input argument is a single waveform.

o_waveformMax

Returns a waveform (or family of waveforms) representing the maximum value of Y if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

ymax( v( "/net9" ) )

Gets the maximum voltage (Y value) of "/net9".

ymin

ymin( 
o_waveform 
[ ?overall overall ]
) 
=> n_min / o_waveformMin / nil

Description

Computes the minimum value of a waveform’s Y vector.

(A waveform consists of an independent-variable X vector and a corresponding Y vector.)

Arguments

o_waveform

Waveform object representing simulation results that can be displayed as a series of points on a grid. (A waveform object identifier looks like this: srrWave:XXXXX.)

?overall overall

Value Returned

n_min

Returns a number representing the minimum value of Y if the input argument is a single waveform.

o_waveformMin

Returns a waveform (or family of waveforms) representing the minimum value of Y if the input argument is a family of waveforms.

nil

Returns nil and an error message otherwise.

Example

ymin( v( "/net9" ) )

Gets the minimum voltage (Y value) of "/net9".

Spectre RF and S-Parameter Calculator Functions

This section describes the following calculator functions used for Spectre RF data analysis:

ifreq

ifreq( 
s_ana
t_terminal 
[ freq n_freq ]
) 
=> o_waveform / nil

Description

Returns the current of the terminal at a specified frequency or at all frequencies in the frequency domain.

Arguments

s_ana

Analysis type or analysis name. The available analyses are hb, pss, qpss, pac, hbac, qpac, and ac.

Default value: hb

t_terminal

Terminal name on the schematic or signal name from the Results Browser.

n_freq

Frequency for which you want to plot the results. It is an optional field.

Valid values: Any integer or floating point number.

Default value: nil

When you specify nil, current on all the frequency points are returned.

Value Returned

o_waveform

Returns a waveform representing current at a specified frequency or at all frequency points.

nil

Returns nil and an error message otherwise.

Example

ifreq("hb" "/load/PLUS" 50 )

Returns the current for /load/PLUS signal, which is obtained from hb analysis, at frequency=50.

ih

ih( 
s_ana
t_terminal 
[ x_hlist ]
) 
=> o_waveform / nil

Description

Returns the current of the terminal at a specified harmonic or at all harmonics in the frequency domain.

Arguments

s_ana

Type of analysis.

Valid values are:

  • hb: Harmonic Balance analysis. This is the default value.
  • pss: Periodic Steady-State analysis.
  • qpss: Quasi-Periodic Steady-State analysis
  • pac: Periodic AC analysis
  • hbac: Harmonic Balance AC analysis
  • qpac: Quasi-Periodic AC analysis

t_terminal

Terminal name on the schematic or the signal name in the Results Browser.

x_hlist

Single harmonic or a list of harmonics for which you want to plot the current of the terminal.

This is an optional argument. You can specify a single harmonic or a list from the available list of harmonics. If a single harmonic is specified, the function returns the current at that harmonic. if a list of harmonics is specified, the function returns a waveform with the harmonics at each of the chosen harmonics.

You can find the available list of harmonics for each analysis by using the harmonicList function.

harmonicList( [?resultsDir t_resultsDir] [?result S_resultName]

In a single-tone simulation, each harmonic is described using an integer. In a multi-tone simulation, each harmonic is described using a list of integers, with one integer for each tone.

The default value is nil, which indicates that the current of the terminal is calculated for all harmonics.

Value Returned

o_waveform

Returns a waveform representing current at a specified harmonic or at all harmonic points.

nil

Returns nil and an error message otherwise.

Examples

The following example returns a list of available harmonics for the specified results. In this example, two tones are simulated in the hb simulation, and therefore the harmonic list is a list of two-element indices.

harmonicList(?resultsDir "./simulation/ExampleLibRF/db_mixer/maestro/results/maestro/ExplorerRun.0/1/ExampleLibRF_db_mixer_1/psf" ?result 'hb_mt_fi)
=> ((-5 5) (-4 4) (-4 5) (-3 3) (-3 4) (-3 5) (-2 2) (-2 3) (-2 4) (-2 5) (-1 1) (-1 2) (-1 3) (-1 4) (-1 5) (0 0) (0 1) (0 2) (0 3) (0 4) (0 5) (1 0) (1 1) (1 2) (1 3) (1 4) (1 5) (2 -1) (2 0) (2 1) (2 2) (2 3) (2 4) (2 5) (3 -2) (3 -1) (3 0) (3 1) (3 2) (3 3) (3 4) (3 5) (4 -3) (4 -2) (4 -1) (4 0) (4 1) (4 2) (4 3) (4 4) (4 5) (5 -4) (5 -3) (5 -2) (5 -1) (5 0) (5 1) (5 2) (5 3) (5 4) (5 5) (6 -5) (6 -4) (6 -3) (6 -2) (6 -1) (6 0) (6 1) (6 2) (6 3) (6 4) (6 5))

To calculate the current of the terminal /rf/PLUS for the harmonic (0 2), that is 0 times one tone plus 2 times the other tone in hb analysis, specify the following:

ih("hb" "/rf/PLUS" '(0 2) )
=> srrWave:0x3d70db20

This returns a waveform representing the current of the terminal /rf/PLUS at the specified harmonic (0 2).

If you want to plot the current at different harmonic combinations, you can specify the list of harmonics. For example: '((0 2) (0 3) (0 4)).

The following example returns a waveform that represents the current of the terminal /rf/PLUS at different harmonic combinations.

ih("hb" "/rf/PLUS" '((0 2) (0 3) (0 4)))
=> srrWave:0x3d70b470

itime

itime(
s_ana 
t_terminal 
[ time n_time ]
) 
=> o_waveform / nil

Description

Returns the current of the terminal at a specified time point or at all time points in the time domain.

Arguments

s_ana

Analysis type or analysis name. The available analyses are hb, pss, and tran.

Default value: hb

t_terminal

Terminal name on the schematic or signal name from the Results Browser.

n_time

Time points for which you want to plot the results. If you specify a time point in this field, the result of the specified time is returned. It is an optional field.

Valid values: Any integer or floating point number.

Default value: nil.

Value Returned

o_waveform

Returns a waveform representing current at a specified time point or at all time points.

nil

Returns nil and an error message otherwise.

Example

itime("hb" "/load/PLUS" 4 )

Returns the current for /load/PLUS signal, which is obtained from hb analysis, at time=4s.

pir

pir( 
s_ana 
t_branch1
t_branch2
n_resistance 
[ harmonic x_hlist ]
) 
=> o_waveform / nil

Description

Returns the spectral power from current and resistance for a specified harmonic list or for all harmonic points.

Arguments

s_ana

Analysis type or analysis name. The available analyses are hb, pss, qpss, pac, hbac and qpac.

Default value: hb

t_branch1

First branch name on the schematic or signal name from the Results Browser.

t_branch2

Second branch name on the schematic or signal name from the Results Browser.

n_resistance

The resistance value.

Valid values: Any integer or floating point number.

harmonic x_hlist

Harmonics for which you want to plot the results. It is an optional field. For analyses, such as hb, pss, pac, and hbac, you can add either single harmonic value or an available list of harmonic values in this field.

Valid values: Any integer or a list from the available list of harmonics. You can find the available harmonics by using the harmonicList function.

Default value: nil.

Value Returned

o_waveform

Returns a waveform representing spectral power from current and resistance for a specified harmonic list.

nil

Returns nil and an error message otherwise.

Example

pir("hb" "/V1/PLUS" "/rf/PLUS" 2 5 )

This example returns the spectral power for /V1/PLUS and /rf/PLUS, which are obtained from the hb analysis, at resistance=2 ohms and harmonic=5.

pmNoise

pmNoise( 
s_ana
[ freq n_freq ]
s_modifier 
g_dsb
) 
=> o_waveform / n_pnoise / nil

Description

Returns the modulated phase noise at a specified frequency or for the entire spectrum.

Arguments

s_ana

Analysis type or analysis name.

Valid values: pnoise, and hbnoise.

Default value: pnoise

n_freq

Frequency for which you want to calculate the modulated phase noise.

Valid values: Any integer or floatng point number

Default value: nil, which means the frequency at all points are calculated.

s_modifier

Modifier to be used.

Valid values: dBc, normalized, Power, Magnitude, and dBV

Default value: dBc.

g_dsb

Specifies whether you want to include the double side band.

Valid values: t and nil

Default value: t

Value Returned

n_pnoise

Returns the modulated phase noise at the specified frequency point.

o_waveform

Returns a waveform representing the modulated phase noise at all frequency points.

nil

Returns nil and an error message otherwise.

Example

pmNoise("hbnoise" 50 "dBc" t )

This example returns the modulated phase noise for hbnoise analysis at frequency=50 and modifier=dBc and double side bands included.

pn

pn( 
s_ana 
[ freq n_freq ]
) 
=> o_waveform / n_pn / nil

Description

Returns the phase noise at a specified frequency or at all frequency points.

Arguments

s_ana

Analysis type or analysis name.

Valid values: pnoise, hbnoise, and qpnoise.

Default value: pnoise

n_freq

Frequency for which you want to calculate the phase noise.

Valid values: Any integer or floating point number

Default value: nil, which means the frequency at all points are calculated.

Value Returned

n_pn

Returns the phase noise at a specified frequency point.

o_waveform

Returns a waveform representing the phase noise at all frequency points.

nil

Returns nil and an error message otherwise.

Example

pn("hbnoise" 50 )

This example returns the phase noise for hbnoise analysis at frequency=50.

pvi

pvi( 
s_ana 
t_pos 
t_neg 
t_branch1 
t_branch2 
[ harmonic x_hlist ]
) 
=> o_waveform / nil

Description

Returns the spectral power from voltage and current for a specified harmonic list or for all harmonics.

Arguments

s_ana

Analysis type or analysis name. The available analyses are hb, pss, qpss, pac, hbac and qpac.

Default value: hb

t_pos

Positive node or net from the schematic or from the Results Browser. This field can also contain an explicit voltage value.

t_neg

Negative node or net from the schematic or from the Results Browser. This field can also contain an explicit voltage value.

t_branch1

First branch name on the schematic or signal name from the Results Browser.

t_branch2

Second branch name on the schematic or signal name from the Results Browser.

x_hlist

Harmonics for which you want to plot the results. It is an optional field. For analyses, such as hb, pss, pac, and hbac, you can add either single harmonic value or available list of harmonic values in this field.

Valid values: Any integer or a list from the available list of harmonics. You can find the available harmonics by using the harmonicList function.

Default value: nil

Value Returned

o_waveform

Returns a waveform representing the spectral power from voltage and current for a specified harmonic list or for all harmonics.

nil

Returns nil and an error message otherwise.

Example

pvi("hb" "/RFin" "/RFout" "/V1/PLUS" "/V2/PLUS" 2)

This example returns the spectral power for the following values:

pvr

pvr( 
s_ana 
t_pos
t_neg 
n_resistance 
[ harmonic x_hlist ]
) 
=> o_waveform / nil

Description

Returns the spectral power at a specified harmonic list or at all harmonics with resistor and voltage on the positive and negative nodes.

Arguments

s_ana

Analysis type or analysis name. The available analyses are hb, pss, qpss, pac, hbac and qpac.

Default value: hb

t_pos

Positive node or net from the schematic or from the Results Browser. This field can also contain an explicit voltage value.

t_neg

Negative node or net from the schematic or from the Results Browser. This field can also contain an explicit voltage value.

n_resistance

The resistance value.

Valid values: Any integer or floating point number

x_hlist

Specify the harmonics for which you want to plot the results. It is an optional field. For analyses, such as hb, pss, pac, and hbac, you can add either single harmonic value or available list of harmonic values in this field.

Valid values: Any integer or a list from the available list of harmonics. You can find the available harmonics by using the harmonicList function.

Default value: nil.

Value Returned

o_waveform

Returns a waveform representing the spectral power on specified harmonic list or on all harmonics with resistor and voltage on the positive and negative nodes

nil

Returns nil and an error message otherwise.

Example

pvr("hb" "/RFin" "/RFout" 2 2 )

This example returns the spectral power for the following values:

spm

spm( 
s_ana 
x_index1 
x_index2 
[ ?port1 x_port1 ] 
[ ?port2 x_port2 ]
) 
=> o_waveform / nil

Description

Returns the waveform for s-parameters.

Arguments

s_ana

Analysis type or analysis name.

Valid values: sp, psp, qpsp, and hbsp

Default value: sp

x_index1

Port index for sp simulation. By default, this field is set to blank.

Valid values: Available port index, such as 1, 2.

x_index1

Port index for sp simulation. By default, this field is set to blank.

Valid values: Available port index, such as 1, 2.

?port1 x_port1

Port instance. The port instance can be specified only for the differential s-parameter analysis and not applicable for psp, qpsp and hbsp analyses.

Valid values: Predefined values “c” and “d” for Spectre simulator.

?port2 x_port2

Port instance. The port instance can be specified only for the differential s-parameter analysis and not applicable for psp, qpsp and hbsp analyses.

Valid values: Predefined values “c” and “d” for Spectre simulator.

Value Returned

o_waveform

Returns a waveform representing the s-parameters.

nil

Returns nil and an error message otherwise.

Example

spm("sp" 1 1 ?port1 nil ?port2 nil)

This example plots the s-parameter waveform for sp analysis with index1=1 and index 2=1.

totalNoise

totalNoise( 
s_ana 
n_sfreq 
n_efreq 
[ instances l_instances ]
) 
=> n_totalNoise / nil

Description

Returns the total noise in a specified frequency limit.

Arguments

s_ana

Analysis type or analysis name. The available analyses are noise, pnoise, qpnoise, and hbnoise.

Default value: noise.

n_sfreq

The start frequency.

Valid values: Any integer or floating point number

n_efreq

The end frequency.

Valid values: Any integer or floating point number

l_instances

List of instances or instance names. The noise contributed by the instances specified in this field is ignored while calculating the total noise. This is an optional field.

Value Returned

n_totalNoise

Returns the total noise in a specified frequency limit.

nil

Returns nil and an error message otherwise.

Example

totalNoise("hbnoise" 1k 100k out )

This example returns the total noise for hbnoise analysis in the frequency range 1k to 100k with instance out being excluded.

vfreq

vfreq(
s_ana
t_net
[ freq x_freq ]
) 
=> o_waveform / nil

Description

Returns the voltage of a net at a specified frequency or at all frequencies in the frequency domain.

Arguments

s_ana

Analysis type or analysis name. The available analyses are hb, pss, qpss, pac, hbac, qpac, and ac.

Default value: hb

t_net

Net name from the schematic or signal name from the Results Browser.

x_freq

Frequency for which you want to plot the results. It is an optional field.

Valid values: Any integer value

Default Value: nil

Value Returned

o_waveform

Returns a waveform representing the voltage of net at a specified frequency

nil

Returns nil and an error message otherwise

Example

vfreq("hb" "/outp" 50 )

This example returns the voltage of /outp net from hb analysis at frequency=50.

vfreqterm

vfreqterm( 
s_ana 
t_terminal
[ freq x_freq ]
)
=> o_waveform | g_value | nil

Description

Returns the voltage of a terminal at a specified frequency or at all frequencies in the frequency domain.

Arguments

s_ana

Analysis type or analysis name. The available analyses are ac, pss, hb, pac, hbac, qpss, and qpac.

Default value: hb

t_terminal

Terminal name in schematic from the Results Browser.

freq x_freq

Frequency for which you want to plot the results. It is an optional field.

Valid value: Any integer value

Default value: nil

Value Returned

o_waveform

Returns a waveform representing the voltage at a terminal on the specified frequency.

g_value

Returns the value of voltage at a terminal on the specified frequency.

nil

Returns nil or an error message.

Example

vfreqterm( 'ac "/IO/M1/G" )
It returns the following plot. 

vh

vh( 
s_ana 
t_net 
[ x_hlist ] 
) 
=> o_waveform / nil

Description

Returns the voltage on a net at a specified harmonic or at all harmonics in the frequency domain.

Arguments

s_ana

Type of analysis.

Valid values are:

  • hb: Harmonic Balance analysis. This is the default value.
  • pss: Periodic Steady-State analysis.
  • qpss: Quasi-Periodic Steady-State analysis
  • pac: Periodic AC analysis
  • hbac: Harmonic Balance AC analysis
  • qpac: Quasi-Periodic AC analysis

t_net

Net name on the schematic or the signal name in the Results Browser.

x_hlist

Single harmonic or a list of harmonics for which you want to plot the voltage of the net.

This is an optional argument. You can specify a single harmonic or a list from the available list of harmonics. If a single harmonic is specified, the function returns the voltage at that harmonic. if a list of harmonics is specified, the function returns a waveform with the harmonics at each of the chosen harmonics.

You can find the available list of harmonics for each analysis by using the harmonicList function.

harmonicList( [?resultsDir t_resultsDir] [?result S_resultName]

In a single-tone simulation, each harmonic is described using an integer. In a multi-tone simulation, each harmonic is described using a list of integers, with one integer for each tone.

The default value is nil, which indicates that the voltage of the net is calculated for all harmonics.

Value Returned

o_waveform

Returns a waveform representing the voltage on a net at a specified harmonic or at all harmonic points.

nil

Returns nil and an error message otherwise.

Example

The following example returns a list of available harmonics for the specified results. In this example, two tones were simulated in the hb simulation, and therefore the harmonic list is a list of two-element indices.

harmonicList(?resultsDir "./simulation/ExampleLibRF/db_mixer/maestro/results/maestro/ExplorerRun.0/1/ExampleLibRF_db_mixer_1/psf" ?result 'hb_mt_fi)
=> ((-5 5) (-4 4) (-4 5) (-3 3) (-3 4) (-3 5) (-2 2) (-2 3) (-2 4) (-2 5) (-1 1) (-1 2) (-1 3) (-1 4) (-1 5) (0 0) (0 1) (0 2) (0 3) (0 4) (0 5) (1 0) (1 1) (1 2) (1 3) (1 4) (1 5) (2 -1) (2 0) (2 1) (2 2) (2 3) (2 4) (2 5) (3 -2) (3 -1) (3 0) (3 1) (3 2) (3 3) (3 4) (3 5) (4 -3) (4 -2) (4 -1) (4 0) (4 1) (4 2) (4 3) (4 4) (4 5) (5 -4) (5 -3) (5 -2) (5 -1) (5 0) (5 1) (5 2) (5 3) (5 4) (5 5) (6 -5) (6 -4) (6 -3) (6 -2) (6 -1) (6 0) (6 1) (6 2) (6 3) (6 4) (6 5))

To calculate the voltage on the net /out2 for the harmonic (0 2), that is 0 times one tone plus 2 times the other tone in hb analysis, specify the following:

vh("hb" "/out2" '(0 2))
=> srrWave:0x3d70d3f0

This returns a waveform representing the voltage on the net /out2 at the specified harmonic (0 2).

If you want to plot the voltage at different harmonic combinations, you can specify the list of harmonics. For example: '((0 2) (0 3) (0 4)).

The following example returns a waveform representing the voltage on the net /out2 at different harmonic combinations.

vh("hb" "/out2" '((0 2) (0 3) (0 4)))
=> srrWave:0x3d70dd50

vhterm

vhterm( 
s_ana 
t_terminal 
[ harmonic x_hlist ]
)
=> o_waveform | g_value | nil

Description

Returns the voltage on a terminal at the specified harmonic or at all the harmonics in the frequency domain.

Arguments

s_ana

Analysis type or analysis name. The available analyses are pss, hb, pac, hbac, qpss, and qpac.

Default value: hb

t_terminal

Terminal name in schematic from the Results Browser.

harmonic x_hlist

Harmonics for which you want to plot the results. It is an optional field. For analyses, such as hb, pss, pac, and hbac, you can add either single harmonic value or available list of harmonic values in this field.

Valid values: Any integer or a list from the available list of harmonics. You can find the available harmonics by using the harmonic list function.

Default value: nil

Value Returned

o_waveform

Returns a waveform representing the voltage at a terminal on the specified harmonic.

g_value

Returns the value of voltage at a terminal on the specified harmonic.

nil

Returns nil or an error message.

Example

vhterm( 'pac "/I19/M5/D" )
It returns the following plot.

vtime

vtime( 
s_ana 
t_net 
[ time n_time ] 
) 
=> o_waveform / nil

Description

Returns the voltage of a net at a specified time point or at all time points in the time domain.

Arguments

s_ana

Analysis type or analysis name. The available analyses are hb, pss, and tran.

Default value: hb

t_net

Net name from the schematic or signal name from the Results Browser.

n_time

Time points for which you want to plot the results. If you specify a time point in this field, the result of the specified time is returned. Otherwise, It is an optional field.

Valid values: Any integer or floating point number.

Default value: nil

Value Returned

o_waveform

Returns a waveform representing the voltage of net at a specified time point

nil

Returns nil and an error message otherwise

Example

vtime("hb" "/outm" 20)

This example returns the voltage of /outp net from hb analysis at time=20s.

vtimeterm

vtimeterm( 
s_ana 
t_terminal
[ time n_time ]
)
=> o_waveform | g_value | nil

Description

Returns the voltage of a terminal at a specified time point or at all time points in the time domain.

Arguments

s_ana

Analysis type or analysis name. The available analyses are tran, pss, and hb.

Default value: hb

t_terminal

Terminal name in schematic from the Results Browser.

time n_time

Time points for which you want to plot the results. If you specify a time point in this field, the result of the specified time point is returned. Otherwise, it is an optional field.

Valid value: Any integer or floating point number

Default value: nil

Value Returned

o_waveform

Returns a waveform representing the voltage at a terminal on the specified time point.

g_value

Returns the value of voltage at a terminal on the specified time point.

nil

Returns nil or an error message.

Example

vtimeterm( 'tran "/IO/M1/D" )

It returns the following plot.

ypm

ypm( 
s_ana
x_index1
x_index2 
) 
=> o_waveform / nil

Description

Returns the waveform for y-parameters.

Arguments

s_ana

Analysis type or analysis name.Valid values: sp, psp, qpsp, and hbsp

Default value: sp

x_index1

Port index for sp simulation. By default, this field is set to blank.

Valid values: Available port index, such as 1, 2

x_index1

Port index for sp simulation. By default, this field is set to blank.

Valid values: Available port index, such as 1, 2

Value Returned

o_waveform

Returns a waveform representing the y-parameters

nil

Returns nil and an error message otherwise

Example

ypm("sp" 1 1)

This example returns the waveform for y-parameters when index1=1 and index2=1.

zpm

zpm( 
s_ana 
x_index1
x_index2 
) 
=> o_waveform / nil

Description

Returns the waveform for z-parameters.

Arguments

s_ana

Analysis type or analysis name.

Valid values: sp, psp, qpsp, and hbsp

Default value: sp

x_index1

Port index for sp simulation. By default, this field is set to blank.

Valid values: Available port index, such as 1, 2

x_index1

Port index for sp simulation. By default, this field is set to blank.

Valid values: Available port index, such as 1, 2

Value Returned

o_waveform

Returns a waveform representing the z-parameters

nil

Returns nil and an error message otherwise

Example

zpm("sp" 1 1)

This example returns the waveform for z-parameters when index1=1 and index2=1.

RF Functions in Spectre

This section describes the OCEAN commands for the following RF functions:

B1f

B1f(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the alternative stability factor in terms of the specified parameters.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object representing the alternative stability factor.

nil

Returns nil and an error message otherwise.

gac_freq

gac_freq(
n_gain
n_startFreq
n_stopFreq
n_step
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the available power gain circles where the gain is fixed and frequency is swept.

Arguments

n_gain

Gain value in dB.

n_startFreq

Starting frequency.

n_stopFreq

Ending frequency.

n_step

Frequency step size to be used.

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Example

gac_freq(16 2G 3G 100M)

gac_gain

gac_gain(
n_freq
n_startGain
n_stopGain
n_step
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the available power gain circles where the frequency is fixed and gain is swept.

Arguments

n_freq

Frequency in Hz.

n_startGain

Starting gain value.

n_stopGain

End gain value.

n_step

Gain step size to be used.

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Example

gac_gain(2.4G 14 18 0.5)

Gmax

Gmax(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the maximum available gain for a two port.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Gmin

Gmin(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the optimum noise reflection coefficient for NFmin.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Gmsg

Gmsg(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the maximum stable power gain for a two port.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

GP

GP(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the power gain. Operating power gain, GP, is defined as the ratio between the power delivered to the load and the power input to the network.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object representing the power gain.

nil

Returns nil and an error message otherwise.

gpc_freq

gpc_freq(
n_gain
n_startFreq
n_stopFreq
n_step
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the operating power gain circles where the gain is fixed and frequency is swept.

Arguments

n_gain

Gain value in dB.

n_startFreq

Starting frequency.

n_stopFreq

Ending frequency.

n_step

Frequency step size to be used.

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Example

gpc_freq(16 2.4G 2.5G 10M)

gpc_gain

gpc_gain(
n_freq
n_start
n_stop
n_step
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the operating power gain circles where the frequency is fixed and gain is swept.

Arguments

n_freq

Frequency value in Hz.

n_start

Starting gain value.

n_stop

Ending gain value.

n_step

Gain step size to be used.

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Example

gpc_gain(2.4G 14 18 0.5)

GT

GT(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the transducer gain. Transducer power gain, GT, is defined as the ratio between the power delivered to the load and the power available from the source.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Gmux

Gmux(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the maximum unilateral power gain for a two port.

Maximum unilateral transducer power gain, Gumx, is the transducer power gain when S12 is zero, and the source and load impedances conjugate are matching.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Kf

Kf(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the Stern stability factor.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

loadStability

loadStability(
n_startFreq
n_stopFreq
n_step
[ ?resultsDir x_resultsDir ]
)
=> o_waveform / nil

Description

Computes the load stability circles.

Arguments

n_startFreq

Start of the frequency range.

n_StopFreq

End of the frequency range.

n_step

Frequency step size to be used.

?resultsDir x_resultsDir

Results directory path.

Value Returned

o_waveform

Waveform object representing the load stability circles.

nil

Returns nil and an error message otherwise.

Example

loadStability(2G 3G 0.2G)

loadStability(2G 3G 0.2G?resultsDir "./psf" )

nc_freq

nc_freq(
n_noiseLevel
n_startFreq
n_stopFreq
n_step
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the noise circles with fixed gain and swept frequency.

Arguments

n_noiseLevel

Noise level.

n_startFreq

Starting frequency.

n_stopFreq

Ending frequency.

n_step

Frequency step size to be used.

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Example

nc_freq(2 2G 3G 0.2G)

nc_gain

nc_gain(
n_freq
n_startNoiseLvl
n_stopNoiseLvl
n_step
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the noise circles with fixed frequency and swept noise level.

Arguments

n_freq

Fixed frequency.

n_startNoiseLvl

Starting noise level.

n_stopNoiseLvl

Ending noise level.

n_step

Sweeping noise level step size

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

Example

nc_gain(2.4G 1.5 2.4 0.2)

NF

NF(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the noise figure.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

NFmin

NFmin(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the minimum noise figure.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

rn

rn(
[ dataDir t_dataDir ]
)
=> o_waveform / nil

Description

Returns the normalized equivalent noise resistance as a function of frequency.

Arguments

dataDir t_dataDir

Results directory path.

Values Returned

o_waveform

Waveform object

nil

Returns nil and an error message otherwise.

sourceStability

sourceStability(
n_startFreq
n_stopFreq
n_step
[ ?resultsDir x_resultsDir ]
)
=> o_waveform / nil

Description

Computes the source stability circles.

Arguments

n_startFreq

Start of the frequency range.

n_StopFreq

End of the frequency range.

n_step

Frequency step size to be used.

?resultsDir x_resultsDir

Results directory path.

Value Returned

o_waveform

Waveform object representing the source stability circles.

nil

Returns nil and an error message otherwise.

Example

sourceStability(2G 3G 0.2G)

sourceStability(2G 3G 0.2G?resultsDir "./psf" )

s11

s11(
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the response at port 1 due to a signal at port 1.

Arguments

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object

nil

Returns nil and an error message otherwise.

s12

s12(
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the response at port 1 due to a signal at port 2.

Arguments

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object.

nil

Returns nil and an error message otherwise.

s21

s11(
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the response at port 2 due to a signal at port 1.

Arguments

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object

nil

Returns nil and an error message otherwise.

s22

s22(
[ ?resultsDir t_resultsDir ]
)
=> o_waveform / nil

Description

Returns the response at port 2 due to a signal at port 2.

Arguments

?resultsDir t_resultsDir

Results directory path.

Values Returned

o_waveform

Waveform object

nil

Returns nil and an error message otherwise.


Return to top
 ⠀
X