S-Domain Transfer Function

The s-domain transfer function is a single input, single output transfer function in the Laplace transform variable "s" 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 "s".
  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.

The order of the coefficient parameters is from that associated with the highest-powered term decreasing to that of the lowest. Thus, for the coefficient parameters specified below, the equation in "s" is shown:

.model filter s_xfer(gain=0.139713 num_coeff=[1.0 0.0 0.07464102] den_coeff=[1.0 0.998942 0.01170077])

...specifies a transfer function of the form...


The s-domain transfer function includes gain and input offset parameters to allow for tailoring of the required signal. There are no limits on the internal signal values or on the output value of the s-domain transfer function, 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 "shifts" the corner frequency to the actual one of interest. As an example, the following transfer function describes a Chebyshev lowpass filter with a corner (passband) frequency of 1 rad/s:


In order to define an s_xfer model for the above, but with the corner frequency equal to 1500 rad/s (9425 Hz), the following instance and model lines would be needed:

al2 chebyl
.model chebyl s_xfer(num_coeff=[1] den_coeff=[l 1.09773 1.10251] denormalized.freq=1500)

In the above, you add the normalized coefficients and scales the filter through the use of the denormalized-freq parameter. Similar results could have been achieved by performing the denormalization prior to specification of the coefficients, and setting denormalized_freq to the value 1.0 (or not specifying the frequency, as the default is 1.0 rad/s) Note in the above that frequencies are ALWAYS SPECIFIED AS RADIANS/SECOND.

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 simulation points if truncation errors would otherwise be excessive.

Port Table

Description Direction Default Type Allowed Types Vector Vector Bounds Null Allowed
Input IN v v,vd,i,id NO   NO
Output OUT v v,vd,i,id NO   NO

Parameter Table

Name Description Data Type Default Value Limits Vector Vector Bounds Null Allowed
in_offset input offset Real 0.0   NO   YES
gain gain Real 1.0   NO   YES
num_coeff numerator polynomial coefficients Real     YES 1 / - YES
den_coeff denominator polynomial coefficients Real     YES 1 / - YES
int_ic integrator stage initial condition Real 0.0   YES   YES
denormalized_freq frequency (radians/second) at which to denormalize coefficients Real 1.0   NO   YES

Error Messages

S_XFER: Numerator coefficient array size greater than denominator coefficient array size.

This error message indicates that the order of the numerator polynomial specified is greater than that of the denominator. For the s_xfer model, the orders of numerator and denominator polynomials must be equal, or the order of the denominator polynomial must be greater than that or the numerator.


al4 9 22 cheby_LP_3KHz
.model cheby_LP_3KHz s_xfer(in_offset=0.0 gain=1.0 num.coeff=[1.0] den_coeff=[1.0 1.42562 1.51620])

See also

XSPICE Devices
XSPICE Code Models