EDN logo


Design Ideas: April 11, 1996

Spice provides z-domain circuit simulation

B Al-Hashimi and M Moniri,
Staffordshire University, Stafford, UK


Commercial Spice simulators, such as MicroSim's PSpice, simulate circuits using analog behavioral modeling (ABM), in which you model a circuit as a black box. The circuit's description takes the form of a mathematical function or an s-domain transfer function. Reference 1 gives examples of developing LaPlace-function models of analog filters. Unfortunately, PSpice ABM does not directly support the simulation of z-domain transfer functions. These functions describe discrete-time system operations, such as those used in switched-capacitor and digital filters. A method shown here uses the LaPlace function of ABM to achieve z-domain simulation.

To demonstrate this method, consider the simulation of a third-order, elliptic, lowpass switched-capacitor filter with the following specs: passband=3.2 kHz, passband ripple=0.9 dB, stopband attenuation >=22 dB at 4.3 kHz, and clock frequency=24 kHz. The filter has the following z-domain transfer function (Reference 2):

However, the s and z domains are related by the simple equation

z=esT=es/fc,


where s is the LaPlace operator, T is the sampling period, and fc is clock frequency. If you substitute Eq 1 into 2, it's possible to simulate the resulting transfer function using the LaPlace function. Listing 1 gives the PSpice netlist of Eq 1. Assume that the filter-transfer function, H(z), represents a voltage ratio. Note that the PSpice routine models H(z) using a voltage-controlled voltage source (the e component) that has the LaPlace description. For ease of use, you define variable z as a function using the .FUNC statement, with its argument defining the power of z or the delay required. The frequency response of discrete-time systems depends on the clock frequency; therefore, you must define the response using a .PARAM command (
Listing 1). Figure 1 displays the simulated filter-frequency response. Figure 2 gives the time-domain filter response and clearly shows the sampled nature of discrete systems. (DI #1852)

References

  1. Al-Hashimi, B, "Behavioral model emulates universal filter," EDN, Feb 4, 1993, pg 124.
  2. Schaumann, R, M Ghausi, and K Laker, Design of Analog Filters, Prentice-Hall, 1990, ISBN: 0132015919.


| EDN Access | feedback | subscribe to EDN! |
| design features | out in front | design ideas | departments | products | columnist |


Copyright © 1996 EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.