Cadence Pspice特征函数.docx
《Cadence Pspice特征函数.docx》由会员分享,可在线阅读,更多相关《Cadence Pspice特征函数.docx(34页珍藏版)》请在冰豆网上搜索。
CadencePspice特征函数
[GOAL FUNCTIONS]
**************************************
*** Goal functions for general use ***
**************************************
Max
(1) = y1
*
*#Desc#* Find the maximum value of the trace.
*
*#Arg1#* Name of trace to search
*
{
1|Search forward max !
1;
}
Max_XRange(1,begin_x,end_x)=y1
*
*#Desc#* Find the maximum value of the trace within the specified X range.
*
*#Arg1#* Name of trace to search
*#Arg2#* X range begin value
*#Arg3#* X range end value
*
{
1| search forward (begin_x,end_x) max !
1 ;
}
Min
(1) = y1
*
*#Desc#* Find the minimum value of the trace.
*
*#Arg1#* Name of trace to search
*
{
1| search forward min !
1;
}
Min_XRange(1,begin_x,end_x)=y1
*
*#Desc#* Find the minimum value of the trace within the specified X range.
*
*#Arg1#* Name of trace to search
*#Arg2#* X range begin value
*#Arg3#* X range end value
*
{
1| search forward (begin_x,end_x) min !
1 ;
}
XatNthY(1,Y_value,n_occur)=x1
*
*#Desc#* Find the value of X corresponding to the nth occurrence of the
*#Desc#* given Y_value, for the specified trace.
*
*#Arg1#* Name of trace to search
*#Arg2#* Y value
*#Arg3#* nth occurrence
*
{
1| search forward for n_occur:
level (Y_value) !
1 ;
}
XatNthY_NegativeSlope(1,Y_value,n_occur)=x1
*
*#Desc#* Find the value of X corresponding to the nth negative slope
*#Desc#* crossing of the given Y_value, for the specified trace.
*
*#Arg1#* Name of trace to search
*#Arg2#* Y value
*#Arg3#* nth occurrence
*
{
1| search forward for n_occur:
level (Y_value,negative) !
1 ;
}
XatNthY_PositiveSlope(1,Y_value,n_occur)=x1
*
*#Desc#* Find the value of X corresponding to the nth positive slope
*#Desc#* crossing of the given Y_value, for the specified trace.
*
*#Arg1#* Name of trace to search
*#Arg2#* Y value
*#Arg3#* nth occurrence
*
{
1| search forward for n_occur:
level (Y_value,positive) !
1 ;
}
XatNthY_PercentYRange(1,Y_pct,n_occur)=x1
*
*#Desc#* Find the value of X corresponding to the nth occurrence of
*#Desc#* the trace crossing the given percentage of its full Y-axis
*#Desc#* range; i.e. nth occurrence of Y=Ymin+(Ymax-Ymin)*Y_pct/100
*
*#Arg1#* Name of trace to search
*#Arg2#* Y percentage
*#Arg3#* nth occurrence
*
{
1| search forward for n_occur:
level (Y_pct%) !
1 ;
}
YatX(1,X_value)=y1
*
*#Desc#* Find the value of the trace at the given X_value.
*
*#Arg1#* Name of trace to search
*#Arg2#* X value to get Y value at
*
* Usage:
*YatX(,)
*
{
1| search forward Xvalue (X_value) !
1 ;
}
YatFirstX
(1)=y1
*
*#Desc#* Find the value of the trace at the first X_value.
*
*#Arg1#* Name of trace to search
*
* Usage:
*YatFirstX()
*
{
1| search forward Xvalue (0%) !
1 ;
}
YatLastX
(1)=y1
*
*#Desc#* Find the value of the trace at the last X_value.
*
*#Arg1#* Name of trace to search
*
* Usage:
*YatLastX()
*
{
1| search forward Xvalue (100%) !
1 ;
}
YatX_PercentXRange(1,X_pct)=y1
*
*#Desc#* Find the value of the trace at the given percentage of the
*#Desc#* X axis range.
*
*#Arg1#* Name of trace to search
*#Arg2#* X percentage to get Y value at
*
* Usage:
*YatX_PercentXRange(,)
*
{
1| search forward Xvalue (X_pct%) !
1 ;
}
**************************************
*** Goal Functions for AC Analyses ***
**************************************
Bandwidth(1,db_level) = x2-x1
*
*#Desc#* Find the difference between the X values where the trace
*#Desc#* first crosses its maximum value minus evel (Ymax-)
*#Desc#* with a positive slope, and then with a negative slope.
*#Desc#* (i.e. Find the bandwidth of a signal.)
*
*#Arg1#* Name of trace to search
*#Arg2#* db level down for bandwidth calc
*
*#ForceDBArg1#*
*
{
1|Search forward level(max-db_level,p) !
1
Search forward level(max-db_level,n) !
2;
}
Cutoff_Lowpass_3dB
(1) = x1
*
*#Desc#* LowPass Cutoff.
*#Desc#* Find the X value at which the trace first crosses its maximum
*#Desc#* value minus 3dB with a negative slope.
*
*#Arg1#* Name of trace to search
*
*#ForceDBArg1#*
*
{
1|Search forward level(max-3,n) !
1;
}
Cutoff_Lowpass_3dB_XRange(1, begin_x,end_x) = x1
*
*#Desc#* LowPass Cutoff over specified X-range.
*#Desc#* Find the X value at which the trace first crosses its maximum
*#Desc#* value minus 3dB with a negative slope.
*
*#Arg1#* Name of trace to search
*#Arg2#* X range begin value
*#Arg3#* X range end value
*
*#ForceDBArg1#*
*
{
1|Search forward (begin_x,end_x) level(max-3,n) !
1;
}
Bandwidth_Bandpass_3dB
(1) = x2-x1
*
*#Desc#* BandPass BandWidth.
*#Desc#* Find the difference between the X values where the trace
*#Desc#* first crosses its maximum value minus 3dB (Ymax-3dB)
*#Desc#* with a positive slope, and then with a negative slope.
*#Desc#* (i.e. Find the 3dB bandwidth of a signal.)
*
*#Arg1#* Name of trace to search
*
*#ForceDBArg1#*
*
{
1|Search forward level(max-3,p) !
1
Search forward level(max-3,n) !
2;
}
Bandwidth_Bandpass_3dB_XRange(1,begin_x,end_x) = x2-x1
*
*#Desc#* BandPass BandWidth over a specified X-range.
*#Desc#* Find the difference between the X values where the trace
*#Desc#* first crosses its maximum value minus 3dB (Ymax-3dB)
*#Desc#* with a positive slope, and then with a negative slope.
*#Desc#* (i.e. Find the 3dB bandwidth of a signal.)
*
*#Arg1#* Name of trace to search
*#Arg2#* X range begin value
*#Arg3#* X range end value
*
*#ForceDBArg1#*
*
{
1|Search forward (begin_x,end_x) level(max-3,p) !
1
Search forward (begin_x,end_x) level(max-3,n) !
2;
}
Cutoff_Highpass_3dB
(1) = x1
*
*#Desc#* HighPass Cutoff.
*#Desc#* Find the X value at which the trace first crosses its maximum
*#Desc#* value minus db_level with a positive slope.
*
*#Arg1#* Name of trace to search
*
*#ForceDBArg1#*
*
{
1|Search forward level(max-3,p) !
1;
}
Cutoff_Highpass_3dB_XRange(1, begin_x,end_x) = x1
*
*#Desc#* HighPass Cutoff over specified X-range.
*#Desc#* Find the X value at which the trace first crosses its maximum
*#Desc#* value minus db_level with a positive slope.
*
*#Arg1#* Name of trace to search
*#Arg2#* X range begin value
*#Arg3#* X range end value
*
*#ForceDBArg1#*
*
{
1|Search forward (begin_x,end_x) level(max-3,p) !
1;
}
CenterFrequency(1, db_level) = (x1+x2)/2
*
*#Desc#* Find the midpoint between the X values where the trace first
*#Desc#* crosses its maximum value minus db_level (Ymax-db_level) with
*#Desc#* a positive slope, and then with a negative slope.
*#Desc#* (i.e. Find the center frequency of a signal.)
*
*#Arg1#* Name of trace to search
*#Arg2#* db level down for measurement
*
*#ForceDBArg1#*
*
{
1|Search forward level(max-db_level,p) !
1
Search forward level(max-db_level,n) !
2;
}
CenterFrequency_XRange(1, db_level, begin_x,end_x) = (x1+x2)/2
*
*#Desc#* Find the midpoint between the X values where the trace first
*#Desc#* crosses its maximum value minus db_level (Ymax-db_level) with
*#Desc#* a positive slope, and then with a negative slope over a
*#Desc#* specified X-range.
*#Desc#* (i.e. Find the center frequency of a signal.)
*
*#Arg1#* Name of trace to search
*#Arg2#* db level down for measurement
*#Arg3#* X range begin value
*#Arg4#* X range end value
*
*#ForceDBArg1#*
*
{
1|Search forward (begin_x,end_x) level(max-db_level,p) !
1
Search forward (begin_x,end_x) level(max-db_level,n) !
2;
}
Q_Bandpass(1, db_level) = ((x1+x2)/2)/(x2-x1)
*
*#Desc#* This function calculates Q (center frequency / bandwidth) of
*#Desc#* a bandpass response between the markers (lowpass and notch
*#Desc#* responses will not give meaningful results). The two
*#Desc#* points are found by scanning left and right from the maximum
*#Desc#* magnitude.
*
*#Arg1#* Name of trace to search
*#Arg2#* db level down for measurement
*
*#ForceDBArg1#*
*
{
1|Search forward level(max-db_level,p) !
1
Search forward level(max-db_level,n) !
2;
}
Q_Bandpass_XRange(1, db_level, begin_x,end_x) = ((x1+x2)/2)/(x2-x1)
*
*#Desc#* This function calculates Q (center frequency / bandwidth) of
*#Desc#* a bandpass response between a specified X-range (lowpass and notch
*#Desc#* responses will not give meaningful results). The two
*#Desc#* points are found by scanning left and right from the maximum
*#Desc#* magnitude.
*
*#Arg1#* Name of trace to search
*#Arg2#* db level down for measurement
*#Arg3#* X range begin value
*#Arg4#* X range end value
*
*#ForceDBArg1#*
*
{
1|Search forward (begin_x,end_x) level(max-db_level,p) !
1
Search forward (begin_x,end_x) level(max-db_level,n) !
2;
}
GainMargin(1,2) = 0-y2
*
*#Desc#* Find the value of the dB magnitude (second) trace at the same
*#Desc#* X value where the phase (first) trace crosses -180.
*
*#Arg1#* phase trace
*#Arg2#* magnitude trace in dB
*
* Usage:
*GainMargin(, )
*
{
* Search for where the phase is -180 degrees
1|Search forward level (-180) !
1;
* Find the magnitude where the phase is -180 degrees
2|Search forward xval (x1) !
2;
}
PhaseMargin(1,2) = y2+180
*
*#Desc#* Find the value of the phase (second) trace at the same X value
*#Desc#* where the dB magnitude (first) trace crosses 0.
*
*#Arg1#* magnitude trace in dB
*#Arg2#* phase trace
*
* Usage:
*PhaseMargin(, )
*
{
* Search for where the magnitude is 0 dB
1|Search forward level (0) !
1;
* Find the phase where the magnitude is 0 dB
2|Search forward xval (x1) !
2;
}
ZeroCross
(1) = x1
*
*#Desc#* Find th