S-domain Transfer Function Block

In this Topic Hide

Netlist entry

Axxxx input output model_name

Connection details

Name Description Flow Default type Allowed types
in Input in v v, vd, i, id
out Output out v v, vd, i, id

Model format

.MODEL model_name s_xfer parameters

Model parameters

Name Description Type Default Limits Vector bounds
in_offset Input offset real 0 none n/a
gain Gain real 1 none n/a
laplace Laplace expression (overrides num_coeff and den_coeff) string none none n/a
num_coeff Numerator polynomial coefficient real vector none none $1 - \infty$
den_coeff Denominator polynomial coefficient real vector none none $1 - \infty$
int_ic Integrator stage initial conditions real vector 0 none none
denormalized_freq Frequency (radians/second) at which to denormalize coefficients real 1 none n/a

Description

This device implements an arbitrary linear transfer function expressed in the frequency domain using the 'S' variable. The operation and specification of the device is illustrated with the following examples.

Examples

Example 1 - A single pole filter

Model for above device:

.model Laplace s_xfer laplace="1/(s+1)" denormalized_freq=1

This is a simple first order roll off with a 1 second time constant as shown below

Example 2 - Single pole and zero

.model Laplace s_xfer
+ laplace="(1/s)/(1/s + 1/(0.1*s+1))"
+ denormalized_freq=1

The laplace expression has been entered how it might have been written down without any attempt to simplify it. The above actually simplifies to (0.1*s+1)/(1.1*s+1).

Example 3 - Underdamped second order response

.model Laplace s_xfer
+ laplace="1/(s2+1.1*s+1)"
+ denormalized_freq=2k

The above expression is a second order response that is slightly underdamped. The following graph shows the transient response.

Example 4 - 5th order Chebyshev low-pass filter

The S-domain transfer block has a number of built in functions to implement standard filter response. Here is an example. This is a 5th order chebyshev with -3dB at 100Hz and 0.5dB passband ripple.

.model Laplace s_xfer
+ laplace="chebyshevLP(5,100,0.5)"
+ denormalized_freq=1

and the response:

The Laplace Expression

As seen in the above examples, the transfer function of the device is defined by the model parameter LAPLACE. This is a text string and must be enclosed in double quotation marks. This may be any arithmetic expression containing the following elements:

Operators:
  • + - * / ^
where ^ means raise to power. Only integral powers may be specified.
Constants Any decimal number following normal rules. SPICE style engineering suffixes are accepted.
S Variable This can be raised to a power with '^' or by simply placing a constant directly after it (with no spaces). E.g. s^2 is the same as s2.
Filter response functions These are:

  • BesselLP(order, cut-off) Bessel low-pass
  • BesselHP(order, cut-off) Bessel high-pass
  • ButterworthLP(order, cut-off) Butterworth low-pass
  • ButterworthHP(order, cut-off) Butterworth high-pass
  • ChebyshevLP(order, cut-off, passband_ripple) Chebyshev low-pass
  • ChebyshevHP(order, cut-off, passband_ripple) Chebyshev high-pass


Where:
order Integer specifying order of filter. There is no maximum limit but in practice orders larger than about 50 tend to give accuracy problems.
cut-off -3dB Frequency in Hertz
passband_ripple Chebyshev only. Passband ripple spec. in dB

Defining the Laplace Expression Using Coefficients

Instead of entering a Laplace expression as a string, this can also be entered as two arrays of numeric coefficients for the numerator and denominator. In general this is less convenient than entering the expression directly, but has the benefit that it supports the use of parameters. In this method, use the NUM_COEFF and DEN_COEFF parameters instead of the LAPLACE expression.

The following simple example, demonstrates the method

.param f0=10
.param w0 = {2*3.14159265*f0}
.model laplace s_xfer num_coeff = [1] den_coeff = [{1/w0},1]

Other Model Parameters

Limitations

SIMetrix expands the expression you enter to create a quotient of two polynomials. If the constant terms of both numerator and denominator are both zero, both are divided by S. That process is repeated until one or both of the polynomials has a non-zero constant term.

The result of this process must satisfy the following:

The XSPICE S_XFER model

The SIMetrix Laplace transfer model is compatible with the original XSPICE version but the transient analysis portion of it has been completely rewritten. The original XSPICE version was seriously flawed and would only give accurate results if the timestep was forced to be very small. Further, convergence would fail if the device was used inside a feedback loop.

The ability to enter the laplace transform as an arbitrary expression is a SIMetrix enhancement. The original version required the user to enter the coefficients of the numerator and denominator explicitly. The filter response functions are also a SIMetrix enhancement.