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:
- The degree of the numerator polynomial cannot exceed that of the denominator polynomial in the variable "s".
- 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:
.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 (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.
Parameters
Parameter | Description | Default |
---|---|---|
in_offset | Input offset. | 0 |
gain | Gain. | 1 |
num_coeff | Numerator polynomial coefficients. Enter a list of values, using spaces as separators. At least one value must be entered for the array. | |
den_coeff | Denominator polynomial coefficients. Enter a list of values, using spaces as separators. At least one value must be entered for the array. | |
int_ic | Integrator stage initial condition. | 0 |
denormalized_freq | Frequency (radians/second) at which to denormalize coefficients. | 1 |
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.