Analog Differentiator Block
This device outputs the derivative of its input signal. It is a native RF.Spice A/D block and different from the XSPICE Differentiator Block, which is a more extensive model.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 | |
offset | offset voltage | V | 0 | |
fmax | maximum signal frequency | Hz | 1Meg |
Analog integrator Block
This device outputs the integral of its input signal assuming zero initial conditions. It is a native RF.Spice A/D block and different from the XSPICE Integrator Block, which is a more extensive model.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 | |
offset | offset voltage | V | 0 | |
fmax | maximum signal frequency | Hz | 1Meg |
Arithmetic Mean Block
This 3-pin device sends the arithmetic mean or average of its two inputs to the output with a default unity gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 |
Comparator with Hysteresis
This device is a 3-pin two-signal voltage comparator block with hysteresis effect. If the output voltage is at its low level and you increase Δv = (vpos - vneg), the output switches to the high level as soon as Δv > V_hys. If the output voltage is at its high level and you decrease Δv = (vpos - vneg), the output switches to the low level as soon as Δv < -V_hys.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
V_hi | high output voltage level | V | 5 | |
V_lo | high output voltage level | v | 100m | |
V_hys | hysteresis voltage width | V | 50m |
Complex Modulus Block
This 3-pin device assumes its first and second input signals to be the real and imaginary parts of a complex signal and sends the absolute value of such a complex signal to the output with a default unity gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 |
Controlled Limiter Block
The Controlled Limiter is a single-input, single-output block similar to the Gain Block. However, the output of the Controlled Limiter function is restricted to the range specified by the output lower and upper limits. This model operates in DC, AC and Transient analysis modes. Note that the limit range is the value below the Upper Limit Control input signal (CNTL_UPPER) and above the Lower Limit Control input signal (CNTL_LOWER) at which smoothing of the output signal begins. A minimum positive value of voltage difference must exist between the CNTL_UPPER and CNTL_LOWER inputs at all times. The main difference between the Controlled Limiter Block and the Limiter Block is that the former's limits are set by input control voltages, while the latter's limits are set as numerical parameters.
Also note that the Controlled Limiter function examines the input values of CNTL_UPPER and CNTL_LOWER to make sure that they are spaced far enough apart to guarantee the existence of a linear range between them. The range is calculated as the difference between (cntl_upper - upper_delta - limit_range) and (cntl_lower + lower_delta + limit_range) and must be greater than or equal to zero. When the limit_range is specified as a fractional value, the limit_range used in the above is taken as the calculated fraction of the difference between cntl_upper and cntl_lower. Still, the potential exists for too great a limit_range value to be specified for proper operation, in which case the model will return an error message.
Model Identifier: climit
Netlist Format:
A<device_name> <in_pin> <cntl_upper_pin> <cntl_lower_pin> <out_pin> <model_name>
.model <model_name> climit {<param1 = value> < param2 = value> ...}
Example:
A1 1 2 3 4 controlled_limit_block
.model controlled_limit_block climit in_offset = 0.0 gain = 1.0 upper_delta = 0.0 lower_delta = 0.0
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
in_offset | input offset | V | 0.0 | |
gain | gain | - | 1.0 | |
upper_delta | output upper delta | - | 0.0 | |
lower_delta | output lower delta | - | 0.0 | |
limit_range | upper and lower sm. Range | - | 1.0e-6 | |
fraction | smoothing %/abs switch | - | False |
Current Limiter Block
The Current Limiter Block models the behavior of an operational amplifier or comparator device at a high level of abstraction. All of its pins act as inputs; three of the four also act as outputs. The model takes as input a voltage value from the “in” connector. It then applies an offset and a gain, and derives from it an equivalent internal voltage (veq), which it limits to fall between pos pwr and neg pwr. If veq is greater than the output voltage seen on the “out” connector, a sourcing current will flow from the output pin. Conversely, if the voltage is less than vout, a sinking current will flow into the output pin. Depending on the polarity of the current flow, either a sourcing or a sinking resistance value (r_out_source, r_out_sink) is applied to govern the vout/i_out relationship. The chosen resistance will continue to control the output current until it reaches a maximum value specified by either i_limit_source or i_limit_sink. The latter mimics the current limiting behavior of many operational amplifier output stages. During all operation, the output current is reflected either in the pos_pwr connector current or the neg_pwr current, depending on the polarity of i_out. Thus, realistic power consumption as seen in the supply rails is included in the model. The user-specified smoothing parameters relate to model operation as follows: v_pwr_range controls the voltage below vpos_pwr and above vneg_pwr inputs beyond which veq [= gain * (vin + voffset)] is smoothed; i_source_range specifies the current below i_limit_source at which smoothing begins, as well as specifying the current increment above i_out=0.0 at which i_pos_pwr begins to transition to zero; i_sink_range serves the same purpose with respect to i_limit_sink and i_neg_pwr that i_source_range serves for i_limit_source & i_pos_pwr; r_out_domain specifies the incremental value above and below (veq-vout)=0.0 at which r_out will be set to r_out_source and r_out_sink, respectively. For values of (veq-vout) less than r_out_domain and greater than -r_out_domain, r_out is interpolated smoothly between r_out_source & r_out_sink.
Model Identifier: ilimit
Netlist Format:
A<device_name> <in_pin> <pos_pwr_pin> <neg_pwr_pin> <out_pin> <model_name>
.model <model_name> ilimit {<param1 = value> < param2 = value> ...}
Example:
A1 1 2 3 4 amp
.model amp ilimit in_offset=0.0 gain=16.0 r_out_source=1.0 r_out_sink=1.0 i_limit_source=1e-3 i_limit_sink=10e-3 v_pwr_range=0.2 i_source_range=1e-6 i_sink_range=1e-6 r_out_domain=1e-6
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
in_offset | input offset | V | 0.0 | |
gain | gain | - | 1.0 | |
r_out_source | sourcing resistance | Ω | 1.0 | |
r_out_sink | sinking resistance | Ω | 1.0 | |
i_limit_source | current sourcing limit | A | 10m | |
i_limit_sink | current sinking limit | A | 10m | |
v_pwr_range | power smoothing range | V | 1u | |
i_source_range | current sourcing smoothing range | A | 1n | |
i_sink_range | current sinking smoothing range | A | 1n | |
r_out_domain | output resistance smoothing domain | Ω | 1n |
Differentiator Block
The Differentiator Block approximates the time derivative of an input signal by calculating the incremental slope of that signal since the previous time point. Gain and output offset parameters are also included to allow for tailoring of the required signal. Output upper and lower limits are also included to prevent convergence erros resulting from excessively large output values. The incremental value of output below the output_upper_limit and above the output_lower_limit at which smoothing begins is specified via the limit_range parameter. In AC analysis, the value returned is equal to the radian frequency of analysis multiplied by the gain.
Model Identifier: d_dt
Netlist Format:
A<device_name> <in_pin> <out_pin> <model_name>
.model <model_name> d_dt out_lower_limit = <value> out_upper_limit = <value> {<param1 = value> < param2 = value> ...}
Example:
A1 1 2 differentiator
.model differentiator d_dt out_lower_limit = -1t out_upper_limit = 1t
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 | |
out_offset | output offset | V | 0.0 | |
out_lower_limit | output lower limit | V | -1t | required |
out_upper_limit | output upper limit | V | 1t | required |
limit_range | upper and lower limit smoothing range | - | 1.0e-6 |
Divider Block
The Divider Block has two inputs. Each of the numerator and denominator inputs is added to its respective offset and then multiplied by its respective input gain (with default values of 1). Next, the loaded numerator signal is divided by the loaded denominator signal. The result is multiplied by the output gain and then added to the output offset. To avoid division by zero, the divider function sets the denominator signal greater than zero through the lower limit parameter. This limit is approached through a quadratic smoothing function, the domain of which may be specified as a fraction of the lower limit value or as an absolute value. The divider function operates in DC, AC, and Transient analysis modes. In AC analysis, however, it is important to remember that results are invalid unless the denominator input is a DC voltage.
Model Identifier: divide
Netlist Format:
A<device_name> <num_pin> <den_pin> <out_pin> <model_name>
.model <model_name> divide {<param1 = value> < param2 = value> ...}
Example:
A1 1 2 3 divider_block
.model divider_block divide den_offset = 0.0 den_gain = 1.0
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
num_offset | numerator offset | V | 0.0 | |
num_gain | numerator gain | - | 1.0 | |
den_offset | denominator offset | V | 0.0 | |
den_gain | denominator gain | - | 1.0 | |
den_lower_limit | denominator lower limit | V | 1.0e-10 | |
den_domain | denominator smoothing domain | - | 1.0e-10 | |
fraction | smoothing fraction/absolute value switch | - | False | |
out_gain | output gain | - | 1.0 | |
out_offset | output offset | V | 0.0 |
Frequency Detector Block
This device measures the frequency of a harmonic input signal and produces a voltage proportional to the frequency in Hz at the output. It can also be used as a frequency converter.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
r_in | input resistance | Ω | 1G | |
r_out | output resistance | Ω | 1u | |
K_v | voltage conversion factor | V/Hz | 1e-6 | |
max_in | input amplitude | V | 1 |
Gain Block
This model is a simple gain block with optional offsets on the input and the output. In_offset is added to the input, the sum of which is then multiplied by the gain, and the output offset is added to produce the final output. The gain block model will operate in DC, AC, and Transient analysis modes.
Model Identifier: gain
Netlist Format:
A<device_name> <in_pin> <out_pin> <model_name>
.model <model_name> gain {<param1 = value> < param2 = value> ...}
Example:
A1 1 2 gain_block
.model gain_block gain in_offset = 0.0 out_offset = 0.0
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
in_offset | input offset | V | 0.0 | |
gain | gain | - | 1.0 | |
out_offset | out_offset | V | 0.0 |
Geometric Mean Block
This 3-pin device sends the geometric mean of its two inputs to the output with a default unity gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 |
Gudermannian Polarity Detector Block
This 3-pin device measures the difference signal Δv = vpos - vneg and produces an output proportional to the Gudermannian function of Δv:
[math] v_{out} = A \cdot \frac{2}{\pi} \ gd(a\Delta v) = A \cdot \left( \frac{4}{\pi} \tan^{-1}(e^{a\Delta v}) - 1 \right) [/math]
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
a | shaping Constant | - | 10 | |
MaxVal | output amplitude | V | 1 |
Ideal Buffer Block
This model is an ideal buffer block with a default unity gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
r_in | input resistance | Ω | 1G | |
r_out | output resistance | Ω | 1u | |
gain | gain | - | 1.0 |
Ideal Comparator Block
This block is an ideal two-signal voltage comparator with a default unity gain. It has a binary output that takes a value of 0V if vpos < vneg and takes a value of 1V if vpos > vneg. If vpos = vneg, the output voltage is 0.5V.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | comparator gain | - | 1.0 |
Ideal Delay Block
This model is an ideal signal delay block based on an ideal delay line model.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
delay | time delay | sec | 1u |
Ideal Full-Wave Rectifier Block
This block rectifies an input signal at both positive and negative cycles with a default unity gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | rectifier gain | - | 1.0 |
Ideal Gyrator Block
An ideal gyrator is a linear two-port device which couples the current on one port to the voltage on the other and vice versa. The instantaneous voltages and currents instantaneous are related by:
- [math]v_{out}(t) = R \cdot i_{in}(t) [/math]
- [math]v_{in}(t) = - R \cdot i_{out}(t) [/math]
The ideal gyrator acts as an impedance inverter.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
r | gyration resistance | Ω | 1.0 |
Ideal Half-Wave Rectifier Block
This block rectifies an input signal at positive cycles with a default unity gain. Its output at negative cycles is zero.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | rectifier gain | - | 1.0 |
Ideal Phase Shifter Block
This model is an ideal signal phase shifter block based on an ideal transmission line segment model. It is frequency-dependent and the signal phase shift is accurate only around the specified center frequency.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
phi | phase shift | deg | 90 | must be positive |
fo | center frequency | Hz | 1Meg |
Ideal Polarity Detector Block
This 3-pin device measures the difference signal Δv = vpos - vneg and produces a binary output ±A according to the sign of Δv, where A is a user defined amplitude.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
MaxVal | output amplitude | V | 1 |
Ideal Splitter Block
This model is an ideal signal splitter block with a default one-half split ratio. It splits the input signal by a ratio of k:(1-k).
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
k | split ratio | - | 0.5 |
Integer Modulo Block
This 3-pin device requires a voltage with an integer value on its second input pin. It produces a voltage equal to vin1 % vin2 and sends it to the output with a default unity gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 |
Integrator Block
The Integrator Gain and input offset parameters are also included to allow for tailoring of the required signa. Output upper and lower limits are also included to prevent convergence errors resulting from excessively large output values. Note that these limits specify integrator behavior similar to that found in an operational amplifier-based integration stage, in that once a limit is reached, additional storage does not occur. Thus the input of a negative value to an integrator which is currently driving at the out_upper_limit level will immediately cause a drop in the output, regardless of how long the integrator was previously summing positive inputs. The incremental value of output below the output_upper_limit and above the output_lower_limit at which smoothing begins is specified via the limit_range parameter. In AC analysis, the value returned is equal to the gain divided by the radian frequency of analysis.
Note that truncation error checking is included in the \93int\94 block. This should provide for a more accurate simulation for the time integration function, since the model will inherently request smaller time increments between simulation points if truncation errors would otherwise be excessive.
Model Identifier: int
Netlist Format:
A<device_name> <in_pin> <out_pin> <model_name>
.model <model_name> int out_lower_limit = <value> out_upper_limit = <value> {<param1 = value> < param2 = value> ...}
Example:
A1 1 2 integrator_block
.model integrator_block int out_lower_limit = -1t out_upper_limit = 1t
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 | |
in_offset | output offset | V | 0.0 | |
out_lower_limit | output lower limit | V | -1t | required |
out_upper_limit | output upper limit | V | 1t | required |
limit_range | upper and lower limit smoothing range | - | 1.0e-6 | |
out_ic | output initial condition | V | 0.0 |
Leading Edge Detector Block
This device follows its input signal and produces an output at the specified low voltage level. Every time a leading edge of the input signal is detected, that is vin crosses the specified threshold level from a lower value to a high value, a short pulse of the specified width with an amplitude equal to the specified high voltage level is generated at the output.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
Vt | threshold voltage | V | 0.5 | |
out_low | low output voltage level | V | 0 | |
out_high | high output voltage level | v | 1 | |
pulse_wid | output pulse width | sec | 0.1u |
Limiter Block
The Limiter is a single-input, single-output block similar to the Gain Block. However, the output of the Limiter function is restricted to the range specified by the output lower and upper limits. This model operates in DC, AC and Transient analysis modes. Note that the limit range is the value below the UPPER LIMIT and above the LOWER LIMIT at which smoothing of the output signal begins. For this model, then, the limit range represents the delta with respect to the output level at which smoothing occurs. Thus, for an input gain of 2.0 and output limits of 1.0 and -1.0 volts, the output will begin to smooth out at �+/-0.9 volts, which occurs when the input value is at 0.4V.
Model Identifier: limit
Netlist Format:
A<device_name> <in_pin> <out_pin> <model_name>
.model <model_name> limit {<param1 = value> < param2 = value> ...}
Example:
A1 1 2 limit_block
.model limit_block limit in_offset = 0.0 gain = 1.0 out_lower_limit = -1t out_upper_limit = 1t
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
in_offset | input offset | V | 0.0 | |
gain | gain | - | 1.0 | |
out_lower_limit | output lower limit | V | 0.0 | |
out_upper_limit | output upper limit | V | 1.0 | |
limit_range | upper and lower smoothing range | - | 1.0e-6 | |
fraction | smoothing fraction/absolute value switch | - | False |
Link Propagation Block
This block models a receiver signal in a free-space, line-of-sight (LOS) communication link. It takes the input signal and attenuates and delays it at the output based on Friis' equation for the specified range.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
range | distance between transmitter and receiver | m | 1.0 | |
fo | frequency | Hz | 1Meg | |
G_Tx | transmit antenna gain in dB | - | 0 | |
G_Rx | receive antenna gain in dB | - | 0 |
Maximum Detector Block
This device follows its input voltage and holds its maximum value at the output.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
r_in | input resistance | Ω | 1G | |
r_out | output resistance | Ω | 1u |
Maximum Selector Block
This 3-pin device selects the larger of its two inputs and sends it to the output with a default unity gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 |
Minimum Detector Block
This device follows its input voltage and holds its minimum value at the output.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
r_in | input resistance | Ω | 1G | |
r_out | output resistance | Ω | 1u |
Minimum Selector Block
This 3-pin device selects the smaller of its two inputs and sends it to the output with a default unity gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | gain | - | 1.0 |
Multiplier Block
The Multiplier Block has two inputs. Each input is added to its respective offset and then multiplied by the specified input gain (with default values of 1). These are then multiplied along with the output gain and the result is added to the output offset. Note that the input offsets and input gains are specified as vectors. The multiplier function operates in DC, AC, and Transient analysis modes. In AC analysis, however, it is important to remember that results are invalid unless one of the inputs is a DC voltage.
Model Identifier: mult
Netlist Format:
A<device_name> [<in_pin1> <in_pin2> {...}] <out_pin> <model_name>
.model <model_name> mult {<param1 = value> < param2 = value> ...}
Example:
A1 [1 2] 3 mult_block
.model mult_block mult in_offset = [0.0 0.0] in_gain = [1.0 1.0] out_gain = 1.0 out_offset = 0.0
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
in_offset | input offset vector | V | [0.0 0.0] | |
in_gain | input gain vector | - | [1.0 1.0] | |
out_gain | output gain | - | 1.0 | |
out_offset | output offset | V | 0.0 |
Peak Detector Block
This device follows its input voltage and holds its peak value (the greater of the absolute values of its maximum or minimum) at the output.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
r_in | input resistance | Ω | 1G | |
r_out | output resistance | Ω | 1u |
Phase Detector Block
This 3-pin device measures the phase difference between two harmonic input signals of the same frequency and produces a voltage proportional to the phase difference in radians at the output. Only the absolute phase difference is detected. This block cannot determine phase lead or phase lag.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
r_in | input resistance | Ω | 1G | |
r_out | output resistance | Ω | 1u | |
K_v | voltage conversion factor | V/rad | 1 |
Piecewise Linear Map Block
This 3-pin device provides a linear mapping of the input signal onto the output signal. The piecewise linear map is define in the XY plane by a start point, an end point, and N breakpoints between them.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
startX | starting value of X | V | 0 | required |
startY | starting value of Y | V | 0 | required |
breakpointN | number of breakpoints | - | 2 | required |
breakpointX | breakpoints for X | V | 1 2 | required |
breakpointY | breakpoints for Y | V | 1 4 | required |
finalX | final value of X | V | 3 | required |
finalY | final value of Y | V | 9 | required |
r_in | input resistance | Ω | 10G | |
r_out | output resistance | Ω | 1u |
Polar-to-Rect Coordinates Conversion Block
This 4-pin device takes two input signals as the radius and angle coordinates (ρ, φ) on a plane and generates the equivalent Cartesian coordinates as two output voltage signals: X and Y, with optional gains. The angle input signal must be expressed in radians.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
out_gain1 | output gain | - | 1.0 |
Radar Echo Block
This block models a radar echo signal. It takes the input signal and attenuates and delays it at the output based on the radar equation given the target range and its specified RCS.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
range | target range | m | 1.0 | |
fo | frequency | Hz | 1Meg | |
sigma | target RCS | m2 | 1.0 | |
G_Tx | transmit antenna gain in dB | - | 0 | |
G_Rx | receive antenna gain in dB | - | 0 |
Range-Crossing Detector Block
This 4-pin device compares its input signal to two different reference voltages. If detects the events every time vin becomes less than vref1 or greater than vref2. If vref1 ≤ vin ≤ vref2, the output is zero. If vin < vref1, the output switches to -A, and if vin > vref2, the output switches to +A.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
max_val | output amplitude | V | 1 |
Rect-to-Polar Coordinates Conversion Block
This 4-pin device takes two input signals as the X and Y coordinates on a plane and generates the equivalent polar coordinates as two output voltage signals: radius and angle, with optional gains. The angle output signal is expressed in radians.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
out_gain1 | gain of radius output | - | 1.0 | |
out_gain2 | gain of angle output | - | 1.0 |
S-Domain Transfer Function Block
The s-domain transfer function is a single input and output transfer function in the Laplace transform variable \93s\94 that allows for flexible modulation of the frequency-domain characteristics of a signal. The code model may be configured to produce an arbitrary s-domain transfer function with the following restrictions:
1. The degree of the numerator polynomial cannot exceed that of the denominator polynomial in the variable \93s\94.
2. The coefficients for a polynomial must be stated explicitly. That is, if a coefficient is zero, it must be included as an input to the num_coeff or den_coeff vector.
Gain and input offset parameters are included to allow for tailoring of the required signal. Internal signal values and the output value of the s-domain transfer function do not have limits, so you are cautioned to specify gain and coefficient values that will not cause the model to produce excessively large values. In AC analysis, the value returned is equal to the real and imaginary components of the total s-domain transfer function at each frequency of interest.
The denormalized_freq term allows you to specify coefficients for a normalized filter (i.e., one in which the frequency of interest is 1 rad/s) Once these coefficients are included, specifying the denormalized frequency value \93shifts\94 the corner frequency to the actual one of interest.
Truncation error checking is included in the s-domain transfer block. This should provide for more accurate simulations, since the model will inherently request smaller time increments between simulations points if truncation errors would otherwise be excessive.
The order of the coefficient parameters is from that associated with the highest-powered term decreasing to that of the lowest.
Model Identifier: s_xfer
Netlist Format:
A<device_name> <in_pin> <out_pin> <model_name>
.model <model_name> s_xfer num_coeff = [<value1> {<value2>}...] den_coeff = [<value1> {<value2>}...]
+
int_ic = [<value1> {<value2>}...] {<param1 = value> < param2 = value> ...}
Example:
A 1 2 A_transfer_function
.model A_transfer_function s_xfer num_coeff = [1] den_coeff = [1] int_ic = [0.0]
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
In_offset | input offset | V | 0.0 | |
Gain | gain | - | 1.0 | |
Num_coeff | numerator polynomial coefficients | - | [1] | required |
Den_coeff | denominator polynomial coefficients | - | [1] | required |
Int_ic | integrator stage initial conditions | V | [0.0] | required |
Denormalized_freq | denormalized corner frequency | rad/s | 1.0 |
Schmitt Trigger Block
This device is a 2-pin Schmitt trigger switch with hysteresis effect. In general, if vin < X1, then vout = Y1, and if vin > X2, then vout = Y2. If the output voltage is at its low level Y1 and you increase the input signal, the output switches to the high level Y2 as soon as vin > X2. If the output voltage is at its high level Y2 and you decrease the input signal, the output switches to the low level Y1 as soon as vin < X1. The flag INV converts the block into an inverting Schmitt trigger.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
r_in | input resistance | Ω | 1G | |
r_out | output resistance | Ω | 1u | |
X1 | lower input switching voltage level | V | -1.0 | |
X2 | higher input switching voltage level | v | 1.0 | |
Y1 | lower output voltage level | V | -1.0 | |
Y2 | higher output voltage level | V | 1.0 | |
INV | flag for inverting Schmitt trigger | - | False |
Sigmoid Polarity Detector Block
This 3-pin device measures the difference signal Δv = vpos - vneg and produces an output proportional to the Sigmoid function of Δv:
[math] v_{out} = A \cdot \left( 2S(a\Delta v) - 1 \right) = A \cdot \left( \frac{2}{1+\exp(-a\Delta v)} - 1 \right) [/math]
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
a | shaping Constant | - | 10 | |
MaxVal | output amplitude | V | 1 |
Signal Normalizer Block
This block normalizes an input signal by dividing its voltage by its maximum value.
Parameters:
None
Sine-to-Square Wave Converter Block
This device converts an input sinusoidal signal to a square wave or pulse train of the same frequency and amplitude with an optional gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | converter gain | - | 1 |
Slew Rate Block
This function limits the absolute slope of the output with respect to time to some maximum or value. The actual slew rate effects of over-driving an amplifier circuit can thus be accurately modeled by cascading the amplifier with this model. Maximum rising and falling slope values are in volts or amperes per second. Thus a desired slew rate of 0.5 V/us will be expressed as 0.5e+6, etc.
The slew rate block will continue to raise or lower its output until the difference between the input and the output values is zero. Thereafter, it will resume following the input signal, unless the slope again exceeds its rise or all slope limits. Whenever the model is slewing and the output comes to within the input +/- the range value, the partial derivative of the output with respect to the input will begin to smoothly transition from 0.0 to 1.0. Dout/din will equal 1.0 when the model is no longer slewing (output = input).
Model Identifier: slew
Netlist Format:
A<device_name> <in_pin> <out_pin> <model_name></P>
.model <model_name> slew {<param1 = value> < param2 = value> ...}
Example:
A1 1 2 slew_block
.model slew_block slew rise_slope = 1n fall_slope = 1n
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
Rise_slope | maximum rising slope value | V/s | 1.0e9 | |
Fall_slope | maximum falling slope value | V/s | 1.0e9 |
Slope Detector Block
This device follows its input signal and send its measured slope to the output with a default unity gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
r_in | input resistance | Ω | 1G | |
r_out | output resistance | Ω | 1u | |
gain | gain | - | 1.0 |
Summer Block
The Summer Block has two inputs. Each input is added to its respective offset and then multiplied by the specified input gain (with default values of 1). These are then summed, multiplied by the output gain and added to the output offset. Note that the input offsets and input gains are specified as vectors. The summer function operates in DC, AC, and Transient analysis modes.
Model Identifier: summer
Netlist Format:
A<device_name> <in_pin> <out_pin> <model_name>
.model <model_name> summer {<param1 = value> < param2 = value> ...}
Example:
A1 [1 2] 3 summer
.model summer summer in_offset = [0 0] in_gain = [1 1] out_gain = 1.0 out_offset = 0.0
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
in_offset | input offset vector | V | [0 0] | |
in_gain | input gain vector | - | [1 1] | |
out_gain | output gain | - | 1.0 | |
out_offset | output offset | V | 0.0 |
Trailing Edge Detector Block
This device follows its input signal and produces an output at the specified low voltage level. Every time a trailing edge of the input signal is detected, that is vin crosses the specified threshold level from a higher value to a lower value, a short pulse of the specified width with an amplitude equal to the specified high voltage level is generated at the output.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
Vt | threshold voltage | V | 0.5 | |
out_low | low output voltage level | V | 0 | |
out_high | high output voltage level | v | 1 | |
pulse_wid | output pulse width | sec | 0.1u |
Triangular-to-Sine Wave Converter Block
This device converts an input triangular wave signal to a sinusoidal signal of the same frequency and amplitude with an optional gain.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
gain | converter gain | - | 1 |
Triangular-to-Square Wave Converter Block
This device converts an input triangular wave signal to a square wave or pulse train of the same frequency with a specified peak amplitude.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
max_val | output peak amplitude | V | 1 |
Zero-Crossing Detector Block
This 3-pin device follows its input signal, detects its sign changes, and produces two binary outputs based on the zero crossings: Output 1 is a pulse train and Output 2 is an impulse train. Both output signals oscillate between -A and +A every time the input signal has a sign change.
Parameters:
NAME | PARAMETER | UNITS | DEFAULT | NOTES |
---|---|---|---|---|
f_max | highest frequency | Hz | 1Meg | |
max_val | output amplitude | V | 1 |